summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/gfx/eventtest/eventtest.lpi1
-rw-r--r--gfx/emulayer/gelimage.pas22
-rw-r--r--gfx/gdi/gfx_gdi.pas11
-rw-r--r--gfx/gfxbase.pas46
-rw-r--r--gfx/x11/gfx_x11.pas24
5 files changed, 16 insertions, 88 deletions
diff --git a/examples/gfx/eventtest/eventtest.lpi b/examples/gfx/eventtest/eventtest.lpi
index ee24b099..09f3228a 100644
--- a/examples/gfx/eventtest/eventtest.lpi
+++ b/examples/gfx/eventtest/eventtest.lpi
@@ -14,7 +14,6 @@
</General>
<PublishOptions>
<Version Value="2"/>
- <DestinationDirectory Value="$(TestDir)\publishedproject\"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
diff --git a/gfx/emulayer/gelimage.pas b/gfx/emulayer/gelimage.pas
index 0701e2fc..a73e77a3 100644
--- a/gfx/emulayer/gelimage.pas
+++ b/gfx/emulayer/gelimage.pas
@@ -285,13 +285,6 @@ begin
ParamsS2I.Palette[0] := 0;
end;
end;
- ftPal4, ftPal4A:
- begin
- ConvertToInternal := @ConvertPal4ToInternal;
- max := ConvertPalette(15, ParamsS2I);
- for i := max + 1 to 15 do
- ParamsS2I.Palette[i] := 0;
- end;
ftPal8, ftPal8A:
begin
ConvertToInternal := @ConvertPal8ToInternal;
@@ -299,16 +292,6 @@ begin
for i := max + 1 to 255 do
ParamsS2I.Palette[i] := i or (i shl 8) or (i shl 16);
end;
- ftRGB24:
- begin
- ConvertToInternal := @ConvertRGB24ToInternal;
- ParamsS2I.RedShiftR := 8 -
- GetBitShiftAndCount(ASourceFormat.RedMask, ParamsS2I.RedShiftL);
- ParamsS2I.GreenShiftR := 16 -
- GetBitShiftAndCount(ASourceFormat.GreenMask, ParamsS2I.GreenShiftL);
- ParamsS2I.BlueShiftR := 24 -
- GetBitShiftAndCount(ASourceFormat.BlueMask, ParamsS2I.BlueShiftL);
- end;
ftRGB32:
begin
ConvertToInternal := @ConvertRGB32ToInternal;
@@ -329,11 +312,6 @@ begin
ConvertFromInternal := @ConvertInternalToRGB16;
SetupShifts(ADestFormat, ParamsI2D);
end;
- ftRGB24:
- begin
- ConvertFromInternal := @ConvertInternalToRGB24;
- SetupShifts(ADestFormat, ParamsI2D);
- end;
ftRGB32:
begin
ConvertFromInternal := @ConvertInternalToRGB32;
diff --git a/gfx/gdi/gfx_gdi.pas b/gfx/gdi/gfx_gdi.pas
index 8c76a643..82ce1214 100644
--- a/gfx/gdi/gfx_gdi.pas
+++ b/gfx/gdi/gfx_gdi.pas
@@ -139,16 +139,11 @@ type
TGDIBitmap = class(TFCustomBitmap)
private
IsLocked: Boolean;
- protected
- FStride: LongWord;
- FData: Pointer;
public
constructor Create(AWidth, AHeight: Integer; APixelFormat: TGfxPixelFormat); override;
destructor Destroy; override;
procedure Lock(var AData: Pointer; var AStride: LongWord); override;
procedure Unlock; override;
- property Stride: LongWord read FStride;
- property Data: Pointer read FData;
end;
{ TGDIScreen }
@@ -913,12 +908,6 @@ begin
Color^.rgbBlue := 255;
Color^.rgbReserved := 0;
end;
- ftPal4, ftPal4A:
- begin
- FStride := (AWidth + 1) shr 1;
- GetMem(BitmapInfo, SizeOf(TBitmapInfoHeader) + 16 * SizeOf(RGBQUAD));
- BitmapInfo^.bmiHeader.biClrUsed := 0;
- end;
ftPal8, ftPal8A:
begin
FStride := AWidth;
diff --git a/gfx/gfxbase.pas b/gfx/gfxbase.pas
index 1bac990e..86b1de45 100644
--- a/gfx/gfxbase.pas
+++ b/gfx/gfxbase.pas
@@ -80,20 +80,17 @@ type
TGfxFormatType = (
ftInvalid,
ftMono, // Monochrome
- ftPal4, // 4 bpp using palette
- ftPal4A, // 4 bpp using palette with alpha values > 0
ftPal8, // 8 bpp using palette
ftPal8A, // 8 bpp using palette with alpha values > 0
ftRGB16, // 15/16 bpp RGB
ftRGBA16, // 16 bpp RGBA
- ftRGB24, // 24 bpp RGB
ftRGB32, // 32 bpp RGB
ftRGBA32); // 32 bpp RGBA
TGfxPixelFormat = record
case FormatType: TGfxFormatType of
- ftRGB16, ftRGBA16, ftRGB24, ftRGB32, ftRGBA32: (
+ ftRGB16, ftRGBA16, ftRGB32, ftRGBA32: (
RedMask: TGfxPixel;
GreenMask: TGfxPixel;
BlueMask: TGfxPixel;
@@ -104,7 +101,7 @@ type
const
FormatTypeBPPTable: array[TGfxFormatType] of Integer =
- (0, 1, 4, 4, 8, 8, 16, 16, 24, 32, 32);
+ (0, 1, 8, 8, 16, 16, 32, 32);
{ Predefined colors }
@@ -153,20 +150,6 @@ const
BlueMask: 0;
AlphaMask: 0);
- PixelFormatPal4: TGfxPixelFormat = (
- FormatType: ftPal4;
- RedMask: 0;
- GreenMask: 0;
- BlueMask: 0;
- AlphaMask: 0);
-
- PixelFormatPal4A: TGfxPixelFormat = (
- FormatType: ftPal4A;
- RedMask: 0;
- GreenMask: 0;
- BlueMask: 0;
- AlphaMask: 0);
-
PixelFormatPal8: TGfxPixelFormat = (
FormatType: ftPal8;
RedMask: 0;
@@ -181,20 +164,6 @@ const
BlueMask: 0;
AlphaMask: 0);
- PixelFormatRGB24: TGfxPixelFormat = (
- FormatType: ftRGB24;
- RedMask: $0000ff;
- GreenMask: $00ff00;
- BlueMask: $ff0000;
- AlphaMask: 0);
-
- PixelFormatBGR24: TGfxPixelFormat = (
- FormatType: ftRGB24;
- RedMask: $ff0000;
- GreenMask: $00ff00;
- BlueMask: $0000ff;
- AlphaMask: 0);
-
PixelFormatRGB32: TGfxPixelFormat = (
FormatType: ftRGB32;
RedMask: $0000ff;
@@ -382,17 +351,21 @@ type
procedure SetPalette(APalette: TGfxPalette);
protected
FHandle: Cardinal;
+ FStride: LongWord;
+ FData: Pointer;
public
constructor Create(AWidth, AHeight: Integer; APixelFormat: TGfxPixelFormat); virtual;
destructor Destroy; override;
procedure Lock(var AData: Pointer; var AStride: LongWord); virtual; abstract;
- procedure Unlock; virtual;
+ procedure Unlock; virtual; abstract;
procedure SetPixelsFromData(AData: Pointer; AStride: LongWord);
property Width: Integer read FWidth;
property Height: Integer read FHeight;
property PixelFormat: TGfxPixelFormat read FPixelFormat;
property Palette: TGfxPalette read FPalette write SetPalette;
property Handle: Cardinal read FHandle;
+ property Data: Pointer read FData;
+ property Stride: LongWord read FStride;
end;
{ TFCustomScreen }
@@ -853,11 +826,6 @@ begin
inherited Destroy;
end;
-procedure TFCustomBitmap.Unlock;
-begin
- // Default implementation: Do nothing...
-end;
-
procedure TFCustomBitmap.SetPixelsFromData(AData: Pointer; AStride: LongWord);
var
DestData: Pointer;
diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas
index ac74f781..fd8705ea 100644
--- a/gfx/x11/gfx_x11.pas
+++ b/gfx/x11/gfx_x11.pas
@@ -111,7 +111,7 @@ type
procedure DoTextOut(const APosition: TPoint; const AText: String); override;
procedure DoCopyRect(ASource: TFCustomCanvas; const ASourceRect: TRect; const ADestPos: TPoint); override;
procedure DoMaskedCopyRect(ASource, AMask: TFCustomCanvas; const ASourceRect: TRect; const AMaskPos, ADestPos: TPoint); override;
- procedure DoDrawImageRect(AImage: TFCustomImage; ASourceRect: TRect; const ADestPos: TPoint); override;
+ procedure DoDrawImageRect(AImage: TFCustomBitmap; ASourceRect: TRect; const ADestPos: TPoint); override;
public
constructor Create(AColormap: TColormap; AXDrawable: X.TDrawable; ADefaultFont: PXFontStruct);
destructor Destroy; override;
@@ -152,20 +152,16 @@ type
constructor Create(AColormap: TColormap; AHandle: TPixmap);
end;
+ { TX11Bitmap }
- TX11Image = class(TFCustomImage)
+ TX11Bitmap = class(TFCustomBitmap)
private
IsLocked: Boolean;
- protected
- FStride: LongWord;
- FData: Pointer;
public
constructor Create(AWidth, AHeight: Integer; APixelFormat: TGfxPixelFormat); override;
destructor Destroy; override;
procedure Lock(var AData: Pointer; var AStride: LongWord); override;
procedure Unlock; override;
- property Stride: LongWord read FStride;
- property Data: Pointer read FData;
end;
{ TX11Screen }
@@ -777,7 +773,7 @@ begin
XSetRegion(gApplication.Handle, GC, Region);
end;
-procedure TX11Canvas.DoDrawImageRect(AImage: TFCustomImage; ASourceRect: TRect;
+procedure TX11Canvas.DoDrawImageRect(AImage: TFCustomBitmap; ASourceRect: TRect;
const ADestPos: TPoint);
var
Image: XLib.PXImage;
@@ -898,30 +894,28 @@ begin
inherited Create(AColormap, AHandle, PixelFormatMono);
end;
-{ TX11Image }
+{ TX11Bitmap }
-constructor TX11Image.Create(AWidth, AHeight: Integer; APixelFormat: TGfxPixelFormat);
+constructor TX11Bitmap.Create(AWidth, AHeight: Integer; APixelFormat: TGfxPixelFormat);
begin
inherited Create(AWidth, AHeight, APixelFormat);
case APixelFormat.FormatType of
ftMono:
FStride := (AWidth + 7) shr 3;
- ftPal4, ftPal4A:
- FStride := (AWidth + 1) and not 1;
else
FStride := AWidth * (FormatTypeBPPTable[APixelFormat.FormatType] shr 3);
end;
GetMem(FData, FStride * Height);
end;
-destructor TX11Image.Destroy;
+destructor TX11Bitmap.Destroy;
begin
FreeMem(FData);
inherited Destroy;
end;
-procedure TX11Image.Lock(var AData: Pointer; var AStride: LongWord);
+procedure TX11Bitmap.Lock(var AData: Pointer; var AStride: LongWord);
begin
ASSERT(not IsLocked);
IsLocked := True;
@@ -930,7 +924,7 @@ begin
AStride := Stride;
end;
-procedure TX11Image.Unlock;
+procedure TX11Bitmap.Unlock;
begin
ASSERT(IsLocked);
IsLocked := False;