00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __CS_RGB_VECTOR_H__
00022 #define __CS_RGB_VECTOR_H__
00023
00024 #include "array.h"
00025 #include "csgfx/rgbpixel.h"
00026
00027
00028
00034 class csRGBVector : public csArray<csRGBcolor*>
00035 {
00036 public:
00038 static int Compare (void const* item1, void const* item2)
00039 {
00040 csRGBcolor* i1 = (csRGBcolor*)item1;
00041 csRGBcolor* i2 = (csRGBcolor*)item2;
00042 if ((*i1)==(*i2))
00043 return 0;
00044 else if(i1->red < i2->red &&
00045 i1->green < i2->green &&
00046 i1->blue < i2->blue)
00047 return -1;
00048 else
00049 return 1;
00050 }
00051
00053 static int CompareKey (csRGBcolor* const& i1, void* key)
00054 {
00055 const csRGBcolor *i2 = STATIC_CAST(const csRGBcolor *, key);
00056
00057 if ((*i1)==(*i2))
00058 return 0;
00059 else if(i1->red < i2->red &&
00060 i1->green < i2->green &&
00061 i1->blue < i2->blue)
00062 return -1;
00063 else
00064 return 1;
00065 }
00066
00067 };
00068
00069 #endif // __CS_RGB_VECTOR_H__