|8.4.1. jpeg decompression
This set of functions provides a simple way to decode JPEG images in
memory. It is based on Jean-Luc Saillard's tinyjpegdecoder library which
can be found at:
http://www.saillard.org/programs_and_patches/tinyjpegdecoder . These
functions are useful to decode JPEG streams from memory.
|126.96.36.199. (jpeg-decode buffer image)
decode a JPEG stream in buffer (which
must be an idx1 of ubytes into an RGB image,
image (which must be an idx3 of ubyte). The image is
automatically resized to the size of the JPEG image. If the JPEG image
is grayscale, only the first component is filled.
(let ((buf (ubyte-matrix 1))
(m (ubyte-matrix 1 1 3)))
(read-file-to-idx "myimage.jpg" buf)
(jpeg-decode buf m))
|188.8.131.52. (read-file-to-idx f m)
read the content of a file f into an
idx1 of ubyte m .
m is automatically resized to the proper size. Returns 0 on
success, -1 if the file could not be open.
|184.108.40.206. (jpeg-decode-file f)
return an RGB image (idx1 of ubyte height by width by 3) with the
decoded image in JPEG file f .