X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Flib%2Fvampimg%2FImagingPcx.pas;h=9379b8b84e312679a2d9818525dafef32d7cc021;hb=e2769e7d4307654602c2ce2c1f5b19d65e710556;hp=257ad76837440f15b948ea27f82e5fe686e83a12;hpb=8f815647c61a98e32b85066bf245b262694ac634;p=d2df-sdl.git diff --git a/src/lib/vampimg/ImagingPcx.pas b/src/lib/vampimg/ImagingPcx.pas index 257ad76..9379b8b 100644 --- a/src/lib/vampimg/ImagingPcx.pas +++ b/src/lib/vampimg/ImagingPcx.pas @@ -1,5 +1,4 @@ { - $Id: ImagingPcx.pas 100 2007-06-28 21:09:52Z galfar $ Vampyre Imaging Library by Marek Mauder http://imaginglib.sourceforge.net @@ -44,10 +43,10 @@ type 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; @@ -77,23 +76,17 @@ type { 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; @@ -263,7 +256,7 @@ begin 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 @@ -271,7 +264,7 @@ 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 @@ -306,7 +299,7 @@ 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;