No matching definitions.

png/reader

src/png/reader.tur
defn

png-read

(png-read [path : cstr] :)

read a PNG file from disk into an RGBA image handle.

pathfilesystem path to the PNG file

(Result Img int) -- ok carries the Img handle; err carries 0 on failure (file-open or libpng failure). The image is always converted to 8-bit RGBA (4 channels). Free with img-free when done.

(let [r (png-read "sprite.png")]
    (if (ok? r) (let [img (ok-val r)] ...) (println "read failed")))

Since: PN0

defn

img-free

(img-free [img : Img] :)

free an image handle allocated by png-read.

imgimage handle (ok-val from png-read)

void

(img-free img)

Since: PN0