type
pByteQuad = ^ByteQuad;
ByteQuad = array[0..3] of byte;
procedure SuperBlack(src, dest : TBitmap);
var X : integer;
pPix : pByteQuad;
COEF : array[0..255] of byte;
const
CDS = 128/103;
begin
if Src.PixelFormat <> pf32bit then
begin
Src.PixelFormat := pf32Bit;
Dest.PixelFormat := pf32Bit;
end;
Dest.Assign(Src);
{ PreCalculs }
for X := 0 to 255 do
case X of
0..24 : COEF[X] := 0;
25..127 : COEF[X] := byte(round((X-25)*CDS));
128..255: COEF[X] := X;
end;
pPix := Dest.ScanLine[Dest.Height-1];
for X := 0 to (Dest.Width*Dest.Height)-1 do
begin
pPix^[0] := COEF[pPix^[0]];
pPix^[1] := COEF[pPix^[1]];
pPix^[2] := COEF[pPix^[2]];
inc(pPix);
end;
end;