Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.11.1
LEADTOOLS Raster Imaging C DLL Help

PAINTDIBINFO

Show in webframe

typedef struct _PAINTDIBINFO
{
   L_UINT uStructSize; 
   L_UINT uViewPerspective;
   L_UINT uBitsPerPixel;
   L_UINT uPlaneCount;
   L_UINT uBytesPerLine;
   L_INT nOrder;
   L_UINT uFlags;
   L_UINT uLowBit;
   L_UINT uHighBit;
   L_UINT uDataOffset; 
   L_VOID *pUserData; 
} PAINTDIBINFO, * pPAINTDIBINFO;

The PAINTDIBINFO structure describes the format of the data needed for custom painting. This structure is filled by the PAINTCALLBACK_GETDIBINFO callback. It is also passed to the PAINTCALLBACK_CONVERTLINE callback.

Member

Description

uStructSize

Size of the PAINTDIBINFO structure. This should be sizeof(PAINTDIBINFO). You must fill this member.

uViewPerspective

The orientation of the data used for painting. Can be TOP_LEFT (the image data should be top-down, which is the opposite of the normal GDI order) or BOTTOM_LEFT (the image data should be upside-down, which is the normat GDI order).

uBitsPerPixel

The bits per pixel.

uPlaneCount

The number of planes (only the value 1 is supported at the moment). Possible values are:

 

Value

Meaning

 

1

Interleaved data. All data is in a single plane. This is the only value supported at the moment.

 

> 1

Planar data. Each component is in a separate plane. This is reserved for future use.

uBytesPerLine

The number of bytes per line. This is usually rounded up to a multiple of 4 bytes. This should be calculated based the uWidth parameter that is passed to the PAINTCALLBACK_GETDIBINFO callback.

nOrder

The color order of the image data. It will usually be ORDER_GRAY or ORDER_BGR.

uFlags

Any of the following flags. (You can use a bitwise OR to specify more than one value.).

 

Value

Meaning

 

DIBFLAG_IGNORELUT

[0x0001] Ignore the LUT during color conversion. The window levelling will be done through a hardware LUT.

 

DIBFLAG_LOWHIGHBITVALID

[0x0002] The low and high bit values are valid. The data does not use the whole range.

uLowBit

The low bit of the useful image data. Valid only if DIBFLAG_LOWHIGHBITVALID is set. This has to be between 0 and uHighBit.

uHighBit

The high bit of the useful image data. Valid only if DIBFLAG_LOWHIGHBITVALID is set. This has to be between uLowBit and uBitsPerPixel - 1.

uDataOffset

Value that should be added to each pixel value. This should be 0 in most cases.

pUserData

Pointer a the user data. This value will be present in the structure when the PAINTCALLBACK_CONVERTLINE callback is called. You can set it to NULL if you do not need this.

Comments

If you specify a PAINTCALLBACK_GETDIBINFO callback, the display engine will call it and pass it a pointer to a PAINTDIBINFO structure. Also, the callback will have a uWidth parameter. The callback is responsible for filling the structure with the correct values.

In our testing, medical imaging display adapters could display up to 13-bits of grayscale data (8192 shades of gray). But, they used 16 bits of data for each pixel, with the useful image data being in the low 12 bits. In this case, you would do something like this:

pPaintDibInfo->uBitsPerPixel = 16;
pPaintDibInfo->uFlags = DIBFLAG_LOWHIGHBITVALID;
pPaintDibInfo->uLowBit = 0;
pPaintDibInfo->uHighBit = 11;

See Also

Functions:

L_PaintDCOverlayCallback, L_PaintDCBufferCallback, L_PaintDCCallback, L_PaintRgnDCCallback, L_PaintRgnDCBufferCallback

Topics:

Paint Using Custom Callbacks
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.