Defines | Functions

go-cairo.c File Reference

#include <goffice/utils/go-cairo.h>
#include <math.h>

Defines

#define MULT(d, c, a, t)   G_STMT_START { t = c * a + 0x7f; d = ((t >> 8) + t) >> 8; } G_STMT_END
#define MULT(d, c, a, t)   G_STMT_START { t = (a)? c * 255 / a: 0; d = t;} G_STMT_END

Functions

static void skip_spaces (char **path)
static void skip_comma_and_spaces (char **path)
static gboolean parse_value (char **path, double *x)
static gboolean parse_values (char **path, unsigned int n_values, double *values)
static void emit_function_2 (char **path, cairo_t *cr, void(*cairo_func)(cairo_t *, double, double))
static void emit_function_6 (char **path, cairo_t *cr, void(*cairo_func)(cairo_t *, double, double, double, double, double, double))
void go_cairo_emit_svg_path (cairo_t *cr, char const *path)
 go_cairo_emit_svg_path: : a cairo context : a SVG path
gboolean go_cairo_surface_is_vector (cairo_surface_t const *surface)
void go_cairo_convert_data_from_pixbuf (unsigned char *dst, unsigned char const *src, int width, int height, int rowstride)
 go_cairo_convert_data_from_pixbuf: : a pointer to pixel data in pixbuf format : a pointer to pixel data in cairo format : image width : image height : data rowstride
void go_cairo_convert_data_to_pixbuf (unsigned char *dst, unsigned char const *src, int width, int height, int rowstride)
 go_cairo_convert_data_to_pixbuf: : a pointer to pixel data in cairo format : a pointer to pixel data in pixbuf format : image width : image height : data rowstride

Define Documentation

#define MULT (   d,
  c,
  a,
  t 
)    G_STMT_START { t = c * a + 0x7f; d = ((t >> 8) + t) >> 8; } G_STMT_END
#define MULT (   d,
  c,
  a,
  t 
)    G_STMT_START { t = (a)? c * 255 / a: 0; d = t;} G_STMT_END

Function Documentation

static void emit_function_2 ( char **  path,
cairo_t *  cr,
void(*)(cairo_t *, double, double)  cairo_func 
) [static]

References parse_values(), and skip_spaces().

Referenced by go_cairo_emit_svg_path().

static void emit_function_6 ( char **  path,
cairo_t *  cr,
void(*)(cairo_t *, double, double, double, double, double, double)  cairo_func 
) [static]

References parse_values(), and skip_spaces().

Referenced by go_cairo_emit_svg_path().

void go_cairo_convert_data_from_pixbuf ( unsigned char *  dst,
unsigned char const *  src,
int  width,
int  height,
int  rowstride 
)

go_cairo_convert_data_from_pixbuf: : a pointer to pixel data in pixbuf format : a pointer to pixel data in cairo format : image width : image height : data rowstride

Converts the pixel data stored in in GDK_COLORSPACE_RGB pixbuf format to CAIRO_FORMAT_ARGB32 cairo format and move them to . If == , pixel are converted in place.

References MULT.

Referenced by pixbuf_to_cairo().

void go_cairo_convert_data_to_pixbuf ( unsigned char *  dst,
unsigned char const *  src,
int  width,
int  height,
int  rowstride 
)

go_cairo_convert_data_to_pixbuf: : a pointer to pixel data in cairo format : a pointer to pixel data in pixbuf format : image width : image height : data rowstride

Converts the pixel data stored in in CAIRO_FORMAT_ARGB32 cairo format to GDK_COLORSPACE_RGB pixbuf format and move them to . If == , pixel are converted in place.

References MULT.

void go_cairo_emit_svg_path ( cairo_t *  cr,
char const *  path 
)

go_cairo_emit_svg_path: : a cairo context : a SVG path

Emits a path described as a SVG path string (d property of path elements) to a cairo context.

References emit_function_2(), emit_function_6(), and skip_spaces().

gboolean go_cairo_surface_is_vector ( cairo_surface_t const *  surface  ) 

References type.

static gboolean parse_value ( char **  path,
double *  x 
) [static]

Referenced by parse_values().

static gboolean parse_values ( char **  path,
unsigned int  n_values,
double *  values 
) [static]
static void skip_comma_and_spaces ( char **  path  )  [static]

Referenced by parse_values().

static void skip_spaces ( char **  path  )  [static]