[cairo] Hi all and a couple questions...

Bill Spitzak spitzak at thefoundry.co.uk
Thu Oct 30 12:49:50 PDT 2008

J.A. Magallón wrote:
> Hi to everyone...
> I have just discovered cairo, and it's far far better than plain gdk.
> I use it fot a portable application between Linux and Win, and
> works flawlessly both in Xp and Vista.
> Thanks for the good work!!.
> Everything is working fine, but a thing.
> I can't get a way to paint grayscale images without converting them
> to 24/32 bits.
> I'm writing a little app to do image processing that works with gray
> images from a Bassler camera, and don't want to waste memory converting
> them to RGB. But cairo does not have a plain 'gray image' surface
> type, just an 'alpha channel' type. I have tried with several
> source/fill colors, operators, etc but can't find the right combo.

I also ran into this. Cairo treats an A8 surface as r=g=b=0, a=value 
when it is used as a color. I suggested that instead it treat it as 
r=g=b=a=value. I was worried about back-compatibility, but the response 
was that most people thought it was a good idea and unlikely to break 
anything because the current behavior is useless. So it is possible this 
will change.

I also tried a lot of tricks with compositing operators, but nothing 
ever really worked. I ended up making a temporary rgba image.

Bill Spitzak, Senior Software Engineer
The Foundry, 618 Hampton Drive, Venice, CA, 90291, USA
Tel: +1 310 399-4555 * Fax: +1 310 450-4516 * Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027

More information about the cairo mailing list