[poppler] [patch] using external data in SplashBitmap
vtorri at univ-evry.fr
Mon Oct 25 07:29:44 PDT 2010
On Mon, 25 Oct 2010, Albert Astals Cid wrote:
> A Dilluns, 25 d'octubre de 2010, Vincent Torri va escriure:
>> On Mon, 25 Oct 2010, Albert Astals Cid wrote:
>>> A Dilluns, 25 d'octubre de 2010, Vincent Torri va escriure:
>>>> I have written a small patch for setting external data to the
>>>> SplashBitmap class.
>>> What's the use case for this?
>> I have a lib that uses objects to display a BGRA data. Those objects own
>> that data. Currently, i get the pppler data, my object data, i do a memcpy
>> and set my data. With the patch, no need for the memcpy : i pass my data
>> to the splash bitmap and poppler fill it with the pdf page content. At
>> least, it's what i understood from the code. I hope I'm not wrong.
> I'm totally lost here, you mean you want to use your data as "background" for
> poppler to draw over it?
>>>> * what about alpha ? Afaics, it's just allocated memory with
>>>> a getter, that's all.
>>> Well, it holds the alpha information, i understand you probably want to
>>> set it too.
>> ok. Not sure what to do if my external data already holds alpha channel,
>> like in BGRA, ARGB etc... formats
> I don't see that as supported in SplashColorMode, so if my guess is right that
> you want to use your initial data as "background", painting will fail if the
> data is not in the correct SplashColorMode
Indeed. That's up to the user to know what it does if he provide his own
data. That must be mentioned in the doc.
More information about the poppler