mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-17 14:10:32 +01:00
* Fixed channel position calcualtions in chooseRGB functions
git-svn-id: trunk@15519 -
This commit is contained in:
parent
3e452353c0
commit
29ceac9d9b
@ -1411,7 +1411,7 @@ var
|
||||
or ((Desc.BlueShift shr 3) and 3);
|
||||
|
||||
if Desc.ByteOrder = riboMSBFirst
|
||||
then Positions := not Positions and $00FFFFFF; // reverse positions
|
||||
then Positions := not Positions and %00111111; // reverse positions
|
||||
|
||||
// the locations of R,G,B are now coded in 2 bits each: xxRRBBGG
|
||||
// the 2-bit value (0..3) represents the location of the channel,
|
||||
@ -1498,12 +1498,16 @@ var
|
||||
if Desc.GreenShift and 7 <> 0 then Exit;
|
||||
if Desc.BlueShift and 7 <> 0 then Exit;
|
||||
|
||||
Positions := ((Desc.RedShift shr 3) and 3) shl 4
|
||||
or ((Desc.GreenShift shr 3) and 3) shl 2
|
||||
or ((Desc.BlueShift shr 3) and 3);
|
||||
|
||||
if Desc.ByteOrder = riboMSBFirst
|
||||
then Positions := not Positions and $00FFFFFF; // reverse positions
|
||||
then
|
||||
Positions := (2-((Desc.RedShift shr 3) and 3)) shl 4
|
||||
or (2-((Desc.GreenShift shr 3) and 3)) shl 2
|
||||
or (2-((Desc.BlueShift shr 3) and 3))
|
||||
else
|
||||
Positions := ((Desc.RedShift shr 3) and 3) shl 4
|
||||
or ((Desc.GreenShift shr 3) and 3) shl 2
|
||||
or ((Desc.BlueShift shr 3) and 3);
|
||||
|
||||
|
||||
// the locations of R,G,B are now coded in 2 bits each: xxRRBBGG
|
||||
// the 2-bit value (0..3) represents the location of the channel,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user