Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00028 #ifndef __CS_CSGFX_IMAGETOOLS_H__
00029 #define __CS_CSGFX_IMAGETOOLS_H__
00030
00031 #include "csextern.h"
00032 #include "csgfx/rgbpixel.h"
00033 #include "igraphic/image.h"
00034
00038 class CS_CRYSTALSPACE_EXPORT csImageTools
00039 {
00040 public:
00042 static inline size_t ComputeDataSize (iImage* img)
00043 {
00044 return img->GetWidth () * img->GetHeight () * img->GetDepth () *
00045 (((img->GetFormat () & CS_IMGFMT_MASK) == CS_IMGFMT_PALETTED8) ? 1 :
00046 sizeof (csRGBpixel));
00047 }
00051 static int ClosestPaletteIndex (const csRGBpixel* Palette,
00052 const csRGBpixel& iColor, int palEntries = 256);
00053 };
00054
00057 #endif // __CS_CSGFX_IMAGETOOLS_H__