[poppler] [patch] using external data in SplashBitmap

Albert Astals Cid aacid at kde.org
Mon Oct 25 06:51:08 PDT 2010


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:
> >> Hey,
> > 
> > Hi
> > 
> >> 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?

> 
> >> It's not finished yet as i have some questions (and doc is not
> >> 
> >> added):
> >>   * is the coding style good ?
> > 
> > Seems Ok
> > 
> >>   * i don't think I break ABI.
> > 
> > You break the Splash abi, but we don't care about it.
> 
> well, i added the isDataExternal at the end of the class. I thought that,
> doing like that, i didn't break ABI. I broke API but the current uses are
> not broken.

The class got "bigger", so yes, ABI is broken.

> 
> >>   * 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

> 
> >>   * I don't know what to do if topDown is true.
> > 
> > Probably the same as if it is false.
> 
> You mean : nothing ? :)

Yep.

Albert

> 
> thank you
> 
> Vincent Torri
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler


More information about the poppler mailing list