Thema: Delphi Vignette effect

Einzelnen Beitrag anzeigen

Benutzerbild von sx2008
sx2008

Registriert seit: 16. Feb 2008
Ort: Baden-Württemberg
2.332 Beiträge
 
Delphi 2007 Professional
 
#8

AW: Re: Vignette effect

  Alt 18. Sep 2010, 14:43
And no effect - image not changed. Why?
You must multiply with the brightness factor.
And you have to care about arithmetic overflow.

Delphi-Quellcode:
function ClampByte(value:Integer):Byte;
begin
  if value > 255 then
    result := 255
  (* not neccesary when a pixel is multiplied with a positive value
  else if value < 0
    result := 0
  *)

  else
    result := Byte(value);
end;
...
Bits.R := ClampByte(Round(Bits.R * Brightness));
  Mit Zitat antworten Zitat