[poppler] [RFC] Add option to keep alpha channel to Qt frontends

Adam Reichold adam.reichold at t-online.de
Sun Jul 5 01:47:10 PDT 2015


Hello,

Am 04.07.2015 um 02:09 schrieb Adam Reichold:
>> But i guess feeding that to QImage won't be nice since it basically means 
>> reconstructing a XRGB8 buffer with the RGB8 buffer and the alpha channel, is 
>> that right?
> 
> Exactly, you still get the RGB8 and alpah channel buffers from Splash,
> but you really have to convert RGB8 to XBGR8 again to make use of the
> alpha channel so it seems more sensible to render within XBGR8 from the
> beginning if you intend you have an alpha channel available to QImage in
> the end. (As just inserting the alpha channel into XBGR8 images is
> almost as slow as RGB8 rendering, I cannot imagine rendering RGB8 and
> then transfering this into a ARGB32 QImage using the additional alpha
> channel being any faster than rendering XBGR8 in the first place?)

After further testing, I think the case with an intact alpha channel can
be improved further by modifying the alpha channel in-place within
Splash's pipeline instead copying it only afterwards. The additional
writes won't be noticed by the current consumers since they will now
render RGB8 instead of XBGR8. But for consumers who request an intact
alpha channel the attached version of the patch removes the overhead of
the additional bulk copy.

Concerning correctness, I have not yet found an input where the in-place
generated alpha channel was different from what we would have copied
afterwards. Of course, I would still be glad if someone with more
experience with Splash's internals could confirm that I changed all the
necessary format-dependent destination writes. In any case, the effect
this has will be limited to consumers who render XBGR8 and do not supply
a paper colour.

Best regards, Adam.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: splash-no-background-v4.patch
Type: text/x-patch
Size: 42580 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20150705/a60caca9/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20150705/a60caca9/attachment-0001.sig>


More information about the poppler mailing list