rsComponent.h revision 326e0ddf89e8df2837752fbfd7a014814b32082c
1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_RS_STRUCTURED_COMPONENT_H
18#define ANDROID_RS_STRUCTURED_COMPONENT_H
19
20#include <stdint.h>
21#include <sys/types.h>
22#include <stdlib.h>
23
24#include "RenderScript.h"
25#include "rsObjectBase.h"
26
27// ---------------------------------------------------------------------------
28namespace android {
29namespace renderscript {
30
31class Component : public ObjectBase
32{
33public:
34    enum DataType {
35        FLOAT,
36        UNSIGNED,
37        SIGNED
38    };
39
40    enum DataKind {
41        NONE,
42        RED, GREEN, BLUE, ALPHA, LUMINANCE, INTENSITY,
43        X, Y, Z, W,
44        S, T, Q, R,
45        NX, NY, NZ,
46        INDEX,
47        USER
48    };
49
50
51    Component(DataKind dk, DataType dt, bool isNormalized, uint32_t bits);
52    virtual ~Component();
53
54    DataType getType() const {return mType;}
55    bool getIsNormalized() const {return mIsNormalized;}
56    DataKind getKind() const {return mKind;}
57    uint32_t getBits() const {return mBits;}
58
59protected:
60
61    DataType mType;
62    bool mIsNormalized;
63    DataKind mKind;
64    uint32_t mBits;
65
66private:
67    Component();
68};
69
70
71}
72}
73
74#endif //ANDROID_RS_STRUCTURED_COMPONENT_H
75
76