Chasys Draw IES Help:

SDK - Callback Suites - pi_BasicColor

SDK - Callback Suites - pi_BasicColor

Callback Overview

This callback suite provides the plug-in with basic color conversion and manipulation functionality. These include color space conversions.


Callback Interface Description

This interface operates at the pixel level, with callbacks accepting a pointer to one or more pixels. The interface itself is encapsulated in an object of type pi_BASICCOLOR.



#define PI_BASICCOLOR_VERSION                         0x00010002


struct pi_BASICCOLOR


      unsigned long     version;

      unsigned long     unused_1;


      int   (__cdecl*   convert)(unsigned long *p_pix,

            int count,int cp_in,int cp_out,unsigned long flags);

      int   (__cdecl*   read_rgb)(unsigned long *p_pix,unsigned char *p_rgb,

            int count,int bpp,unsigned long flags);


      unsigned char     reserved_x[1024-16];//do not touch



//flags for "cp_in" and "cp_out" in ::convert()

#define PI_BC_COLORSPACE_RGB                          0x00000000

#define PI_BC_COLORSPACE_BGR                          0x00000001

#define PI_BC_COLORSPACE_YUV                          0x00000002

#define PI_BC_COLORSPACE_CMY                          0x00000003

#define PI_BC_COLORSPACE_CMYK                         0x00000004

#define PI_BC_COLORSPACE_HSL                          0x00000005

#define PI_BC_COLORSPACE_HSV                          0x00000006

#define PI_BC_COLORSPACE_HHSL                         0x00000007

#define PI_BC_COLORSPACE_HHSV                         0x00000008


//flags for "flags" in ::read_rgb()

#define PI_BC_READRGB_LSB_IS_RED                      0x00000001

#define PI_BC_READRGB_ALPHA_NORM                      0x00000000

#define PI_BC_READRGB_ALPHA_INVT                      0x00000002

#define PI_BC_READRGB_ALPHA_NONE                      0x00000006

#define PI_BC_READRGB_ALPHA_xxxx                      0x00000006


convert() converts one or more pixels from the color space referenced in cp_in to the color space referenced in cp_out.

read_rgb() converts one or more pixels from packed 24 or 32 bit-per-pixel with RGB or BGR ordering to the RGBA format used by Chasys Draw IES. It also accepts 8 bits-per-pixel greyscale data. This function has highly optimized SIMD routines that can process up to 4 pixels at a time. The source data is pointed to by p_rgb, which must contain at least 8 bytes of padding to allow for large SIMD read/write operations.

The internal implementation of pi_BasicColor is neither defined nor fixed, and is purely host dependent. Do not attempt to access the reserved portion of the object.



Copyright © John Paul Chacha, 2001-2017

The information herein is subject to change without any notice. The author makes no guarantees as to the completeness of this documentation.