[cairo] Problem with stretched images

Bill Spitzak spitzak at d2.com
Tue Sep 5 13:22:08 PDT 2006


I would agree that the proposed solution by Vlad is exactly what is 
wanted. In fact I think the api for the type of pixel replication can 
and should be removed.

Vlad's proposal is equivalent to doing EXTEND_PAD, plus also modifying 
the mask being used by intersecting it with an antialiased rectangle the 
size of the image and transformed by the same transform as the image 
pixels are being transformed. I agree with him that every other 2D api 
that can transform images I have seen has this behavior and that it 
would be a bad idea for cairo to not match it.

The current default behavior of merging with black can be replicated by 
adding a row of black pixels all around the edge to the source image, so 
there is no need to support it with an api.

People are much more interested in tiling, and reflected tiling, than in 
  the EXTEND_PAD behavior. If EXTEND_PAD really is needed it should be 
merged with whatever tiling api there is.

Carl Worth wrote:

> http://lists.freedesktop.org/archives/cairo/2006-August/007673.html
> 
> Meanwhile, in the above message, Vlad proposes changing the model to
> get this behavior by default in order to avoid confusion such as what
> you have hit here. And I think the principle of least surprise makes a
> good argument that direction.


More information about the cairo mailing list