mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-13 12:28:16 +02:00
added BitOrder test for RawImageMaskEmpty
git-svn-id: trunk@6898 -
This commit is contained in:
parent
3520db0335
commit
f623eb3e10
@ -238,7 +238,9 @@ var
|
|||||||
p: PByte;
|
p: PByte;
|
||||||
y: cardinal;
|
y: cardinal;
|
||||||
x: cardinal;
|
x: cardinal;
|
||||||
UnusedByteMask: Byte;
|
UnusedByteMask: Byte; // Alpha Bits should be all set. The Byte at line end
|
||||||
|
// can contain some unused bits. This mask OR byte at
|
||||||
|
// line end makes the unsused bits all true.
|
||||||
UsedBytesPerLine: cardinal;
|
UsedBytesPerLine: cardinal;
|
||||||
begin
|
begin
|
||||||
Result:=true;
|
Result:=true;
|
||||||
@ -269,6 +271,9 @@ begin
|
|||||||
// byte boundary
|
// byte boundary
|
||||||
UsedBytesPerLine:=UsedBitsPerLine shr 3;
|
UsedBytesPerLine:=UsedBitsPerLine shr 3;
|
||||||
UnusedBitsAtEnd:=(8-(UsedBitsPerLine and 7)) and 7;
|
UnusedBitsAtEnd:=(8-(UsedBitsPerLine and 7)) and 7;
|
||||||
|
if RawImage^.Description.AlphaBitOrder=riboBitsInOrder then
|
||||||
|
UnusedByteMask:=(($ff00 shr UnusedBitsAtEnd) and $ff)
|
||||||
|
else
|
||||||
UnusedByteMask:=(1 shl UnusedBitsAtEnd) - 1;
|
UnusedByteMask:=(1 shl UnusedBitsAtEnd) - 1;
|
||||||
p:=RawImage^.Mask;
|
p:=RawImage^.Mask;
|
||||||
for y:=0 to Height-1 do begin
|
for y:=0 to Height-1 do begin
|
||||||
@ -288,7 +293,14 @@ begin
|
|||||||
if (p^ or UnusedByteMask)<>$ff then begin
|
if (p^ or UnusedByteMask)<>$ff then begin
|
||||||
// not all bits set -> transparent pixels found -> Mask needed
|
// not all bits set -> transparent pixels found -> Mask needed
|
||||||
{$IFDEF VerboseRawImage}
|
{$IFDEF VerboseRawImage}
|
||||||
DebugLn('RawImageMaskIsEmpty EdgeByte y=',dbgs(y),' x=',dbgs(x),' Byte=',HexStr(Cardinal(p^),2),' UnusedByteMask=',HexStr(Cardinal(UnusedByteMask),2),' UnusedBitsAtEnd=',dbgs(UnusedBitsAtEnd),' UsedBitsPerLine=',dbgs(UsedBitsPerLine),' Width=',dbgs(Width),' RawImage^.Description.AlphaBitsPerPixel=',dbgs(RawImage^.Description.AlphaBitsPerPixel));
|
DebugLn('RawImageMaskIsEmpty EdgeByte y=',dbgs(y),' x=',dbgs(x),
|
||||||
|
' Byte=',HexStr(Cardinal(p^),2),
|
||||||
|
' UnusedByteMask=',HexStr(Cardinal(UnusedByteMask),2),
|
||||||
|
' OR='+dbgs(p^ or UnusedByteMask),
|
||||||
|
' UnusedBitsAtEnd='+dbgs(UnusedBitsAtEnd),
|
||||||
|
' UsedBitsPerLine='+dbgs(UsedBitsPerLine),
|
||||||
|
' Width='+dbgs(Width),
|
||||||
|
' RawImage^.Description.AlphaBitsPerPixel='+dbgs(RawImage^.Description.AlphaBitsPerPixel));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -776,6 +788,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.39 2005/03/05 13:09:27 mattias
|
||||||
|
added BitOrder test for RawImageMaskEmpty
|
||||||
|
|
||||||
Revision 1.38 2005/03/05 12:08:49 mattias
|
Revision 1.38 2005/03/05 12:08:49 mattias
|
||||||
OI now locks during doubleclick and synedit now uses only MouseCapture instead of heuristic
|
OI now locks during doubleclick and synedit now uses only MouseCapture instead of heuristic
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user