
02.04.2012, 01:20
|
 |
.
|
|
Регистрация: 18.05.2011
Адрес: Омск
Сообщения: 3,970
Версия Delphi: 3,5,7,10,12,XE2
Репутация: выкл
|
|
Вот кусок из исходников:
Код:
if (FPictureOriginal.Graphic <> nil) and (FPicture.Graphic <> nil) then
if (FPictureOriginal.Graphic is TBitmap) and (FPicture.Graphic is TBitmap) then
begin
...
// for each row of pixels
for I := 0 to BmpOriginal.Height - 1 do
begin
OrigRow := BmpOriginal.ScanLine[i];
DestRow := FPicture.Bitmap.ScanLine[i];
if FNoise <> nil then
NoiseRow := FNoise.ScanLine[i]
else
NoiseRow := OrigRow;
// for each pixel in row
for j := 0 to BmpOriginal.Width - 1 do
begin
RO:=OrigRow[j].rgbtRed;
GO:=OrigRow[j].rgbtGreen;
BO:=OrigRow[j].rgbtBlue;
//Calculate Posterize or Solorize
if FPosterize<>0 then
begin
RO:=round(RO/FPosterize)*FPosterize;
GO:=round(GO/FPosterize)*FPosterize;
BO:=round(BO/FPosterize)*FPosterize;
end
...
__________________
Je venus de nulle part
55.026263 с.ш., 73.397636 в.д.
|