LibCapy - color

Color class.

Macros:

Enumerations:

Color spaces

Color illuminant

Typedefs:

Type for the color values

Struct CapyColor :

Struct CapyColor's properties:

Color values

Color illuminant for conversion (by default D65)

Struct CapyColor's methods:

Destructor

Convert the color from RGB to HSV

Output and side effect(s):

Return the converted color, values in [0,1] Can be used with $$(..., CapyColorData*, ...)

Convert the color from HSV to RGB

Output and side effect(s):

Return the converted color, values in [0,1] Can be used with $$(..., CapyColorData*, ...)

Convert the color from RGB (in [0,1]) to XYZ (in [0,1])

Output and side effect(s):

Return the converted color Can be used with $$(..., CapyColorData*, ...)

Convert the color from XYZ (in [0,1]) to RGB (in [0,1])

Output and side effect(s):

Return the converted color, values in [0,1] Can be used with $$(..., CapyColorData*, ...)

Convert the color from LAB to XYZ

Output and side effect(s):

Return the converted color Can be used with $$(..., CapyColorData*, ...)

Convert the color from Oklab to XYZ (D65 white point)

Output and side effect(s):

Return the converted color Can be used with $$(..., CapyColorData*, ...)

Convert the color from XYZ to LAB

Output and side effect(s):

Return the converted color, values in [0,1] Can be used with $$(..., CapyColorData*, ...)

Convert the color from XYZ (D65 white point) to Oklab

Output and side effect(s):

Return the converted color Can be used with $$(..., CapyColorData*, ...)

Convert the color from RGB to rgb

Output and side effect(s):

Return the converted color Can be used with $$(..., CapyColorData*, ...)

Convert the color from RGB to l1l2l3

Output and side effect(s):

Return the converted color Can be used with $$(..., CapyColorData*, ...)

Convert the color from RGB to c1c2c3

Output and side effect(s):

Return the converted color Can be used with $$(..., CapyColorData*, ...)

Check if that is equal to 'color'

Input argument(s):

color: the color to be compared with

Output and side effect(s):

Return true if the colors are identical, else false Can be used with $$(..., CapyColorData*, ...)

Struct CapyColorPalette :

Struct CapyColorPalette's properties:

Number of colors in the palette

Colors in the palette

Struct CapyColorPalette's methods:

Destructor

Set a color in the palette

Input argument(s):

iColor: the index of the color
color: the color to set

Output and side effect(s):

The color is set.

Get a color in the palette

Input argument(s):

iColor: the index of the color

Output and side effect(s):

Return the color.

Set random colors in the palette

Input argument(s):

rng: the RNG to be used

Output and side effect(s):

The RGB colors are set.

Set random pastel colors in the palette

Input argument(s):

rng: the RNG to be used

Output and side effect(s):

The RGB colors are set.

Functions:

Create a CapyColor

Input argument(s):

color: the color values

Output and side effect(s):

Return a CapyColor

Allocate memory for a new CapyColor and create it

Input argument(s):

color: the color values

Output and side effect(s):

Return a CapyColor

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyColor* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyColor to free

Create a CapyColorPalette

Input argument(s):

size: the number of colors in the palette

Output and side effect(s):

Return a CapyColorPalette, all colors initialised to capyColorRGBABlack

Allocate memory for a new CapyColorPalette and create it

Input argument(s):

size: the number of colors in the palette

Output and side effect(s):

Return a CapyColorPalette, all colors initialised to capyColorRGBABlack

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyColorPalette* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyColorPalette to free

2021-10-08
in LibCapy,
84 views
Copyright 2021-2024 Baillehache Pascal