SignDoc SDK (C)  5.0.0
SIGNDOC_Color Class Reference

A color. More...

#include <SignDocSDK-c.h>

Public Member Functions

struct SIGNDOC_ColorSIGNDOC_Color_createGray (struct SIGNDOC_Exception **aEx, unsigned char aIntensity)
 Create a new gray-scale color object. More...
 
struct SIGNDOC_ColorSIGNDOC_Color_createRGB (struct SIGNDOC_Exception **aEx, unsigned char aRed, unsigned char aGreen, unsigned char aBlue)
 Create a new RGB color object. More...
 
struct SIGNDOC_ColorSIGNDOC_Color_createRGB1 (struct SIGNDOC_Exception **aEx, unsigned aRGB)
 Create a new RGB color object from a single integer. More...
 
struct SIGNDOC_ColorSIGNDOC_Color_clone (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Color *aObj)
 Create a copy of a SIGNDOC_Color object. More...
 
void SIGNDOC_Color_delete (struct SIGNDOC_Color *aObj)
 SIGNDOC_Color destructor. More...
 
int SIGNDOC_Color_getType (const struct SIGNDOC_Color *aObj)
 Get the color type of aObj. More...
 
unsigned SIGNDOC_Color_getNumberOfComponents (const struct SIGNDOC_Color *aObj)
 Get the number of color components (channels). More...
 
unsigned char SIGNDOC_Color_getComponent (const struct SIGNDOC_Color *aObj, unsigned aIndex)
 Get one color component (channel). More...
 
unsigned char SIGNDOC_Color_getIntensity (const struct SIGNDOC_Color *aObj)
 Get the intensity of a gray-scale color object. More...
 
unsigned char SIGNDOC_Color_getRed (const struct SIGNDOC_Color *aObj)
 Get the red component of an RGB color object. More...
 
unsigned char SIGNDOC_Color_getGreen (const struct SIGNDOC_Color *aObj)
 Get the green component of an RGB color object. More...
 
unsigned char SIGNDOC_Color_getBlue (const struct SIGNDOC_Color *aObj)
 Get the blue component of an RGB color object. More...
 
unsigned SIGNDOC_Color_getRGB (const struct SIGNDOC_Color *aObj)
 Get the color as integer (0x00rrggbb). More...
 

Detailed Description

A color.

Use the static factory functions SIGNDOC_Color_createGray(), SIGNDOC_Color_createRGB(), and SIGNDOC_Color_createRGB1() to create SIGNDOC_Color objects. Do not forget to destroy the objects after use.

Member Function Documentation

struct SIGNDOC_Color * SIGNDOC_Color_clone ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Color aObj 
)

Create a copy of a SIGNDOC_Color object.

Do not forget to destroy the copy after use.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Color object.
Returns
A pointer to the new object.
struct SIGNDOC_Color * SIGNDOC_Color_createGray ( struct SIGNDOC_Exception **  aEx,
unsigned char  aIntensity 
)

Create a new gray-scale color object.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aIntensityThe intensity (0 through 255, 0 is black).
Returns
A pointer to the new color object. Do not forget to destroy the object after use.
struct SIGNDOC_Color * SIGNDOC_Color_createRGB ( struct SIGNDOC_Exception **  aEx,
unsigned char  aRed,
unsigned char  aGreen,
unsigned char  aBlue 
)

Create a new RGB color object.

The values are in 0 through 255, 0 is black.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aRedThe value of the red channel.
[in]aGreenThe value of the green channel.
[in]aBlueThe value of the blue channel.
Returns
A pointer to the new color object. Do not forget to destroy the object after use.
struct SIGNDOC_Color * SIGNDOC_Color_createRGB1 ( struct SIGNDOC_Exception **  aEx,
unsigned  aRGB 
)

Create a new RGB color object from a single integer.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aRGB0x00rrggbb (rr is the red component, gg is the green component, bb is the blue component).
Returns
A pointer to the new color object. Do not forget to destroy the object after use.
void SIGNDOC_Color_delete ( struct SIGNDOC_Color aObj)

SIGNDOC_Color destructor.

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
unsigned char SIGNDOC_Color_getBlue ( const struct SIGNDOC_Color aObj)

Get the blue component of an RGB color object.

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
Returns
The blue component (0 through 255, 0 is black) of an RGB color object, undefined for other color types.
unsigned char SIGNDOC_Color_getComponent ( const struct SIGNDOC_Color aObj,
unsigned  aIndex 
)

Get one color component (channel).

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
[in]aIndexThe index of the color component (0 through 2). The meaning depends on the color type.
Returns
The value (0 through 255) of the color component aIndex or 0 if aIndex is out of range.
unsigned char SIGNDOC_Color_getGreen ( const struct SIGNDOC_Color aObj)

Get the green component of an RGB color object.

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
Returns
The green component (0 through 255, 0 is black) of an RGB color object, undefined for other color types.
unsigned char SIGNDOC_Color_getIntensity ( const struct SIGNDOC_Color aObj)

Get the intensity of a gray-scale color object.

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
Returns
The intensity (0 through 255, 0 is black) for a gray-scale color object, undefined for other color types.
unsigned SIGNDOC_Color_getNumberOfComponents ( const struct SIGNDOC_Color aObj)

Get the number of color components (channels).

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
Returns
1 for gray scale, 3 for RGB.
unsigned char SIGNDOC_Color_getRed ( const struct SIGNDOC_Color aObj)

Get the red component of an RGB color object.

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
Returns
The red component (0 through 255, 0 is black) of an RGB color object, undefined for other color types.
unsigned SIGNDOC_Color_getRGB ( const struct SIGNDOC_Color aObj)

Get the color as integer (0x00rrggbb).

rr is the red component, gg is the green component, bb is the blue component.

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
int SIGNDOC_Color_getType ( const struct SIGNDOC_Color aObj)

Get the color type of aObj.

Parameters
[in]aObjA pointer to the SIGNDOC_Color object.
Returns
The color type: SIGNDOC_COLOR_TYPE_GRAY or SIGNDOC_COLOR_TYPE_RGB.

The documentation for this class was generated from the following file: