[Xr] API questions

Bill Spitzak spitzak at d2.com
Thu Jul 3 18:13:16 PDT 2003

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 

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.

                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com

More information about the cairo mailing list