[poppler] [RFC] Add option to keep alpha channel to Qt frontends
Albert Astals Cid
aacid at kde.org
Tue Jul 7 14:10:44 PDT 2015
El Diumenge, 5 de juliol de 2015, a les 10:47:10, Adam Reichold va escriure:
> 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.
KeepAlphaChannel = 0x00000080
///< Do not compose with the paper color \since 0.34
Does this really have anything to do with not compositing the paper color? I'd
say the paper color is still very much taken into account, it's just that the
alpha is not always opaque if you pass that option, no?
Also the last commit makes me a bit scared to be honest, is very easy to make
a mistake in one of those things, I'll put it in my todo but as you know it's
long, would appreciate if someone else reviewed/regtested it.
Cheers,
Albert
>
> Best regards, Adam.
More information about the poppler
mailing list