ist nur ein Algo für Brightness notwendig ?
c= 0...255
p
Delphi-Quellcode:
procedure Brightness(Bit: TBitmap; c: integer);
type
PixArray = Array [1 .. 3] of Byte;
var
p: ^PixArray;
h, w: integer;
Cvalue: integer;
begin
For h := 0 to Bit.height - 1 do
begin
p := Bit.Scanline[h];
For w := 0 to Bit.width - 1 do
begin
{ R-Channel }
Cvalue := p^[1] + c;
If (Cvalue < 0) then
p^[1] := 0
else If (Cvalue > 255) then
p^[1] := 255
else
p^[1] := Cvalue;
{ G-Channel }
Cvalue := p^[2] + c;
If (Cvalue < 0) then
p^[2] := 0
else If (Cvalue > 255) then
p^[2] := 255
else
p^[2] := Cvalue;
{ B-Channel }
Cvalue := p^[3] + c;
If (Cvalue < 0) then
p^[3] := 0
else If (Cvalue > 255) then
p^[3] := 255
else
p^[3] := Cvalue;
inc(p);
end;
end;
end;