No matching definitions.

png/info

src/png/info.tur
defn

img-width

(img-width [img :int] :int)

return the width of an image in pixels.

imgimage handle (ok-val from png-read)

Image width as :int.

(println (img-width img))

Since: PN0

defn

img-height

(img-height [img :int] :int)

return the height of an image in pixels.

imgimage handle (ok-val from png-read)

Image height as :int.

(println (img-height img))

Since: PN0

defn

img-channels

(img-channels [img :int] :int)

return the number of channels in an image.

imgimage handle (ok-val from png-read)

Channel count as :int; always 4 (RGBA) for images loaded by png-read.

(println (img-channels img))

Since: PN0

defn

img-bit-depth

(img-bit-depth [img :int] :int)

return the bit depth per channel of an image.

imgimage handle (ok-val from png-read)

Bit depth as :int; always 8 for images loaded by png-read.

(println (img-bit-depth img))

Since: PN0

defn

img-pixels

(img-pixels [img :int] :cstr)

return a raw pointer to the image pixel buffer as :cstr.

imgimage handle (ok-val from png-read)

Pointer to the pixel buffer as :cstr (row-major interleaved RGBA bytes).

(let [buf (img-pixels img)] ...)

Since: PN0

defn

pixel-r

(pixel-r [img :int x :int y :int] :int)

read the red channel of the pixel at (x, y).

imgimage handle (ok-val from png-read)
xcolumn index (0-based)
yrow index (0-based)

Red channel value in [0, 255] as :int.

(println (pixel-r img 0 0))

Since: PN0

defn

pixel-g

(pixel-g [img :int x :int y :int] :int)

read the green channel of the pixel at (x, y).

imgimage handle (ok-val from png-read)
xcolumn index (0-based)
yrow index (0-based)

Green channel value in [0, 255] as :int.

(println (pixel-g img 0 0))

Since: PN0

defn

pixel-b

(pixel-b [img :int x :int y :int] :int)

read the blue channel of the pixel at (x, y).

imgimage handle (ok-val from png-read)
xcolumn index (0-based)
yrow index (0-based)

Blue channel value in [0, 255] as :int.

(println (pixel-b img 0 0))

Since: PN0

defn

pixel-a

(pixel-a [img :int x :int y :int] :int)

read the alpha channel of the pixel at (x, y).

imgimage handle (ok-val from png-read)
xcolumn index (0-based)
yrow index (0-based)

Alpha channel value in [0, 255] as :int; 255 if the image has fewer than 4 channels.

(println (pixel-a img 0 0))

Since: PN0

defn

pixel-set!

(pixel-set! [img :int x :int y :int r :int g :int b :int a :int] :void)

write RGBA bytes to the pixel at (x, y).

imgimage handle (ok-val from png-read)
xcolumn index (0-based)
yrow index (0-based)
rred value in [0, 255]
ggreen value in [0, 255]
bblue value in [0, 255]
aalpha value in [0, 255]

void

(pixel-set! img 0 0 255 0 0 255)

Since: PN0