GeglColor

GeglColor

Functions

Types and Values

Description

Functions

gegl_color_new ()

GeglColor *
gegl_color_new (const gchar *string);

Creates a new GeglColor.

Returns the newly created GeglColor.

Parameters

string

a string describing the color to be created.

 

gegl_color_duplicate ()

GeglColor *
gegl_color_duplicate (GeglColor *color);

Creates a copy of color .

Parameters

color

the color to duplicate.

 

Returns

A new copy of color .

[transfer full]


gegl_color_get_rgba ()

void
gegl_color_get_rgba (GeglColor *color,
                     gdouble *red,
                     gdouble *green,
                     gdouble *blue,
                     gdouble *alpha);

Retrieves the current set color as linear light non premultipled RGBA data, any of the return pointers can be omitted.

Parameters

color

a GeglColor

 

red

red return location.

[out]

green

green return location.

[out]

blue

blue return location.

[out]

alpha

alpha return location.

[out]

gegl_color_set_rgba ()

void
gegl_color_set_rgba (GeglColor *color,
                     gdouble red,
                     gdouble green,
                     gdouble blue,
                     gdouble alpha);

Set color as linear light non premultipled RGBA data

Parameters

color

a GeglColor

 

red

red value

 

green

green value

 

blue

blue value

 

alpha

alpha value

 

gegl_color_get_rgba_with_space ()

void
gegl_color_get_rgba_with_space (GeglColor *color,
                                gdouble *red,
                                gdouble *green,
                                gdouble *blue,
                                gdouble *alpha,
                                const Babl *space);

Retrieves the current set color stored as space . If space is NULL, this is equivalent to requesting color in sRGB.

Parameters

color

a GeglColor

 

red

red return location.

[out]

green

green return location.

[out]

blue

blue return location.

[out]

alpha

alpha return location.

[out]

space

RGB space.

 

gegl_color_set_rgba_with_space ()

void
gegl_color_set_rgba_with_space (GeglColor *color,
                                gdouble red,
                                gdouble green,
                                gdouble blue,
                                gdouble alpha,
                                const Babl *space);

Set color as RGBA data stored as space . If space is NULL, this is equivalent to storing as sRGB.

Parameters

color

a GeglColor

 

red

red value

 

green

green value

 

blue

blue value

 

alpha

alpha value

 

space

RGB space.

 

gegl_color_get_cmyk ()

void
gegl_color_get_cmyk (GeglColor *color,
                     gdouble *cyan,
                     gdouble *magenta,
                     gdouble *yellow,
                     gdouble *key,
                     gdouble *alpha,
                     const Babl *space);

Retrieves the current set color stored as space . If space is NULL, this is equivalent to requesting color in the default naive CMYK space.

Parameters

color

a GeglColor

 

cyan

cyan return location.

[out]

magenta

magenta return location.

[out]

yellow

yellow return location.

[out]

key

key return location.

[out]

alpha

alpha return location.

[out]

space

CMYK space.

[nullable]

gegl_color_set_cmyk ()

void
gegl_color_set_cmyk (GeglColor *color,
                     gdouble cyan,
                     gdouble magenta,
                     gdouble yellow,
                     gdouble key,
                     gdouble alpha,
                     const Babl *space);

Set color as CMYK data stored as space . If space is NULL, this is equivalent to storing with the default naive CMYK space.

Parameters

color

a GeglColor

 

cyan

cyan value

 

magenta

magenta value

 

yellow

yellow value

 

key

key value

 

alpha

alpha value

 

space

CMYK space.

[nullable]

gegl_color_get_hsva ()

void
gegl_color_get_hsva (GeglColor *color,
                     gdouble *hue,
                     gdouble *saturation,
                     gdouble *value,
                     gdouble *alpha,
                     const Babl *space);

Retrieves the current set color stored as space . If space is NULL, this is equivalent to requesting color in the default sRGB space.

Parameters

color

a GeglColor

 

hue

hue return location.

[out]

saturation

saturation return location.

[out]

value

value return location.

[out]

alpha

alpha return location.

[out]

space

RGB space.

[nullable]

gegl_color_set_hsva ()

void
gegl_color_set_hsva (GeglColor *color,
                     gdouble hue,
                     gdouble saturation,
                     gdouble value,
                     gdouble alpha,
                     const Babl *space);

Set color as HSVA data stored as space . If space is NULL, this is equivalent to storing with the default sRGB space.

Parameters

color

a GeglColor

 

hue

hue value.

 

saturation

saturation value.

 

value

value value.

 

alpha

alpha value.

 

space

RGB space.

[nullable]

gegl_color_get_hsla ()

void
gegl_color_get_hsla (GeglColor *color,
                     gdouble *hue,
                     gdouble *saturation,
                     gdouble *lightness,
                     gdouble *alpha,
                     const Babl *space);

Retrieves the current set color stored as space . If space is NULL, this is equivalent to requesting color in the default sRGB space.

Parameters

color

a GeglColor

 

hue

hue return location.

[out]

saturation

saturation return location.

[out]

lightness

value return location.

[out]

alpha

alpha return location.

[out]

space

RGB space.

[nullable]

gegl_color_set_hsla ()

void
gegl_color_set_hsla (GeglColor *color,
                     gdouble hue,
                     gdouble saturation,
                     gdouble lightness,
                     gdouble alpha,
                     const Babl *space);

Set color as HSLA data stored as space . If space is NULL, this is equivalent to storing with the default sRGB space.

Parameters

color

a GeglColor

 

hue

hue value.

 

saturation

saturation value.

 

lightness

lightness value.

 

alpha

alpha value.

 

space

RGB space.

[nullable]

gegl_color_set_pixel ()

void
gegl_color_set_pixel (GeglColor *color,
                      const Babl *format,
                      const void *pixel);

Set a GeglColor from a pointer to a pixel and it's babl format.

[skip]

Parameters

color

a GeglColor

 

format

a babl pixel format

 

pixel

pointer to a pixel.

[not nullable]

gegl_color_get_pixel ()

void
gegl_color_get_pixel (GeglColor *color,
                      const Babl *format,
                      void *pixel);

Store the color in a pixel in the given format.

[skip]

Parameters

color

a GeglColor

 

format

a babl pixel format

 

pixel

pointer to a pixel

 

gegl_color_set_bytes ()

void
gegl_color_set_bytes (GeglColor *color,
                      const Babl *format,
                      GBytes *bytes);

Set a GeglColor from a pixel stored in a GBytes and it's babl format.

Parameters

color

a GeglColor

 

format

a babl pixel format

 

bytes

color stored as format

 

gegl_color_get_bytes ()

GBytes *
gegl_color_get_bytes (GeglColor *color,
                      const Babl *format);

Parameters

color

a GeglColor

 

format

a babl pixel format

 

Returns

the color in the given format .


gegl_param_spec_color ()

GParamSpec *
gegl_param_spec_color (const gchar *name,
                       const gchar *nick,
                       const gchar *blurb,
                       GeglColor *default_color,
                       GParamFlags flags);

Creates a new GParamSpec instance specifying a GeglColor property.

Parameters

name

canonical name of the property specified

 

nick

nick name for the property specified

 

blurb

description of the property specified

 

default_color

the default value for the property specified

 

flags

flags for the property specified

 

Returns

a newly created parameter specification.

[transfer full]


gegl_param_spec_color_from_string ()

GParamSpec *
gegl_param_spec_color_from_string (const gchar *name,
                                   const gchar *nick,
                                   const gchar *blurb,
                                   const gchar *default_color_string,
                                   GParamFlags flags);

Creates a new GParamSpec instance specifying a GeglColor property.

Parameters

name

canonical name of the property specified

 

nick

nick name for the property specified

 

blurb

description of the property specified

 

default_color_string

the default value for the property specified

 

flags

flags for the property specified

 

Returns

a newly created parameter specification.

[transfer full]


gegl_param_spec_color_get_default ()

GeglColor *
gegl_param_spec_color_get_default (GParamSpec *self);

Get the default color value of the param spec

Parameters

self

a GeglColor GParamSpec

 

Returns

the default GeglColor.

[transfer none]


gegl_color_get_format ()

const Babl *
gegl_color_get_format (GeglColor *color);

Return: (transfer none): the pixel format encoding of the set color.

Parameters

color

a GeglColor

 

Types and Values

GeglColor

typedef struct {
  GObject           parent_instance;
  GeglColorPrivate *priv;
} GeglColor;