Registriert seit: 23. Okt 2003
159 Beiträge
Delphi 2010 Architect
|
Re: Durchschnittsfarbe eines TBitmap via Scanline?
22. Jan 2008, 07:52
passt das?:
Delphi-Quellcode:
//alles auf 0 setzen - initialisieren
for i:=1 to TestPointsX do
for j:=1 to TestPointsY do
for k:=1 to 3 do
average[i, j, k]:=0;
for i:=1 to TestPointsX do
for j:=1 to TestPointsY do
for k:=1 to (280 div TestPointsX) do
begin
for l:=1 to (210 div TestPointsY) do
begin
average[i, j, 1]:=average[i, j, 1] + p[l*j-1].rgbBlue;
average[i, j, 2]:=average[i, j, 2] + p[l*j-1].rgbGreen;
average[i, j, 3]:=average[i, j, 3] + p[l*j-1].rgbRed;
end;
Inc(p[l*j-1], 1);
end;
|
|
Zitat
|