index 943f476ed5a4a20afc15fb792bfcd5b243a1bfa0..4c4aac611491da0b5a543bd88b1e98e7c64c81cf 100644 (file)
{
- $Id: ImagingBitmap.pas 129 2008-08-06 20:01:30Z galfar $
Vampyre Imaging Library
by Marek Mauder
http://imaginglib.sourceforge.net
For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html
}
-{ This unit contains image format loader/saver for Windows Bitmap images.}
+{
+ This unit contains image format loader/saver for Windows Bitmap images.
+}
unit ImagingBitmap;
{$I ImagingOptions.inc}
TBitmapFileFormat = class(TImageFileFormat)
protected
FUseRLE: LongBool;
+ procedure Define; override;
function LoadData(Handle: TImagingHandle; var Images: TDynImageDataArray;
OnlyFirstLevel: Boolean): Boolean; override;
function SaveData(Handle: TImagingHandle; const Images: TDynImageDataArray;
procedure ConvertToSupported(var Image: TImageData;
const Info: TImageFormatInfo); override;
public
- constructor Create; override;
function TestFormat(Handle: TImagingHandle): Boolean; override;
published
{ Controls that RLE compression is used during saving. Accessible trough
{ TBitmapFileFormat class implementation }
-constructor TBitmapFileFormat.Create;
+procedure TBitmapFileFormat.Define;
begin
- inherited Create;
+ inherited;
FName := SBitmapFormatName;
- FCanLoad := True;
- FCanSave := True;
- FIsMultiImageFormat := False;
+ FFeatures := [ffLoad, ffSave];
FSupportedFormats := BitmapSupportedFormats;
FUseRLE := BitmapDefaultRLE;
// 1 and 4 bpp images are supported only for loading which is now
// so we now convert them to 8bpp (and unalign scanlines).
case BI.BitCount of
- 1: Convert1To8(Data, Bits, Width, Height, AlignedWidthBytes);
+ 1: Convert1To8(Data, Bits, Width, Height, AlignedWidthBytes, False);
4:
begin
// RLE4 bitmaps are translated to 8bit during RLE decoding
if BI.Compression <> BI_RLE4 then
- Convert4To8(Data, Bits, Width, Height, AlignedWidthBytes);
+ Convert4To8(Data, Bits, Width, Height, AlignedWidthBytes, False);
end;
end;
// Enlarge palette