Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#15

Re: [GR32] How to add intensity?

  Alt 23. Jan 2010, 18:28
This is procedure:

Delphi-Quellcode:
var
  Bits: PColor32Entry;
  Color: TColor32Entry;
  I, J: Integer;
  Percent: Single;
begin
  Color.ARGB := Color32(AColor);
  Percent := APercent / 100;
  Bits := @ASource.Bits[0];

  for I := 0 to ASource.Height - 1 do
  begin
    for J := 0 to ASource.Width - 1 do
    begin
      Bits.R := Lerp(Bits.R, (Color.R * Bits.R) div 255, Percent);
      Bits.G := Lerp(Bits.G, (Color.G * Bits.G) div 255, Percent);
      Bits.B := Lerp(Bits.B, (Color.B * Bits.B) div 255, Percent);

      Inc(Bits);
    end;
  end;

  ASource.Changed;
end;
After your latest suggestion percenta parameter work fine

But my formula don't makes filter I want... My EN is too poor to explain better what I want But I'll try: you have glass with specific color, when you look by this glass you see image in this glass color tone. When you use more thin glass (percent parameter has less value) in same color, you see more origanl image colors, but image you see stay in this glass color tone. Are you understand? I want to obtain filter like this glass. In graphics software you can see this filter, for example in PSP (Effects->Photo effects->Film and filters).

"Row" I used with TBitpam.ScanLine() and forgot change name
Miniaturansicht angehängter Grafiken
3_472.png  
  Mit Zitat antworten Zitat