Inheritance diagram for Conv32to4:
Public Member Functions | |
Conv32to4 (UINT32, LPLOGPALETTE, UINT32) | |
Constructor to Convert 32bpp to 4bpp. | |
~Conv32to4 () | |
BOOL | Convert (LPBYTE Input, LPBYTE Output, UINT32 Height, BOOL FirstStrip) |
Private Attributes | |
BITMAPINFOHEADER | SourceHeader |
BITMAPINFOHEADER | DestHeader |
LPLOGPALETTE | DestPalette |
UINT32 | Dither |
Definition at line 167 of file dibconv.cpp.
|
Constructor to Convert 32bpp to 4bpp.
Definition at line 641 of file dibconv.cpp. 00642 { 00643 ERROR3IF(Palette==NULL,"Conv32to4 null palette specified"); 00644 00645 SourceHeader.biPlanes = 1; 00646 SourceHeader.biBitCount = 32; 00647 SourceHeader.biWidth = Width; 00648 SourceHeader.biClrUsed = 0; 00649 00650 DestHeader.biPlanes = 1; 00651 DestHeader.biBitCount = 4; 00652 DestHeader.biWidth = Width; 00653 DestHeader.biClrUsed = 16; 00654 00655 DestPalette = Palette; 00656 00657 // Remember which dithering to use 00658 Dither = DitherType; 00659 00660 // lets use this palette for the conversion 00661 GDrawContext *GDC = GetConvertContext(); 00662 GDC->SetConversionPalette(DestPalette); 00663 }
|
|
Definition at line 665 of file dibconv.cpp.
|
|
Implements DIBConvert. Definition at line 669 of file dibconv.cpp. 00670 { 00671 SourceHeader.biHeight = Height; 00672 00673 DestHeader.biHeight = Height; 00674 00675 DWORD DitherWord = Dither; 00676 TRACEUSER( "Andy?", _T("Convert32to4, Strip = %d, dither = %d\n"), FirstStrip, Dither); 00677 00678 if (Dither == XARADITHER_SIMPLE || Dither == XARADITHER_ERROR_DIFFUSION) 00679 { 00680 // We are using some form of error diffusion .... 00681 00682 // Set second byte to 255 if this is the First strip, 00683 // so that the error buffer is cleared 00684 DitherWord |= (( FirstStrip ? 0 : 255 ) << 8); 00685 } 00686 00687 GDrawContext *GDC = GetConvertContext(); 00688 const BOOL res = GDC->ConvertBitmap( &SourceHeader, Input, &DestHeader, Output, DitherWord ); 00689 00690 if (!res) 00691 TRACE( _T("GColour_ConvertBitmap did error %x\n"), GetLastError() ); 00692 00693 return TRUE; 00694 }
|
|
Definition at line 177 of file dibconv.cpp. |
|
Definition at line 178 of file dibconv.cpp. |
|
Definition at line 179 of file dibconv.cpp. |
|
Definition at line 176 of file dibconv.cpp. |