[poppler] Adding a new getRGBLine variant

Albert Astals Cid aacid at kde.org
Sun Feb 27 04:05:04 PST 2011


In GfxColorSpace we have

virtual void getRGBLine(Guchar *in, unsigned int *out, int length);

That gets a color line for the given input and saves it in out as a 32 bit 
integer with each color packed to fit in 8 bits of that 32.

This works very well for cairo as it can pass a pointer to the cairo image 
data directly but for Splash is not so good as we have to unpack the 32 bit 
integer to 3 (or 4 if XRGB8 format) different Guchar.

So i'm proposing the addition of 
virtual void getRGBLine(Guchar *in, Guchar *out, int length);
that does basically the same but instead of packing the color just saves it in 
output directly.

In my tests this gives us around a 5% free speedup.

The catch is that in some cases we need to "duplicate" the conversion code 
since it is not really easy to generalize the code.

I'm attaching a work-in-progress patch.

Comments?

Albert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QQQ
Type: text/x-patch
Size: 10567 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20110227/8fe454ce/attachment-0001.bin>


More information about the poppler mailing list