[Cairo] How do I get the CTM?

Carl Worth cworth at east.isi.edu
Wed Sep 3 06:42:29 PDT 2003


On Sep 3, Banlu Kemiyatorn wrote:
 > What is the best way to get the ctm?

Today[*], one would use:

	void
	cairo_get_matrix (cairo_t *cr,
        		  double *a, double *b,
			  double *c, double *d,
			  double *tx, double *ty);

 > Or will it work/good if I include cairoint.h and
 > try to get it via cairo->gstate->ctm?

That would be bad. Nothing but Cairo itself should include
cairoint.h. That file contains implementation details that are not
guaranteed to remain the same from one release to the next.

-Carl

[*] PS. Just a heads-up so you know where things are going:

There are two changes needed in this API. First, it should accept a
cairo_matrix_t* rather than six double*, (it appears I missed this
function when I added the cairo_matrix_t type). Also, all of the
cairo_get_* functions will be renamed to cairo_current_* sometime
soon. So this function will eventually be:

	void
	cairo_current_matrix (cairo_t *cr,
			      cairo_matrix_t *matrix);




More information about the cairo mailing list