[cairo] Implementing PCL's display model using cairo.

Wolfgang Glas wolfgang.glas at ev-i.at
Mon May 9 00:45:01 PDT 2005


Am Sonntag 08 Mai 2005 23:33 schrieb Bill Spitzak:
> Wolfgang Glas wrote:
> >   Basically, I figured out to boil down ROP3 operations into one or two
> > consecutive operations in the form
> >
> > 1) dst = dst OR src
> > 2) dst = dst AND src
> > 3) dst = dst XOR src
> > 4) dst = src
> >
> >   Moreover, I played a bit with the PDF display model, which is claimed
> > to be represented by cairo's display model. In PDF, I could map my 4
> > operations in a suitable way by choosing the following mapping:
> >
> > 1) Lighten
> > 2) Darken
> > 3) Exclusion
> > 4) Normal
>
> I believe the intention is to add the PDF/SVG set of operators to Cairo.
> However, implementation wise, they are all very similar to the Saturate
> one that is there already, so I'm thinking this is low-priority. There
> is also the need to track down exact math for these so there is no
> disagreement with PDF.

Adding PDF/SVG operators would be a very nice feature, that enabled me to 
complete my backend for HPGL/PCL, since I already transformed ROP3 operations 
to simpler operations, as I outlined in my original mail.

IMHO completing the set of perators should be an integral part of the API 
shakeup process, which is currently in progress. Some details of the PDF 
operators are described in Adobe's PDF reference, version 1.6, chapter 7.2.4 
"Blend Modes". You can download the PDF reference from Adobe. Just step to 
http://www.adobe.com and search for "PDF reference".

> Also beware that it is very unlikely that PDF or Cairo is going to
> exactly reproduce your ROP operations. Those sound like bitwise
> operations on the numbers representing the pixels. There is no intention
> whatsoever of having Cairo support that.

That is not my intention, although I came to the conclusion, that cairo could 
easily add the three basic bitwise operations AND, OR, XOR, because at least 
two of them are currently implemented in cairo.

Generally, ROP3 operations are not suitable for modern display models and in 
reality only a very small subset of the 256 ROP3 operations defined by 
microsoft is used. Therefore, I can produce very good results with the four 
PDF operatios I mentioned above.



More information about the cairo mailing list