Module Cairo.PNG

module PNG: sig .. end
The PNG functions allow reading PNG images into image surfaces, and writing any surface to a PNG file.

val create : string -> Cairo.Surface.t
create filename creates a new image surface and initializes the contents to the given PNG file.
val create_from_stream : input:(string -> int -> unit) -> Cairo.Surface.t
Creates a new image surface from PNG data read incrementally via the input function. The input s l function receives a string s whose first l bytes must be filled with PNG data. Any exception raised by input is considered as a read error.
val write : Cairo.Surface.t -> string -> unit
write surface filename writes the contents of surface to a new file filename as a PNG image.
val write_to_stream : Cairo.Surface.t -> output:(string -> unit) -> unit
Writes the image surface using the output function.