Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
cairo-color.c File Reference
#include "cairoint.h"

Go to the source code of this file.

Defines

#define CAIRO_COLOR_ONE_MINUS_EPSILON   (65536.0 - 1e-5)

Functions

const cairo_color_t * _cairo_stock_color (cairo_stock_t stock)
void _cairo_color_init (cairo_color_t *color)
void _cairo_color_init_rgb (cairo_color_t *color, double red, double green, double blue)
static void _cairo_color_compute_shorts (cairo_color_t *color)
void _cairo_color_init_rgba (cairo_color_t *color, double red, double green, double blue, double alpha)
void _cairo_color_multiply_alpha (cairo_color_t *color, double alpha)
void _cairo_color_get_rgba (cairo_color_t *color, double *red, double *green, double *blue, double *alpha)
void _cairo_color_get_rgba_premultiplied (cairo_color_t *color, double *red, double *green, double *blue, double *alpha)

Variables

static cairo_color_t const cairo_color_white
static cairo_color_t const cairo_color_black
static cairo_color_t const cairo_color_transparent
static cairo_color_t const cairo_color_magenta

Define Documentation

#define CAIRO_COLOR_ONE_MINUS_EPSILON   (65536.0 - 1e-5)

Definition at line 96 of file cairo-color.c.


Function Documentation

static void _cairo_color_compute_shorts ( cairo_color_t *  color) [static]

Definition at line 99 of file cairo-color.c.

{
    color->red_short   = color->red   * color->alpha * CAIRO_COLOR_ONE_MINUS_EPSILON;
    color->green_short = color->green * color->alpha * CAIRO_COLOR_ONE_MINUS_EPSILON;
    color->blue_short  = color->blue  * color->alpha * CAIRO_COLOR_ONE_MINUS_EPSILON;
    color->alpha_short = color->alpha * CAIRO_COLOR_ONE_MINUS_EPSILON;
}

Here is the caller graph for this function:

void _cairo_color_get_rgba ( cairo_color_t *  color,
double *  red,
double *  green,
double *  blue,
double *  alpha 
)

Definition at line 130 of file cairo-color.c.

{
    *red   = color->red;
    *green = color->green;
    *blue  = color->blue;
    *alpha = color->alpha;
}
void _cairo_color_get_rgba_premultiplied ( cairo_color_t *  color,
double *  red,
double *  green,
double *  blue,
double *  alpha 
)

Definition at line 143 of file cairo-color.c.

{
    *red   = color->red   * color->alpha;
    *green = color->green * color->alpha;
    *blue  = color->blue  * color->alpha;
    *alpha = color->alpha;
}
void _cairo_color_init ( cairo_color_t *  color)

Definition at line 80 of file cairo-color.c.

void _cairo_color_init_rgb ( cairo_color_t *  color,
double  red,
double  green,
double  blue 
)

Definition at line 86 of file cairo-color.c.

{
    _cairo_color_init_rgba (color, red, green, blue, 1.0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _cairo_color_init_rgba ( cairo_color_t *  color,
double  red,
double  green,
double  blue,
double  alpha 
)

Definition at line 108 of file cairo-color.c.

{
    color->red   = red;
    color->green = green;
    color->blue  = blue;
    color->alpha = alpha;

    _cairo_color_compute_shorts (color);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _cairo_color_multiply_alpha ( cairo_color_t *  color,
double  alpha 
)

Definition at line 121 of file cairo-color.c.

{
    color->alpha *= alpha;

    _cairo_color_compute_shorts (color);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const cairo_color_t* _cairo_stock_color ( cairo_stock_t  stock)

Definition at line 61 of file cairo-color.c.

{
    switch (stock) {
    case CAIRO_STOCK_WHITE:
       return &cairo_color_white;
    case CAIRO_STOCK_BLACK:
       return &cairo_color_black;
    case CAIRO_STOCK_TRANSPARENT:
       return &cairo_color_transparent;
    }

    ASSERT_NOT_REACHED;

    /* If the user can get here somehow, give a color that indicates a
     * problem. */
    return &cairo_color_magenta;
}

Variable Documentation

cairo_color_t const cairo_color_black [static]
Initial value:
 {
    0.0, 0.0, 0.0, 1.0,
    0x0, 0x0, 0x0, 0xffff
}

Definition at line 45 of file cairo-color.c.

cairo_color_t const cairo_color_magenta [static]
Initial value:
 {
    1.0,    0.0, 1.0,    1.0,
    0xffff, 0x0, 0xffff, 0xffff
}

Definition at line 55 of file cairo-color.c.

cairo_color_t const cairo_color_transparent [static]
Initial value:
 {
    0.0, 0.0, 0.0, 0.0,
    0x0, 0x0, 0x0, 0x0
}

Definition at line 50 of file cairo-color.c.

cairo_color_t const cairo_color_white [static]
Initial value:
 {
    1.0,    1.0,    1.0,    1.0,
    0xffff, 0xffff, 0xffff, 0xffff
}

Definition at line 40 of file cairo-color.c.