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_LIGHT_H 18 #define ANDROID_LIGHT_H 19 20 21 #include "rsObjectBase.h" 22 23 // --------------------------------------------------------------------------- 24 namespace android { 25 namespace renderscript { 26 27 28 // An element is a group of Components that occupies one cell in a structure. 29 class Light : public ObjectBase 30 { 31 public: 32 Light(Context *, bool isLocal, bool isMono); 33 virtual ~Light(); 34 35 // Values, mutable after creation. 36 void setPosition(float x, float y, float z); 37 void setColor(float r, float g, float b); 38 39 void setupGL(uint32_t num) const; 40 41 protected: 42 float mColor[4]; 43 float mPosition[4]; 44 bool mIsLocal; 45 bool mIsMono; 46 }; 47 48 49 class LightState { 50 public: 51 LightState(); 52 ~LightState(); 53 54 void clear(); 55 56 bool mIsMono; 57 bool mIsLocal; 58 }; 59 60 61 } 62 } 63 #endif //ANDROID_LIGHT_H 64 65