[cairo] [PATCH] [API] Support component-alpha.

Soeren Sandmann sandmann at daimi.au.dk
Wed Oct 21 09:22:16 PDT 2009


Chris Wilson <chris at chris-wilson.co.uk> writes:

> Excerpts from Soeren Sandmann's message of Tue Oct 20 16:29:05 +0100 2009:
> > Well, there are two subtly different concepts in play here:
> > 
> > 1. The concept of a 'three times horizontally supersampled image'
> > 
> > 2. The concept of 'values to be presented to an output device'
> > 
> > It seems to me that (1) is the only thing a user can really be
> > expected to provide, because while (2) can be computed from (1), to do
> > a good job of it, you have to know about device characteristics and
> > human vision, then apply appropriate filtering and correction. You
> > also need to control which color space compositing takes place in.
> > 
> > If the component_alpha pattern property uses interpretation (2), then
> > we are effectively asking users to use their understanding of cairo
> > internals to compute something quite non-trivial.
> 
> Hmm, I was approaching this from the "how can I generate sub-pixel
> geometry masks to perform CAIRO_ANTIALIAS_SUBPIXEL with Render". Which
> as you point out requires the knowledge (as provided by Render) of the
> sub-pixel layout. That knowledge can only be sanely handled internally,
> as it is meaningless for the rest of cairo and indeed is out of scope.
> 
> Ok, I'm convinced that the antialias property that we currently expose
> on the context (hence target surface) is the way to go here and that
> exposing per-component alpha is insane.

If some day cairo starts making more use of subpixels, it might make
sense to allow the user to provide oversampled images in the sense of
(1) above. That is, images with three times the normal horizontal
resolution. Internally, cairo could then use this extra resolution to
generate subpixels with the appropriate filtering etc.


Soren


More information about the cairo mailing list