index 257ad76837440f15b948ea27f82e5fe686e83a12..9379b8b84e312679a2d9818525dafef32d7cc021 100644 (file)
{
- $Id: ImagingPcx.pas 100 2007-06-28 21:09:52Z galfar $
Vampyre Imaging Library
by Marek Mauder
http://imaginglib.sourceforge.net
to spread).}
TPCXFileFormat = class(TImageFileFormat)
protected
+ procedure Define; override;
function LoadData(Handle: TImagingHandle; var Images: TDynImageDataArray;
OnlyFirstLevel: Boolean): Boolean; override;
public
- constructor Create; override;
function TestFormat(Handle: TImagingHandle): Boolean; override;
end;
{ TPCXFileFormat }
-constructor TPCXFileFormat.Create;
+procedure TPCXFileFormat.Define;
begin
- inherited Create;
+ inherited;
FName := SPCXFormatName;
- FCanLoad := True;
- FCanSave := False;
- FIsMultiImageFormat := False;
+ FFeatures := [ffLoad];
AddMasks(SPCXMasks);
end;
function TPCXFileFormat.LoadData(Handle: TImagingHandle;
var Images: TDynImageDataArray; OnlyFirstLevel: Boolean): Boolean;
-const
- ifMono: TImageFormat = TImageFormat(250);
- ifIndex2: TImageFormat = TImageFormat(251);
- ifIndex4: TImageFormat = TImageFormat(252);
var
Hdr: TPCXHeader;
PalID, B: Byte;
else if FileDataFormat = ifMono then
begin
// Convert 1bit images to ifIndex8
- Convert1To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine);
+ Convert1To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine, False);
end
else if FileDataFormat = ifIndex2 then
begin
// usually use (from specs, I've never seen one myself) CGA palette
// which is not array of RGB tripplets. So 2bit PCXs are loaded but
// their colors would be wrong
- Convert2To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine);
+ Convert2To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine, False);
end
else if FileDataFormat = ifIndex4 then
begin
else if (Hdr.BitsPerPixel = 4) and (Hdr.Planes = 1) then
begin
// Convert 4bit images to ifIndex8
- Convert4To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine);
+ Convert4To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine, False);
end
end;