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 "csvector.h"
00025
00030 class csRGBVector : public csVector
00031 {
00032
00033 public:
00035 virtual int Compare(void* item1, void* item2, int )
00036 {
00037 csRGBcolor *i1 = STATIC_CAST(csRGBcolor *, item1);
00038 csRGBcolor *i2 = STATIC_CAST(csRGBcolor *, item2);
00039
00040 if ((*i1)==(*i2))
00041 return 0;
00042 else if(i1->red < i2->red &&
00043 i1->green < i2->green &&
00044 i1->blue < i2->blue)
00045 {
00046 return -1;
00047 }
00048 else
00049 return 1;
00050 }
00051
00053 virtual int CompareKey(void* item, const void* key, int )
00054 {
00055 csRGBcolor *i1 = STATIC_CAST(csRGBcolor *, item);
00056 const csRGBcolor *i2 = STATIC_CAST(const csRGBcolor *, key);
00057
00058 if ((*i1)==(*i2))
00059 return 0;
00060 else if(i1->red < i2->red &&
00061 i1->green < i2->green &&
00062 i1->blue < i2->blue)
00063 {
00064 return -1;
00065 }
00066 else
00067 return 1;
00068 }
00069
00070 };
00071
00072 #endif // __CS_RGB_VECTOR_H__