[Xr] API questions

Owen Taylor otaylor at redhat.com
Fri Jul 4 08:06:27 PDT 2003

On Thu, 2003-07-03 at 21:13, Bill Spitzak wrote:
> On Thursday 03 July 2003 10:50 am, Keith Packard wrote:
> > Around 10 o'clock on Jul 3, Bill Spitzak wrote:
> > > Even though it sounds primitive, I would really like to see an
> > > 8-bit/color interface added, like XrSetColor32(u32 color). This would
> > > take a number 0xRRGGBBAA to specify the rgba.
> >
> > Many applications use a format something like that, but the precise
> > representation differs and there is disagreement on whether the RGB values
> > should be premultiplied.  Xr sidesteps the whole premultiplied alpha issue
> > by having separate interfaces...
> Yes it is likely that there is not much desire to specify the alpha this way. 
> Perhaps XrSetColor24(u32 color) which takes 0xRRGGBB.
> The main reason for the 32-bit one is not because of the alpha, but because 
> this is how rgb colors are stored in a pixmap that has alpha. It might make 
> sense to ignore the alpha byte (this wont break the application I am thinking 
> of using this for, as it would have had to force the alpha to 0xff every time 
> anyway).

What's the application you are thinking of using this for? I really
don't see where setting the color for a primitive to be a color from a
pixmap is a common operation.

> If there is a call with both color and alpha it should be exactly as though 
> you called XrSetRGBColor() and then XrSetAlpha(). Do whatever that does, 
> there are no premultiplying questions that Xr have not already answered.

That would be "non-premultiplied" and is not compatible with "this is
how rgb colors are stored in a pixmap that has alpha".


More information about the cairo mailing list