[cairo] defining CLAMP extend mode

Vladimir Vukicevic vladimir at pobox.com
Mon Oct 23 18:42:26 PDT 2006


On 10/23/06, Bill Spitzak <spitzak at d2.com> wrote:
> Owen Taylor wrote:
>
> > I think there is general consensus about the desired effect - just
> > disagreement about the right API for getting there
> >
> >  Vladimir: This is a new sampling mode. (A sampling mode that is
> >    quite different in implementation than any of the existing modes
> >    .. it doesn't just affect the final point sample from the source
> >    image but extends up the pipeline...)
> >
> >  Me: We should simply provide EXTEND_PAD, and then leave it up to the
> >    application to draw the correct output shape
>
> My proposal is:
>
> Replace EXTEND_NONE and the default mode with the EXTEND_PAD result
> mulitiplied by a transformed rectangle of the source image. Switching
> between EXTEND_NONE and EXTEND_PAD just turns this rectangle
> multiplication on/off.

I'm completely fine with EXTEND_PAD -- EXTEND_CLAMP was just me going
through and thinking it might be easier to implement, but now that I
actually spent time looking at the code, they're basically identical
indifficulty.  So; I'd be happy with having an implementation of PAD
(even if the default didn't change -- PAD behaviour should be
identical to NONE given a fully transparent border).  No matter what,
though, we still need the implementation of PAD -- and the code in
pixman scared me.

    - Vlad


More information about the cairo mailing list