L_ClrConvertToBitmap

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_ClrConvertToBitmap(ClrHandle, pSrc, pBitmap, uStructSize, nWidth, nHeight, nInAlign, nOutAlign)

HANDLE ClrHandle;

/* handle to the color conversion */

L_CHAR * pSrc;

/* pointer to the input buffer */

BITMAPHANDLE * pBitmap;

/* pointer to the output LEAD bitmap */

L_UINT uStructSize;

/* size, in bytes of pBitmap */

L_INT nWidth;

/* width of pixels to be processed */

L_INT nHeight;

/* height of pixels to be processed */

L_INT nInAlign;

/* each scanline in the input buffer is a multiple of nInAlign bytes */

L_INT nOutAlign;

/* each scan line in the output buffer is a multiple of nOutAlign bytes */

Converts image data in a buffer from one color conversion model to RGB\BGR, and sets it as a LEAD bitmap.

Parameter

Description

ClrHandle

Handle to an existing color conversion. This handle is obtained by calling the L_ClrInit function.

pSrc

Pointer to the buffer holding the input data.

pBitmap

Pointer to the buffer that will hold the converted data bitmap.

uStructSize

Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

nWidth

Width of pixels to be processed.

nHeigh

Height of pixels to be processed.

nInAlign

Each scanline in the input buffer is a multiple of nInAlign bytes.

nOutAlign

Each scanline in the output buffer is a multiple of nOutAlign bytes.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Conversion is done by setting the active method value specified in the CONVERSION_PARAMS structure when calling L_ClrInit. To change the active method, use L_ClrSetConversionParams. Only methods supported by the initialized converter should be specified.

The conversion is done if it was initialized with BGR or RGB Color Spaces as the destination.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_ClrInit

Topics:

Conversion Process

 

COLOR Function Groups

Example

// This example converts a CMYK bitmap buffer into RGB bitmap
L_VOID ConvertCMYKToRGB(L_UCHAR * pInput, pBITMAPHANDLE pBitmap, L_INT nWidth, L_INT nHeight)
{
   // Color Handle
   HANDLE ClrHandle;
   /* initialize the color conversion */
   L_ClrInit(&ClrHandle, CCS_CMYK, CCS_RGB, NULL);
   /* convert the image buffer */
   L_ClrConvertToBitmap(ClrHandle, pInput, pBitmap, SIZEOFBITMAPHANDLE, nWidth, nHeight, 0,  0);
   /* free the conversion */
   L_ClrFree(ClrHandle);
}