L_ClrConvertDirect

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

L_LTCLR_API L_INT L_ClrConvertDirect(nSrcFormat, nDstFormat, pSrcBuf, pDstBuf, nWidth, nHeight, nInAlign, nOutAlign)

L_INT nSrcFormat;

/* format of the input data */

L_INT nDstFormat;

/* format of the output data */

L_UCHAR * pSrcBuf;

/* pointer to the input buffer */

L_UCHAR * pDstBuf;

/* pointer to the output buffer */

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 another directly using built in algorithms.

Parameter

Description

nSrcFormat

Format of the source data. Possible values are:

 

Value

Meaning

 

CCS_RGB

[0x00] Color conversion is RGB.

 

CCS_YUV

[0x01] Color conversion is YUV.

 

CCS_CMYK

[0x02] Color conversion is CMYK.

 

CCS_HSV

[0x03] Color conversion is HSV.

 

CCS_HLS

[0x04] Color conversion is HLS.

 

CCS_YIQ

[0x05] Color conversion is YIQ.

 

CCS_CMY

[0x06] Color conversion is CMY.

 

CCS_LAB

[0x07] Color conversion is CIELAB.

 

CCS_XYZ

[0x08] Color conversion is CIEXYZ.

 

CCS_YCCK

[0x0B] Color conversion is YCCK.

 

CCS_BGR

[0x0C] Color conversion is BGR.

 

CCS_UYVY

[0x0E] Color conversion is UYVY.

 

CCS_YUY2

[0x09] Color conversion is YUY2.

 

CCS_YVU9

[0x0A] Color conversion is YVU9.

 

CCS_YCC

[0x0F] Color conversion is YCC.

 

CCS_Y41P

[0x0D] Color conversion is Y41P

 

CCS_IHS

[0x80] Color conversion is IHS

 

CCS_ARGB4

[0x90] Color conversion is ARGB4

nDstFormat

Format of the output data. Possible values are:

 

Value

Meaning

 

CCS_RGB

[0x00] Color conversion is RGB.

 

CCS_YUV

[0x01] Color conversion is YUV.

 

CCS_CMYK

[0x02] Color conversion is CMYK.

 

CCS_HSV

[0x03] Color conversion is HSV.

 

CCS_HLS

[0x04] Color conversion is HLS.

 

CCS_YIQ

[0x05] Color conversion is YIQ.

 

CCS_CMY

[0x06] Color conversion is CMY.

 

CCS_LAB

[0x07] Color conversion is CIELAB.

 

CCS_XYZ

[0x08] Color conversion is CIEXYZ.

 

CCS_YCCK

[0x0B] Color conversion is YCCK.

 

CCS_BGR

[0x0C] Color conversion is BGR.

 

CCS_UYVY

[0x0E] Color conversion is UYVY.

 

CCS_YUY2

[0x09] Color conversion is YUY2.

 

CCS_YVU9

[0x0A] Color conversion is YVU9.

 

CCS_YCC

[0x0F] Color conversion is YCC.

 

CCS_Y41P

[0x0D] Color conversion is Y41P

 

CCS_IHS

[0x80] Color conversion is IHS

 

CCS_ARGB4

[0x90] Color conversion is ARGB4

pSrcBuf

Pointer to the buffer holding the input data.

pDstBuf

Pointer to the buffer that will hold the converted data.

nWidth

Width of pixels to be processed.

nHeight

Height of pixels to be processed.

nInAlign

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

nOutAlign

Each scan line 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

Converting from any color space to YCCK color space is currently not supported.

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_ClrConvert

Topics:

Programming with LEADTOOLS Color Conversion Functions

 

Color Conversion C DLL Function Groups

Example

L_INT ClrConvertDirectExample(
   L_UCHAR* pInput,
   L_UCHAR* pOutput,
   L_INT nWidth,
   L_INT nHeight)
{
   L_INT nRet;
   /* direct conversion using built in options */
   nRet = L_ClrConvertDirect(CCS_CMYK, /* input color conversion  */
      CCS_RGB,    /* output color conversion */
      pInput,     /* input buffer            */
      pOutput,    /* output buffer           */
      nWidth,     /* pixels width            */
      nHeight,    /* pixels height           */
      0,          /* 0 bytes align           */
      0);         /* 0 bytes align           */
   return nRet;
}