42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
#include <gif/gifbmp.hpp>
|
|
#include <common/array.hpp>
|
|
|
|
void GIFBitmap::paletteHandler(const UCHAR FAR *lpPaletteData,USHORT numColors)
|
|
{
|
|
if(numColors>PurePalette::MaxColors)return;
|
|
Array<RGBColor> paletteData;
|
|
|
|
paletteData.size(numColors);
|
|
for(int palIndex=0;palIndex<numColors;palIndex++)
|
|
{
|
|
paletteData[palIndex]=RGBColor(*lpPaletteData,*(lpPaletteData+1),*(lpPaletteData+2));
|
|
lpPaletteData+=3;
|
|
}
|
|
mGIFPalette.setPaletteColors(paletteData);
|
|
}
|
|
|
|
void GIFBitmap::attributeHandler(USHORT imageWide,USHORT imageDeep,USHORT pixelSize)
|
|
{
|
|
String strPathFileName(mPathFileName.betweenString(0,'.')+String(".bmp"));
|
|
(Bitmap&)*this=Bitmap(strPathFileName,imageWide,imageDeep);
|
|
((Bitmap&)*this).setPalette(mGIFPalette.getPalette(),FALSE);
|
|
}
|
|
|
|
void GIFBitmap::backgroundHandler(USHORT backgroundColor)
|
|
{
|
|
}
|
|
|
|
void GIFBitmap::imageHandler(void)
|
|
{
|
|
}
|
|
|
|
void GIFBitmap::showHandler(USHORT imageWide,USHORT imageDeep,const UCHAR FAR *lpRowData,USHORT yLocation)
|
|
{
|
|
((Bitmap&)*this).setRow(yLocation,(char*)lpRowData);
|
|
}
|
|
|
|
void GIFBitmap::errorHandler(const char FAR *message)
|
|
{
|
|
}
|
|
|