[Cairo] cairo_surfce_set_clip_region

Carl Worth cworth at east.isi.edu
Sun Jul 27 10:41:34 PDT 2003

On Jul 25, Soorya Kuloor wrote:
 > I could not figure out a way to convert from Region to
 > PixRegion. However, if the function cairo_surfce_set_clip_region()
 > takes x, y, width and height as argument rather than the Region, it
 > is possible to convert these to PixRegion.

Yes, this sounds like the right idea. I don't want to actually export
any Region/PixRegion data structure. Instead, I'd like to propose the
following two functions for pixel-aligned clipping on a surface:

	cairo_surface_clip_rectangle (cairo_surface_t *surface,
				      int x, int y,
				      int width, int height);

	cairo_surface_clip_restore (cairo_surface_t *surface);

Those should be sufficient for any purpose and should be quite simple
to implement. As always, any other suggestions are quite welcome.

 > Does this sound OK? Should I go ahead and implement it?

Please feel free to go ahead with this.


Carl Worth                                        
USC Information Sciences Institute                      cworth at isi.edu

More information about the cairo mailing list