procedure ChannelToGray(NumPixels: LongInt; Src, Dst: PByte; SrcInfo,
DstInfo: PImageFormatInfo);
var
I: LongInt;
Pix64: TColor64Rec;
Alpha: Word;
begin
// two most common conversions (R8G8B8->Gray8 nad A8R8G8B8->Gray8)
// are made separately from general conversions to make them faster
if (SrcInfo.BytesPerPixel in [3, 4]) and (DstInfo.Format = ifGray8) then
for I := 0 to NumPixels - 1 do
begin
Dst^ := Round(GrayConv.R * PColor24Rec(Src).R + GrayConv.G * PColor24Rec(Src).G +
GrayConv.B * PColor24Rec(Src).B);
Inc(Src, SrcInfo.BytesPerPixel);
Inc(Dst, DstInfo.BytesPerPixel);
end
else
[...]
Page created in 0.038 seconds with 19 queries.