[Xr] API questions

Bill Spitzak spitzak at d2.com
Mon Jul 7 12:09:07 PDT 2003


On Friday 04 July 2003 08:06 am, Owen Taylor wrote:

> 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.

No, maybe not, but lots of applications store a color in a 32-bit integer. 
This has the advantage that such data can be stored easily in databases or 
interpreted languages where structures are not possible or too expensive.

Also the Windows RGB(r,g,b), though in theory returing a device-dependent 
result, is known to return 0xRRGGBB and vast amounts of software rely on this.

> > 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".

I agree with this assessment. Perhaps it would be better to just make a call 
that takes an 24-bit rgb color. This would match the windows version and is 
probably the more common pixel format.

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




More information about the cairo mailing list