chickadee » leptonic » pix-read-header

pix-read-headerprocedure
  • in - FILENAME: string
  • in - PFMT PW PH PBPS PSPP PISCMAP: ptr to unsigned-int32
    • Other args are optional, pass #f to skip.
    • Optionals: image-format, width, height, bits/sample, samples/pixel, has-colormap?(0=no/1=yes).
    • ("Sample" equiv to "channel", re: bits/channel, channels/pixel.)
(import leptonic)
(define-external fmt unsigned-int32)
(define-external w unsigned-int32)
(define-external h unsigned-int32)
(define-external bps unsigned-int32)
(define-external spp unsigned-int32)
(define-external cmap unsigned-int32)
(pix-read-header "img1.jpg" (location fmt) (location w)
                            (location h) (location bps)
                            (location spp) (location cmap))
;; fmt -> 2, w -> 898, h -> 606, bps -> 8, spp -> 3, cmap -> 0
;; image is 24bpp (bps * spp)