[poppler] [PATCH] Improve getRGBLine and getGrayLine in ImageColorMap

Carlos Garcia Campos carlosgc at gnome.org
Sun Jul 19 12:03:06 PDT 2009


Hi all, 

looking at bug #11027 (getRGBLine based color space conversion can use
bad tables) I realized that the byte_lookup table used for getLine
methods in ImageColorMap was broken for some color spaces (Lab color
space in the document attached to the bug report). I tried to fix the
byte_lookup table, but I noticed that for some color spaces, like Lab,
that don't implement getLine methods, getRGB / getGray, etc. are called
for every pixel anyway even when getRGBLine or getGrayLine is used. For
those cases we can just avoid allocating byte_lookup table, convert
color values, and so on, and just directly call getRGB, getGray, etc.
See attached patches. It fixes the problem for backends using getLine
methods (cairo and Arthur I think)

ok to commit? 

-- 
Carlos Garcia Campos
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Remove-unused-variable.patch
Type: text/x-patch
Size: 725 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090719/37a5a129/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Don-t-use-byte_lookup-table-when-color-space-doesn-t.patch
Type: text/x-patch
Size: 10386 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090719/37a5a129/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Copy-byte_lookup-in-copy-constructor.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090719/37a5a129/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
 digitalmente
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090719/37a5a129/attachment.pgp 


More information about the poppler mailing list