00001 /* -*- C++ -*- */ 00002 00003 /* COPYRIGHT 00004 * 00005 * This file is part of the Visual Effects Engine - VEE 00006 * 00007 * Read the "VEE-LICENSE" file for the license. 00008 * 00009 * Authors & Copyright: 00010 * 00011 * Tommi Ilmonen, Tuukka Heikura, Marko Myllymaa and 00012 * Janne Kontkanen 2001-2004 00013 * 00014 * Additional copyrights: Tekes 2003-2004 00015 * 00016 * firstname.lastname@hut.fi 00017 * 00018 */ 00019 00020 #ifndef VEE_COLOR_TABLE_H 00021 #define VEE_COLOR_TABLE_H 00022 00023 #include <vee_color.h> 00024 #include <vector> 00025 00026 class VEE_RgbaTable 00027 { 00028 public: 00029 VEE_RgbaTable() {} 00030 ~VEE_RgbaTable() {} 00031 00032 VEE_Rgba getScaled(float rel); 00033 00034 void appendColor(const VEE_Rgba &v) { m_colorTable.push_back(v); } 00035 void appendColor2(float r, float g, float b, float a) 00036 { appendColor(VEE_Rgba(r, g, b, a)); } 00037 00038 uint nofColors() const { return m_colorTable.size(); } 00039 00040 const VEE_Rgba & getColor(uint i) const { return m_colorTable[i]; } 00041 void setColor(uint i, const VEE_Rgba &v) { m_colorTable[i] = v; } 00042 00043 void clear() { m_colorTable.clear(); } 00044 00045 protected: 00046 00047 std::vector<VEE_Rgba> m_colorTable; 00048 }; 00049 00050 00051 #endif