module Graphics.Rendering.Cairo.Internal.Surfaces.PNG where
import Graphics.Rendering.Cairo.Types
import Foreign
import Foreign.C
imageSurfaceCreateFromPNG :: FilePath -> IO Surface
imageSurfaceCreateFromPNG filename =
withCAString filename $ \filenamePtr ->
cairo_image_surface_create_from_png filenamePtr
>>= mkSurface
surfaceWriteToPNG :: Surface -> FilePath -> IO (Status)
surfaceWriteToPNG a1 a2 =
withSurface a1 $ \a1' ->
withCAString a2 $ \a2' ->
surfaceWriteToPNG'_ a1' a2' >>= \res ->
let {res' = cToEnum res} in
return (res')
foreign import ccall unsafe "cairo_image_surface_create_from_png"
cairo_image_surface_create_from_png :: ((Ptr CChar) -> (IO (Ptr Surface)))
foreign import ccall safe "cairo_surface_write_to_png"
surfaceWriteToPNG'_ :: ((Ptr Surface) -> ((Ptr CChar) -> (IO CInt)))