[cairo] Extending XRender to support non-blurry edges for transformations(?)

Owen Taylor otaylor at redhat.com
Thu Jul 31 08:57:15 PDT 2008

On Thu, 2008-07-31 at 17:47 +0200, Clemens Eisserer wrote:
> Hi Owen,
> >  - You'll get fuzzing out towards the edges of the pixels that are
> >   present in the mask... the same way if you drew a transformed
> >   rectangle and used EXTEND_NONE rather than EXTEND_PAD for the
> >   repeat mode.
> >
> >  - No antialiasing, so it might look OK (except for the fuzzing out
> >   problem mentioned above) for scaling, but isn't going to look
> >   OK for rotation.
> I tried it with rotation, using a 100x scaled 2x2 image as source
> (that why it looks like a gradient) and for me it looks quite good.
> I tried it one time with a nearest filtered mask (no AA) and one time
> with billinear filtering (AA):
> http://picasaweb.google.com/linuxhippy/Transformations/photo#5229203425413416738
> For the demo the scaled source picture is much larger than the drawn
> rectangle, but shouldn't this work once REPEAT_PAD is implemented in
> X?

Well, those screen shots don't look like what you described, I could say
more if you posted code :-)

You should also note, that in the end, with the:

 Draw scaled source image through mask with the shape of the
 transformed source.

You've just reinvented what we were saying all along, except that you
are trying to use a transformed rectangular mask image to get the 
mask shape, rather than just drawing a rectangle using trapezoids.
What you are describing might be easier if you are using RENDER
directly, but is certainly far harder once you have the necessary
infrastructure to draw shapes.

- Owen

More information about the cairo mailing list