[Pixman] pixman transform

Pekka Paalanen ppaalanen at gmail.com
Mon Mar 16 04:42:44 PDT 2015


On Mon, 16 Mar 2015 12:11:28 +0100
Thilo Cestonaro <thilo at cestona.ro> wrote:

> Hey!
> 
> I try to understand how weston's fbdev compositor trys to transform the 
> screen.
> As it uses pixman to do this, I come here to hopefully get some answers 
> :).
> 
> Can someone briefly explain the following functions (what they tend to 
> do and what the parameters mean):
> 
> pixman_transform_init_identity
> pixman_transform_rotate
> pixman_transform_translate
> pixman_image_set_transform
> 
> That would be awesome!

Hi,

a pixman_transform_t is a 3x3 matrix which represents a projective
(much more often an affine) 2d transformation. You can see this in the
Pixman header. Rotate and translate modify the transformation.

Pixman_image_set_transform sets the destination-to-source
transformation in the image, to be used when you use that image as a
source in a composite call.

The transformation is in the opposite direction than what one might
expect, but the rendering code really iterates over the destination
coordinates and transforms those into source coordinates to sample from
the source image.

That's all just an impression I got when working with Weston's
pixman-renderer.

If you look at weston master branch which contains
http://cgit.freedesktop.org/wayland/weston/commit/?id=8870a23fbd6a54d2290d2f5d9c4696e24cec4770
you might have easier time understanding it, I hope.


Thanks,
pq


More information about the Pixman mailing list