[cairo] is self-copy supposed to work?

Jonathan Morton jonathan.morton at movial.com
Thu May 6 03:35:02 PDT 2010

On Thu, 2010-05-06 at 11:42 +1200, Robert O'Callahan wrote:
>         AFAIK there are some plans to support sub-images eventually,
>         and it will make
>         self-copy detection somewhat more tricky.
> We'd just need an internal API to get the true underlying surface,
> right?

I would instead make an internal function to determine if two image
areas (might) physically intersect.  "Might" because the function is
allowed to be pessimistic in ambiguous cases such as transformation.
The destination image and area can be passed in as one side of that
function, and the source and mask would be separately passed into the
other side.

This has the advantage of working correctly on procedural images.
Subimages could be considered a type of procedural image, except that it
is possible to write to them.

One use of procedural images in future might be to implement the
"expression" support, by constructing the expression out of procedural
images which each depend on two other images.  The intersection function
would then work recursively.

This would also deal with the "same image but not intersecting" problem
cleanly, because it takes the affected region into account.  The
"arbitrarily transformed source" problem is then handled by assuming the
source region covers the whole source image if a transform (or repeat?)
is active on it.

From: Jonathan Morton
      jonathan.morton at movial.com

More information about the cairo mailing list