pdf: combine source and mask images into single image

Graphics / Cairo - Adrian Johnson [redneon.com] - 28 September 2013 22:38 UTC

Since PDF stores the alpha component of images in a separate stream which can have a different resolution and encoding to the color components we can optimize the case where the source and mask are both images.

If the source and mask are both images with the same extents and the source is opaque, combine the images into a single PDF image (ie the source is written the the image stream and the mask is written to the smask stream).

07940ec pdf: combine source and mask images into single image
src/cairo-pdf-surface-private.h | 2 +
src/cairo-pdf-surface.c | 466 +++++++++++++++++++++++++++++----------
2 files changed, 347 insertions(+), 121 deletions(-)

Upstream: cgit.freedesktop.org


  • Share