[poppler] [Poppler-bugs] [Bug 22473]
cloos at jhcloos.com
Fri Jun 26 17:11:19 PDT 2009
>>>>> "Albert" == Albert Astals Cid <aacid at kde.org> writes:
Albert> Well i did it by empirical testing, get the pdf remove the
Albert> /Matte[0 0 0] entry of the object 51 and see how the left "More
Albert> Text Here TBD" in Adobe Acrobat is rendered with the exact same
Albert> color we get in poppler.
My compile is a bit long in the tooth (about 60 days); there must have
been a relevant change in that time; I do not see a difference from
overwriting /Matte [0 0 0] with spaces.
Albert> Yep, looking at the formula for Matte color calculation it seems
Albert> that Matte 0 0 0 should not affect rendering at all, Leonard can
Albert> you shed some light here?
>> The reply was, of course, supposed to go to bugz-d rather than the
>> list. But since it was wrong, I’m not going to correct that....
I meant that I was trying to post a comment to the bug via that email;
the reply-to munging on the poppler-bugs list means that, to do that,
I have to manually edit the To: in the reply. With the last part I
meant that, since I can now see the difference the bug reported saw,
the first paragraph of my reply was incorrect and therefore there was
no point in re-sending the post to bugzilla.....
>> So, to handle Matte, the ref says the SMask’s Width and Height have
>> to match the primary image’s,
Albert> What the spec doesn’t say is what one should do if they are not
Albert> the same :-/
Indeed. The Right Thing To Do, given a pre-multiplied soft mask with
a different pixel-size than the image it applies to, is complicated at
best. (Except, of course, when the main image is an integer×integer
multiple of the mask’s size, where resizing the mask to match the main
image is trivial.)
Incidently, for those reading along, c′ = m + α × (c − m) ımplies that
as α varies ∈ [0,1], c′ varies ∈ [m,c].
So dealing with non-conforming PDF files will be the only difficult part.
>> Should OutputDev::drawSoftMaskedImage() get another arg to pass the
>> Matte array? Or should it be added to the GfxImageColorMap object?
Albert> C++ way is having GfxSoftMaskImageColorMap subclassing
Albert> GfxImageColorMap that adds the Matte entry.
Makes sense. As you might guess, I’ve mostly been hacking in C of late.
James Cloos <cloos at jhcloos.com> OpenPGP: 1024D/ED7DAEA6
More information about the poppler