AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi About B&W film filter
Thema durchsuchen
Ansicht
Themen-Optionen

About B&W film filter

Ein Thema von WojTec · begonnen am 23. Apr 2011 · letzter Beitrag vom 5. Mai 2011
 
freeway

Registriert seit: 11. Jul 2009
57 Beiträge
 
Delphi XE Professional
 
#6

AW: About B&W film filter

  Alt 5. Mai 2011, 16:45
if the sum from the addition (d1+d2+d3) bigger than 100 then the result is a brighter picture
for brighter colors (yellow) the result is a brighter image
you can limit the RGB values out from yellow (<100) but then you move all RGB to lower due
you can get the same result (brightness) with a darker color, the limit is 100

here with color and expanded up to 255
Delphi-Quellcode:
type TRGBArray = array[0..10000] of TRGBTriple;
     PRGBArray = ^TRGBArray;

var your_color : Tcolor; //your selected color
    R,G,B : integer;
    x,y : integer;
    d1,d2,d3 : double;
    grey : integer; //grey values
    Row : PRGBArray;

begin
  R := GetRValue(your_color); //get RGB colors
  G := GetGValue(your_color);
  B := GetBValue(your_color);
  d1 := R / 255; //convert to due
  d2 := G / 255;
  d3 := B / 255;

  for y := 0 to bmp1.Height - 1 do
    begin
      row := BMP1.scanline[y];
      for x := 0 to BMP1.Width - 1 do
        with row[x] do
          begin
            grey := round((d1 * rgbtRed) + (d2 * rgbtGreen) + (d3 * rgbtBlue)); //calculate grey due (from RGB values)
            if grey > 255 then grey := 255; //check range
            rgbtRed := grey; //set values
            rgbtGreen := grey;
            rgbtBlue := grey;
          end;
    end;
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:32 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz