From 77ed95805c8ed10ff6f310dd4c9e038339d09cc8 Mon Sep 17 00:00:00 2001 From: Felipe Menteiro de Carvalho Date: Sun, 26 Nov 2006 14:47:46 +0000 Subject: Fixes image example bug on X11, by fixating the byte order for RGB formats as the same Windows expects. --- gfx/gfxbase.pas | 47 +++++++---------------------------------------- 1 file changed, 7 insertions(+), 40 deletions(-) diff --git a/gfx/gfxbase.pas b/gfx/gfxbase.pas index fcc33d81..dab04c59 100644 --- a/gfx/gfxbase.pas +++ b/gfx/gfxbase.pas @@ -180,22 +180,17 @@ const BlueMask: 0; AlphaMask: 0); + { Windows requires this particular order for RGB images } + { 5-6-5 storage } PixelFormatRGB16: TGfxPixelFormat = ( FormatType: ftRGB16; - RedMask: $001F; + RedMask: $F800; GreenMask: $07E0; - BlueMask: $F800; + BlueMask: $001F; AlphaMask: 0); PixelFormatRGB24: TGfxPixelFormat = ( - FormatType: ftRGB24; - RedMask: $0000ff; - GreenMask: $00ff00; - BlueMask: $ff0000; - AlphaMask: 0); - - PixelFormatBGR24: TGfxPixelFormat = ( FormatType: ftRGB24; RedMask: $ff0000; GreenMask: $00ff00; @@ -203,47 +198,19 @@ const AlphaMask: 0); PixelFormatRGB32: TGfxPixelFormat = ( - FormatType: ftRGB32; - RedMask: $0000ff; - GreenMask: $00ff00; - BlueMask: $ff0000; - AlphaMask: 0); - - PixelFormatRGBA32: TGfxPixelFormat = ( - FormatType: ftRGB32; - RedMask: $000000ff; - GreenMask: $0000ff00; - BlueMask: $00ff0000; - AlphaMask: $ff000000); - - PixelFormatARGB32: TGfxPixelFormat = ( - FormatType: ftRGB32; - RedMask: $0000ff00; - GreenMask: $00ff0000; - BlueMask: $ff000000; - AlphaMask: $000000ff); - - PixelFormatBGR32: TGfxPixelFormat = ( FormatType: ftRGB32; RedMask: $ff0000; GreenMask: $00ff00; BlueMask: $0000ff; AlphaMask: 0); - PixelFormatBGRA32: TGfxPixelFormat = ( - FormatType: ftRGB32; - RedMask: $00ff0000; + PixelFormatRGBA32: TGfxPixelFormat = ( + FormatType: ftRGB32; + RedMask: $00ff00ff; GreenMask: $0000ff00; BlueMask: $000000ff; AlphaMask: $ff000000); - PixelFormatABGR32: TGfxPixelFormat = ( - FormatType: ftRGB32; - RedMask: $ff000000; - GreenMask: $00ff0000; - BlueMask: $0000ff00; - AlphaMask: $000000ff); - type EGfxError = class(Exception); -- cgit v1.2.3-70-g09d2