No matching definitions.

png/reader

src/png/reader.tur
defn

png-read

(png-read [path :cstr] :ptr<void>)

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

pathfilesystem path to the PNG file

(ok handle) on success; (err 0) on 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 :int] :void)

free an image handle allocated by png-read.

imgimage handle (ok-val from png-read)

void

(img-free img)

Since: PN0

Internal definitions
__ok-- create an ok result wrapping integer value v.
__err-- create an err result wrapping integer error value e.