LAYERINFO

typedef struct _LAYERINFO
{
   L_UINT uStructSize;
   L_INT32 nLayerLeft;
   L_INT32 nLayerTop;
   L_UCHAR uOpacity;
   L_UCHAR uClipping;
   L_UCHAR szBlendModeKey[4];
   pBITMAPHANDLE pMaskBitmap;
   L_TCHAR szName[256];
} LAYERINFO, L_FAR * pLAYERINFO;

The LAYERINFO structure describes the layer position within a file.

Member

Description

uStructSize

Size of this structure. Use sizeof (LAYERINFO).

nLayerLeft

Value that represents the left layer position, in pixels.

nLayerTop

Value that represents the top layer position, in pixels.

uOpacity

Opacity value of the layer. Possible values are between 0 and 255, where a value of 0 is completely transparent and a value of 255 is completely opaque. For more information, refer to the FILE FORMATS SPECIFICATION from Adobe.

uClipping

Clipping value for the layer. A value of 0 represents base. A value of 1 represents non-base. For more information, refer to the FILE FORMATS SPECIFICATION from Adobe.

szBlendModeKey

A four byte character array that represents the blend mode key for the layer. Possible values are:

Value

Meaning

'norm'

normal.

'dark'

darken.

'lite'

lighten.

'hue '

hue.

'sat '

saturation.

'colr'

color.

'lum '

luminosity.

'mul '

multiply.

'scrn'

screen.

'diss'

dissolve.

'over'

overlay.

'hLit'

hard light.

'sLit'

soft light.

'diff'

difference.

'smud'

exclusion.

'div '

dodge.

'idiv'

color burn

 

For more information, refer to the FILE FORMATS SPECIFICATION from Adobe.

pMaskBitmap

Pointer to a bitmap handle that references the bitmap of the transparency mask channel of the saved layer. This is an 8-bit grayscale bitmap. The value of each pixel indicates the amount of transparency the data of the original bitmap has at this point. For example, if the value is 0xFF at a certain point, the pixel value of the layer bitmap at that point is not transparent at all. If the value was 0x00, the pixel value of the layer bitmap at that point is fully transparent. If the value is between these two, it indicates the degree of transparency the pixel value of the layer bitmap has at that point.

 

When loading, this variable must be a pointer to a BITMAPHANDLE, which is not allocated. The load function will allocate this bitmap and it is up to the user to free this bitmap.

 

If the mask bitmap does not need to be loaded, pass NULL. Passing NULL saves the transparency mask as a full white bitmap, which represents full visibility of the layer.

 

When saving, if this is a valid bitmap, then it should be of the same width & height as the corresponding layer bitmap. It should also be an 8-bit grayscale bitmap.

 

For more information, refer to FILE FORMATS SPECIFICATION from Adobe.

szName

Null-terminated character string that contains the layer name.

Comments

pLAYERINFO is a pointer to a LAYERINFO structure. Where the function parameter type is pLAYERINFO, declare a LAYERINFO variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pLAYERINFO variable is necessary only if the program requires a pointer.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

Usually layers start at the top-left position of the image, so nLayerLeft and nLayerTop are 0 most of the time.