Class: Gegl::Color

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Gegl::Color

Creates a new Gegl::Color.

Returns the newly created Gegl::Color.

Parameters:

  • string (String) —

    a string describing the color to be created.

Instance Method Details

#duplicate ⇒ Gegl::Color

Creates a copy of color.

Returns:

#format ⇒ Babl::Object

Returns the pixel format encoding of the set color.

Returns:

  • (Babl::Object) —

    the pixel format encoding of the set color.

#get_bytes(format) ⇒ GLib::Bytes

Returns the color in the given format.

Parameters:

  • format (Babl::Object) —

    a babl pixel format

Returns:

  • (GLib::Bytes) —

    the color in the given format.

#get_cmyk(cyan, magenta, yellow, key, alpha, space) ⇒ nil

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

Parameters:

  • cyan (Float) —

    cyan return location.

  • magenta (Float) —

    magenta return location.

  • yellow (Float) —

    yellow return location.

  • key (Float) —

    key return location.

  • alpha (Float) —

    alpha return location.

  • space (Babl::Object) —

    CMYK space.

Returns:

  • (nil)

#get_components(format, components_length) ⇒ Array<Float>

Get the component values of the color in format.
If value format not supported return NULL and components_length set to 0.

Parameters:

  • format (GObject::Value) —

    A Babl pointer

  • components_length (Integer) —

    The length of the returned buffer

Returns:

  • (Array<Float>) —

    The color components

#get_pixel(format, pixel) ⇒ nil

Store the color in a pixel in the given format.

Parameters:

  • format (Babl::Object) —

    a babl pixel format

  • pixel (GObject) —

    pointer to a pixel

Returns:

  • (nil)

#get_rgba(red, green, blue, alpha) ⇒ nil

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

Parameters:

  • red (Float) —

    red return location.

  • green (Float) —

    green return location.

  • blue (Float) —

    blue return location.

  • alpha (Float) —

    alpha return location.

Returns:

  • (nil)

#get_rgba_with_space(red, green, blue, alpha, space) ⇒ nil

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

Parameters:

  • red (Float) —

    red return location.

  • green (Float) —

    green return location.

  • blue (Float) —

    blue return location.

  • alpha (Float) —

    alpha return location.

  • space (Babl::Object) —

    RGB space.

Returns:

  • (nil)

#set_bytes(format, bytes) ⇒ nil

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

Parameters:

  • format (Babl::Object) —

    a babl pixel format

  • bytes (GLib::Bytes) —

    color stored as format

Returns:

  • (nil)

#set_cmyk(cyan, magenta, yellow, key, alpha, space) ⇒ nil

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

Parameters:

  • cyan (Float) —

    cyan value

  • magenta (Float) —

    magenta value

  • yellow (Float) —

    yellow value

  • key (Float) —

    key value

  • alpha (Float) —

    alpha value

  • space (Babl::Object) —

    CMYK space.

Returns:

  • (nil)

#set_components(format, components, components_length) ⇒ nil

Set the color using the component values as format.

Parameters:

  • format (GObject::Value) —

    A Babl pointer

  • components (Array<Float>) —

    The color components.

  • components_length (Integer) —

    The length of the components array

Returns:

  • (nil)

#set_pixel(format, pixel) ⇒ nil

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

Parameters:

  • format (Babl::Object) —

    a babl pixel format

  • pixel (GObject) —

    pointer to a pixel

Returns:

  • (nil)

#set_rgba(red, green, blue, alpha) ⇒ nil

Set color as linear light non premultipled RGBA data

Parameters:

  • red (Float) —

    red value

  • green (Float) —

    green value

  • blue (Float) —

    blue value

  • alpha (Float) —

    alpha value

Returns:

  • (nil)

#set_rgba_with_space(red, green, blue, alpha, space) ⇒ nil

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

Parameters:

  • red (Float) —

    red value

  • green (Float) —

    green value

  • blue (Float) —

    blue value

  • alpha (Float) —

    alpha value

  • space (Babl::Object) —

    RGB space.

Returns:

  • (nil)

#string ⇒ String

Returns string.

Returns:

  • (String) —

    string

#string=(string) ⇒ String

Parameters:

  • string (String)

Returns:

  • (String) —

    string

  • (String) —

    string