NAME

Image::PNG::Cairo - extract PNG data from a Cairo::ImageSurface

SYNOPSIS

use Image::PNG::Cairo 'cairo_to_png';
use Cairo;
my $surface = Cairo::ImageSurface->new ('argb32', 100, 100);
# Draw something on surface.
my $png = cairo_to_png ($surface);
# Now can use the methods of Image::PNG::Libpng on the PNG,
# e.g. write to file.

DESCRIPTION

This is a bridge between Cairo and Image::PNG::Libpng which allows the user to extract the image data from a Cairo::ImageSurface into a structure which can then be manipulated to add other kinds of data.

FUNCTIONS

cairo_to_png

my $png = cairo_to_png ($surface);

Only surfaces of type 'argb32' are supported.

LICENCE, COPYRIGHT, AUTHOR

Copyright Ben Bullock <bkb@cpan.org> 2014; this module may be used, redistributed, and modified under the same terms as Perl itself.