<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
><span> I expect little slowdown at least on </span>modern desktop/server hardware and would thereby argue that we should <span>drop the CMYK preprocessor flag.
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>I think that Albert and maybe others have suites of PDF files for regression tests. Would it be possible to compare the runtime the tests with SPLASH_CMYK enabled and disabled?</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>I don't have enough files for a good test, and poppler without SPLASH_CMYK produces incorrect results for many of my files. </span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Regards,</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>William</span></div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> poppler <poppler-bounces@lists.freedesktop.org> on behalf of Adam Reichold <adam.reichold@t-online.de><br>
<b>Sent:</b> Saturday, April 27, 2019 11:57 AM<br>
<b>To:</b> poppler@lists.freedesktop.org<br>
<b>Subject:</b> Re: [poppler] Fwd: splashModeDeviceN8 in two switch</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Hello again,<br>
<br>
I had a moment to take a look at the code and from looking at e.g.<br>
SplashBitmap, it seems that we allocate data always in units of bytes<br>
and only as much as need for the actual format in use. SplashColor<br>
itself is only used to store the value of individual pixels when those<br>
are processed.<br>
<br>
And since both unsigned char[4] as well as unsigned char[4+4] fit into<br>
the registers of 64-bit machines, I expect little slowdown at least on<br>
modern desktop/server hardware and would thereby argue that we should<br>
drop the CMYK preprocessor flag. (If someone needs a Poppler for 32-bit<br>
constrained systems, making it possible to reduce SPOT_NCOMPS to zero<br>
seems like it could yield a similar effect.)<br>
<br>
Best regards,<br>
Adam<br>
<br>
Am 25.04.19 um 17:06 schrieb William Bader:<br>
>> As far as i remember i implemented an overprint option in pdftoppm for this purpose. You can see the difference if you run the ghent test suite with and without this switch.<br>
> <br>
> SPLASH_CMYK affects more than overprint. It also matters in pdftops -level1sep with some PDFs that have features like transparencies that aren't supported in level 1 PS and require rasterizing with splash.<br>
> I can send example PDFs through email or in a poppler issue if anyone wants to see what happens.<br>
> <br>
>> But sizeof(SplashColor) == 8 instead of 4, then allocating SplashColor[size] will consume twice the memory even if we only use the first half of entry, will it not?<br>
> <br>
> I forgot about that. I have found bugs due to code that didn't count SPOT_NCOMPS like
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=90570">https://bugs.freedesktop.org/show_bug.cgi?id=90570</a><br>
> <br>
> If all of the poppler users that need SPLASH_CMYK usually build poppler from source, could you compromise by keeping SPLASH_CMYK turned off by default but enabling it on CI builds?<br>
> <br>
> Is there any way to handle it at run-time using C++ features? Would templates work or would they increase the code size too much?<br>
> <br>
> Regards,<br>
> William<br>
> <br>
> ________________________________<br>
> From: poppler <poppler-bounces@lists.freedesktop.org> on behalf of Adam Reichold <adam.reichold@t-online.de><br>
> Sent: Thursday, April 25, 2019 10:08 AM<br>
> To: poppler@lists.freedesktop.org<br>
> Subject: Re: [poppler] Fwd: splashModeDeviceN8 in two switch<br>
> <br>
> Hello again,<br>
> <br>
> Am 25.04.19 um 07:44 schrieb Thomas Freitag:<br>
>> Sorry, i wanted to send it to the list, too<br>
>><br>
>> ---------- Forwarded message ---------<br>
>> Von:Thomas Freitag <thomas.freitag.bbr@gmail.com><br>
>> Date: Do., 25. Apr. 2019, 07:42<br>
>> Subject: Re: [poppler] splashModeDeviceN8 in two switch<br>
>> To: Albert Astals Cid <aacid@kde.org><br>
>><br>
>><br>
>> Your argument is wrong, Albert.<br>
>> Even if we remove the compiler directive, "noone" will use this mode by<br>
>> default, because the default rendering is RGB. So you don't need more<br>
>> memory for rendering and it doesn't become slower. Just the code need more<br>
>> memory.<br>
> <br>
> But sizeof(SplashColor) == 8 instead of 4, then allocating<br>
> SplashColor[size] will consume twice the memory even if we only use the<br>
> first half of entry, will it not?<br>
> <br>
> Best regards,<br>
> Adam<br>
> <br>
>> But the "professionell" user would have the ability to simulate overprint.<br>
>> As far as i remember i implemented an overprint option in pdftoppm for this<br>
>> purpose. You can see the difference if you run the ghent test suite with<br>
>> and without this switch.<br>
>><br>
>> Cheers,<br>
>> Thomas<br>
>><br>
>> PS: Not only William uses it, i do it too<br>
>><br>
>> Albert Astals Cid <aacid@kde.org> schrieb am Mi., 24. Apr. 2019, 19:40:<br>
>><br>
>>> El dimarts, 23 d’abril de 2019, a les 18:11:04 CEST, Adam Reichold va<br>
>>> escriure:<br>
>>>> Hello,<br>
>>>><br>
>>>> thinking about this again with a bit of distance, should we maybe remove<br>
>>>> the `SPLASH_CMYK` preprocessor flag entirely? I am assuming the reasons<br>
>>>> for having this upstream is to keep the code from bit rotting as<br>
>>>> Poppler's internals change? If nobody builds this, then this will not<br>
>>>> happen. (CI checks improve things, but it will still be "late" feedback<br>
>>>> instead of being part of the initial edit-compile-test cycle. Also, this<br>
>>>> will not reach e.g. clusterfuzz which thereby will not verify that code.)<br>
>>>><br>
>>>> Are there any downsides to removing the conditional compilation? Does<br>
>>>> this break code that does not request the CMYK handling explicitly? If<br>
>>>> so, could we fix this via the internal API instead of hard-coded it at<br>
>>>> compile time?<br>
>>><br>
>>> The main problem i see is that it makes SplashColor for from 4 bytes to 8<br>
>>> bytes, so may make things slower/use more memory for a feature "noone uses".<br>
>>><br>
>>> Cheers,<br>
>>> Albert<br>
>>><br>
>>> P.S: Of course the "noone uses" is a bit of a self fulfilling prophecy if<br>
>>> we don't enable it<br>
>>><br>
>>>><br>
>>>> Best regards,<br>
>>>> Adam<br>
>>>><br>
>>>> Am 22.04.19 um 13:14 schrieb Albert Astals Cid:<br>
>>>>> This is mostly for William since AFAIK he's the "only" one using<br>
>>> SPLASH_CMYK.<br>
>>>>><br>
>>>>> I've tried to enable SPLASH_CMYK on the CI and it's loudly complaining<br>
>>> that the splashModeDeviceN8 cases are missing in SplashOutputDev.cc<br>
>>>>><br>
>>>>> <a href="https://gitlab.freedesktop.org/aacid/poppler/-/jobs/253647">https://gitlab.freedesktop.org/aacid/poppler/-/jobs/253647</a><br>
>>>>><br>
>>>>> Any suggestion of what the code should be?<br>
>>>>><br>
>>>>> Should they just be the same as case splashModeCMYK8: ? The first one<br>
>>> looks like it may make sense, but not so sure about the second.<br>
>>>>><br>
>>>>> Cheers,<br>
>>>>> Albert<br>
>>>>><br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> poppler mailing list<br>
>>>>> poppler@lists.freedesktop.org<br>
>>>>> <a href="https://lists.freedesktop.org/mailman/listinfo/poppler">https://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
>>>>><br>
>>>><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> poppler mailing list<br>
>>> poppler@lists.freedesktop.org<br>
>>> <a href="https://lists.freedesktop.org/mailman/listinfo/poppler">https://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> poppler mailing list<br>
>> poppler@lists.freedesktop.org<br>
>> <a href="https://lists.freedesktop.org/mailman/listinfo/poppler">https://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
>><br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> poppler mailing list<br>
> poppler@lists.freedesktop.org<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/poppler">https://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
> <br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>