[cairo-commit] cairo-demo/cairo_snippets arc.cairo, NONE, 1.1 operator_add.cairo, 1.1, 1.2 operator_atop.cairo, 1.1, 1.2 operator_atop_reverse.cairo, 1.1, 1.2 operator_in.cairo, 1.1, 1.2 operator_in_reverse.cairo, 1.1, 1.2 operator_out.cairo, 1.1, 1.2 operator_out_reverse.cairo, 1.1, 1.2 operator_over.cairo, 1.1, 1.2 operator_over_reverse.cairo, 1.1, 1.2 operator_saturate.cairo, 1.1, 1.2 operator_xor.cairo, 1.1, 1.2 prepare_snippets.c, 1.2, 1.3 snippets.h, 1.2, 1.3

OEyvind Kolaas commit at pdx.freedesktop.org
Thu May 20 06:17:22 PDT 2004


Committed by: pippin

Update of /cvs/cairo/cairo-demo/cairo_snippets
In directory pdx:/tmp/cvs-serv31413

Modified Files:
	operator_add.cairo operator_atop.cairo 
	operator_atop_reverse.cairo operator_in.cairo 
	operator_in_reverse.cairo operator_out.cairo 
	operator_out_reverse.cairo operator_over.cairo 
	operator_over_reverse.cairo operator_saturate.cairo 
	operator_xor.cairo prepare_snippets.c snippets.h 
Added Files:
	arc.cairo 
Log Message:
added visual explaination for the parameters of the cairo_arc function


--- NEW FILE: arc.cairo ---
double xc = 0.5;
double yc = 0.5;
double radius = 0.4;
double angle1 = 45.0  * (M_PI/180.0);  /* angles are specified */
double angle2 = 180.0 * (M_PI/180.0);  /* in radians           */

cairo_arc (cr, xc, yc, 0.1, 0, 2*M_PI);
cairo_fill (cr);

cairo_arc (cr, xc, yc, radius, angle1, angle2);

cairo_stroke (cr);

Index: operator_add.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_add.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_add.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_add.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_ADD);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_ADD);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_atop.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_atop.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_atop.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_atop.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_ATOP);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_ATOP);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_atop_reverse.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_atop_reverse.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_atop_reverse.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_atop_reverse.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_ATOP_REVERSE);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_ATOP_REVERSE);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_in.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_in.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_in.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_in.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_IN);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_IN);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_in_reverse.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_in_reverse.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_in_reverse.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_in_reverse.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_IN_REVERSE);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_IN_REVERSE);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_out.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_out.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_out.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_out.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_OUT);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_OUT);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_out_reverse.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_out_reverse.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_out_reverse.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_out_reverse.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_OUT_REVERSE);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_OUT_REVERSE);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_over.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_over.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_over.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_over.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_over_reverse.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_over_reverse.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_over_reverse.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_over_reverse.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_OVER_REVERSE);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_OVER_REVERSE);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_saturate.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_saturate.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_saturate.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_saturate.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_SATURATE);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_SATURATE);
  cairo_set_rgb_color (cr, 1,0,0);

Index: operator_xor.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/operator_xor.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/operator_xor.cairo	19 May 2004 18:11:24 -0000	1.1
--- b/operator_xor.cairo	20 May 2004 13:17:20 -0000	1.2
***************
*** 1,3 ****
! snippet_set_bg_png (cr, "data/romedalen.png");
  cairo_set_operator (cr, CAIRO_OPERATOR_XOR);
  cairo_set_rgb_color (cr, 1,0,0);
--- 1,3 ----
! snippet_set_bg_svg (cr, "data/freedesktop.svg");
  cairo_set_operator (cr, CAIRO_OPERATOR_XOR);
  cairo_set_rgb_color (cr, 1,0,0);

Index: prepare_snippets.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/prepare_snippets.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/prepare_snippets.c	19 May 2004 18:11:24 -0000	1.2
--- b/prepare_snippets.c	20 May 2004 13:17:20 -0000	1.3
***************
*** 148,154 ****
  );
  
! }
! 
  
  
  int
--- 148,169 ----
  );
  
!     fprintf (out,
! "void\n"
! "snippet_set_bg_svg (cairo_t *cr, const char *file)\n"
! "{\n"
! "   int width,height;\n"
! "   svg_cairo_t *svgc;\n"
! "   svg_cairo_create (&svgc);\n"
! "   svg_cairo_parse (svgc, file);\n"
! "   svg_cairo_get_size (svgc, &width, &height);\n"
! "   cairo_save (cr);\n"
! "     cairo_scale (cr, 1.0/width, 1.0/height);\n"
! "     svg_cairo_render (svgc, cr);\n"
! "   cairo_restore (cr);\n"
! "   svg_cairo_destroy (svgc);\n"
! "}\n"
! );
  
+ }
  
  int

Index: snippets.h
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/snippets.h	19 May 2004 18:11:24 -0000	1.2
--- b/snippets.h	20 May 2004 13:17:20 -0000	1.3
***************
*** 33,35 ****
--- 33,38 ----
  snippet_set_bg_png (cairo_t *cr, const char *file);
  
+ void
+ snippet_set_bg_svg (cairo_t *cr, const char *file);
+ 
  #endif /* SNIPPETS_H */





More information about the cairo-commit mailing list