1 namespace gfx::bitmaps;
5 static const char * extensions[] = { "rgb", null };
7 class RGBFormat : BitmapFormat
9 class_property(extensions) = extensions;
11 bool Load(Bitmap bitmap, File f)
16 bool Save(Bitmap bitmap, const char * filename, void * options)
21 ColorAlpha * LoadPalette(const char * fileName, const char * type)
23 ColorAlpha * result = null;
24 File f = FileOpen(fileName, read);
28 if(f.Read(palette, 768, 1))
30 if((result = new ColorAlpha[256]))
33 for(c = 0; c<256; c++)
34 result[c] = ColorAlpha { 255, { (byte)(palette[c*3]<<2), (byte)(palette[c*3+1]<<2), (byte)(palette[c*3+2]<<2) } };