[cairo] Mesh gradients

Adrian Johnson ajohnson at redneon.com
Thu Aug 27 06:10:22 PDT 2009


I've updated my mesh gradient branch at:

   http://cgit.freedesktop.org/~ajohnson/cairo/log/?h=mesh

I've changed the API for defining the colors to only allow colors to be 
set on the corners of a patch. The API function for setting color is now:

void
cairo_pattern_set_corner_color_rgb (cairo_pattern_t *pattern,
				    double red, double green,
                                     double blue);

instead of cairo_pattern_add_color_stop_rgb(). I've also added the 
getters. The complete API for mesh gradients is now:

cairo_pattern_t *
cairo_pattern_create_mesh (void);

void
cairo_pattern_begin_patch (cairo_pattern_t *pattern);

void
cairo_pattern_end_patch (cairo_pattern_t *pattern);

void
cairo_pattern_curve_to (cairo_pattern_t *pattern,
			double x1,
   			double y1,
   			double x2,
   			double y2,
   			double x3,
   			double y3);

void
cairo_pattern_line_to (cairo_pattern_t *pattern,
   		       double x,
   		       double y);

void
cairo_pattern_move_to (cairo_pattern_t *pattern,
   		       double x,
   		       double y);

void
cairo_pattern_set_corner_color_rgb (cairo_pattern_t *pattern,
				    double red, double green,
                                     double blue);

void
cairo_pattern_set_corner_color_rgba (cairo_pattern_t *pattern,
				     double red, double green,
                                      double blue, double alpha);

void
cairo_pattern_add_control_point (cairo_pattern_t *pattern,
   				 double x,
   				 double y);

cairo_status_t
cairo_pattern_get_patch_count (cairo_pattern_t *pattern,
			       int *count);

cairo_path_t *
cairo_pattern_get_path (cairo_pattern_t *pattern,
			int patch_num);

cairo_status_t
cairo_pattern_get_corner_color_rgba (cairo_pattern_t *pattern,
			       int patch, int corner,
			       double *red, double *green,
			       double *blue, double *alpha);

cairo_status_t
cairo_pattern_get_control_point (cairo_pattern_t *pattern,
				 int patch, int point,
				 double *x, double *y);




More information about the cairo mailing list