[cairo] another pixman issue

Robert O'Callahan robert at ocallahan.org
Mon Mar 24 17:24:10 PDT 2008


On 24 Mar 2008 15:04:13 +0100, Soeren Sandmann <sandmann at daimi.au.dk> wrote:

> A pixman image is an array of pixels, where the top left pixel has
> coordinates (0.5, 0.5). But the scaling actually has (0, 0) as the
> center and not (0.5, 0.5).
>
> In your test case, the top left destination pixel with coordinates
> (0.5, 0.5) gets transformed into (0.25, 0.25). The bilinear filter
> then finds the four closest pixels to those coordinates:
>
>   (-0.5, -0.5), (0.5, -0.5), (-0.5, 0.5) and (0.5, 0.5).
>
> Three of these are outside the source image, so they are treated as
> transparent. The last one is opaque white, so the result of the
> resampling is a translucent gray.
>

Right, thanks.

My intuition was that we should sample only the pixels that intersect the
scaled-down target pixel, i.e. the rectangle (0,0)-(0.5,0.5). I guess
there's probably a reason we don't do it that way, so OK.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20080325/b2026dd8/attachment.html 


More information about the cairo mailing list