[poppler] Image optimization
krh at bitplanet.net
Sat May 21 15:13:31 PDT 2005
On Thu, 2005-05-19 at 22:47 +0200, Albert Astals Cid wrote:
> Georgeous, can this be applied to the splash outputdev too?
Not easily. The splash image rendering code is structured quite
differently from the cairo image rendering code. As with most other
code in xpdf, the splash image rendering code is written in a streaming
fashion, in that it renders the image by reading one pixel at a time and
composites that onto the target buffer. The idea is, I assume, that it
doesn't have to load the entire image in memory to render it
(Splash::drawImage() in splash/Splash.cc is an interesting read -
scaling and rotating an image directly from disk to target buffer).
The upshot of this is that the splash API for drawing an image takes a
callback function returning a SplashColor for the image source whereas
cairo expects a cairo_surface_t. It's pretty easy to convert a line at
a time when creating the image data for the cairo surface, but it
doesn't really fit the callback nature of the splash image rendering.
More information about the poppler