[fpc-pascal] Questions regarding FPImage's TFPMemoryImage.FData variable

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Jun 1 12:26:19 CEST 2016


On Thu, 26 May 2016 11:24:44 +0100
Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:

>[...]
> 3) The FData image buffer (assuming (1) is correct) uses Integer instead
>    of Byte as it's element size. So I'm assuming a singe Integer hold
>    all the colour information for a single pixel?

No, TFPMemoryImage uses one TFPColor per pixel (48bit).
TFPCompactImgGray8Bit uses 8bit.
TFPCompactImgGray16Bit uses 16bit.
TFPCompactImgRGB8Bit uses 24bit.
TFPCompactImgRGBA8Bit uses 32bit.
and so forth...


>    But then again, I have noticed that TFPColor uses Word size data
>    elements, thus the whole RGBA information per pixel will be 8 bytes
>    of data, and Integer is only 4 bytes large.

The integer is only the palette index.

 
> 4) What is the order in which the colour channel information is stored
>    in memory? RGB, BGR, RGBA, BGRA, ARGB, ABGR etc?

Each memory image uses a packed record. For example TFPMemoryImage uses
TFPColor, TFPCompactImgRGBA8Bit uses TFPCompactImgRGBA8BitValue.
It is typically RGBA.

 
> 5) Is the Alpha channel actually stored? I assume it is, because the
>    Integer type is large enough to hold that information.

See above.

 
Mattias


More information about the fpc-pascal mailing list