00001 /* 00002 $Id: palette.h,v 1.1 2001/03/06 15:09:10 mbn Exp $ 00003 00004 ------------------------------------------------------------------------ 00005 ClanLib, the platform independent game SDK. 00006 00007 This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE 00008 version 2. See COPYING for details. 00009 00010 For a total list of contributers see CREDITS. 00011 00012 ------------------------------------------------------------------------ 00013 */ 00014 00016 00017 #ifndef header_palette 00018 #define header_palette 00019 00020 class CL_InputSourceProvider; 00021 class CL_InputSource; 00022 00023 class CL_Palette 00024 //: Palette class. 00025 // <p>CL_Palette represents a palette in the form of a 256 byte array.</p> 00026 // 00027 // <p>Palettes are in ClanLib only used by surface providers. A provider 00028 // specifies it's palette by returning a CL_Palette. But It can also choose 00029 // to return NULL. In that case it will use the system palette. You can 00030 // change the system palette from CL_Display or CL_DisplayCard.</p> 00034 { 00035 public: 00036 unsigned char *palette; // = new unsigned char[num_colors*3] 00037 //: The actual palette. 1 byte for each color component (rgb), 256 colors. 00038 00039 int num_colors; 00040 //: Number of colours in the palette. 00041 00042 public: 00043 CL_Palette(); 00044 //: Creates a palette. 00045 00046 virtual ~CL_Palette(); 00047 00048 CL_Palette(unsigned char *palette, int num_colors=256); 00049 //: Creates a palette using values from an unsigned char array. 00052 00053 CL_Palette(char *palette_id, CL_InputSourceProvider *provider); 00054 //: Creates a palette from a input source. 00057 00058 CL_Palette(CL_InputSource *input); 00059 //: Creates a palette from an already open input source. 00061 }; 00062 00063 #endif
1.2.6 written by Dimitri van Heesch,
© 1997-2001