[cairo] The right approach to projective transformations

Behdad Esfahbod behdad.esfahbod at gmail.com
Mon Aug 30 15:04:18 PDT 2010


On 08/30/10 17:47, M Joonas Pihlaja wrote:
> 
> On Mon, 30 Aug 2010, Behdad Esfahbod wrote:
> 
>> I think if we are doing this projective thing, we should finally switch to an
>> opaque transformation struct.  This allows for the transformation to be
>> intelligently caching.  Cache the inverse, cache the determinant, cache
>> whether it's an integer translation only, etc.
> 
> I think we can do this without making the existing transform API 
> obsolete.  Factor the complete mapping into two parts: a 2d affine map 
> followed by a more powerful projective map, and the existing transform 
> calls only work on the 2d affine part.  Existing client rendering 
> routines can then pretend they're drawing onto a normal plane as 
> before, even if that plane is twisted about later by a projective 
> part.

Right.  But we should be careful not adding yet another space.
cairo_user_to_device_distance() will suffer no matter what.

behdad

> Joonas
> 


More information about the cairo mailing list