From cec8f5b20ea703c1184742ec7ebcd62ab1f0c234 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 1 Dec 2006 21:37:03 +0000 Subject: [PATCH] lcl: TLazIntfImage added quick setup functions for pf24bit and pf32bit formats git-svn-id: trunk@10276 - --- lcl/intfgraphics.pas | 54 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/lcl/intfgraphics.pas b/lcl/intfgraphics.pas index 081959ebc2..0bfdd9fad8 100644 --- a/lcl/intfgraphics.pas +++ b/lcl/intfgraphics.pas @@ -181,6 +181,7 @@ type ExceptionOnError: boolean): boolean; virtual; procedure GetDescriptionFromDevice(DC: HDC); virtual; procedure GetDescriptionFromBitmap(Bitmap: HBitmap); virtual; + procedure Set_BPP24_B8G8R8_A1_BIO_TTB(NewWidth, NewHeight: integer); procedure Set_BPP32_B8G8R8_A1_BIO_TTB(NewWidth, NewHeight: integer); procedure LoadFromDevice(DC: HDC); virtual; procedure LoadFromBitmap(Bitmap, MaskBitmap: HBitmap; AWidth: integer = -1; AHeight: integer = -1); virtual; @@ -1785,14 +1786,55 @@ begin DataDescription:=NewDataDescription; end; +procedure TLazIntfImage.Set_BPP24_B8G8R8_A1_BIO_TTB(NewWidth, NewHeight: integer + ); +{ pf24bit: + + Format=ricfRGBA HasPalette=false Depth=24 PaletteColorCount=0 + BitOrder=riboBitsInOrder ByteOrder=DefaultByteOrder + LineOrder=riloTopToBottom + BitsPerPixel=24 LineEnd=rileDWordBoundary + RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 + AlphaSeparate=false } +var + ADesc: TRawImageDescription; +begin + // setup an artificial ScanLineImage with format RGB 24 bit, 24bit depth format + FillChar(ADesc,SizeOf(ADesc),0); + with ADesc do begin + Format:=ricfRGBA; + Depth:=24; // used bits per pixel + Width:=0; + Height:=0; + BitOrder:=riboBitsInOrder; + ByteOrder:=DefaultByteOrder; + LineOrder:=riloTopToBottom; + BitsPerPixel:=24; // bits per pixel. can be greater than Depth. + LineEnd:=rileDWordBoundary; + RedPrec:=8; // red precision. bits for red + RedShift:=16; + GreenPrec:=8; + GreenShift:=8; // bitshift. Direction: from least to most signifikant + BluePrec:=8; + BlueShift:=0; + AlphaPrec:=0; + AlphaSeparate:=false; + end; + + DataDescription:=ADesc; + SetSize(NewWidth,NewHeight); +end; + procedure TLazIntfImage.Set_BPP32_B8G8R8_A1_BIO_TTB(NewWidth, NewHeight: integer ); -// Format=ricfRGBA HasPalette=false Depth=24 PaletteColorCount=0 -// BitOrder=riboBitsInOrder ByteOrder=DefaultByteOrder -// LineOrder=riloTopToBottom -// BitsPerPixel=32 LineEnd=rileDWordBoundary -// RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 -// AlphaSeparate=false +{ pf32bit: + + Format=ricfRGBA HasPalette=false Depth=24 PaletteColorCount=0 + BitOrder=riboBitsInOrder ByteOrder=DefaultByteOrder + LineOrder=riloTopToBottom + BitsPerPixel=32 LineEnd=rileDWordBoundary + RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 + AlphaSeparate=false } var ADesc: TRawImageDescription; begin