package camlimages
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b8203da78a9733488e40fafccfafb874c9ebafd8a5f1fa1d9a46ae2ac241e97a
md5=7dd5aa1944d01d2e908d4caa1e1bba78
doc/camlimages.jpeg/Jpeg/index.html
Module JpegSource
1 JPEG markers
1 Basic save/load
Loads a jpeg image.
val load_thumbnail :
string ->
Images.load_option list ->
Geometry.spec ->
int * int * Images.tJPEG image data is composed so that thumbnails of the size 1/2, 1/4 and 1/8 of the original size can be loaded faster. load_thumnail loads an JPEG image with the one of these scales and 1/1 which is nearest and equal to or bigger than the given Gemetry.spec.
Save a full-color image in jpeg format file. Raises Invalid_argument if the image is not a full-color image.
val save_with_markers :
string ->
Images.save_option list ->
Images.t ->
Marker.t list ->
unitSame as save but it also writes markers
val save_as_cmyk :
string ->
Images.save_option list ->
(Images.rgb -> int * int * int * int) ->
Images.t ->
unitSaves RGB24 image as a CMYK32 JPEG image, using the given color conversion function on the fly. More efficient than creating a CMYK24 image and saveing it.
Create CMYK jpeg image sample. Just for developpers.
Scanline based I/O functions
Scanline read handle
open_in path opens a JPEG image path and returns its width, height, a handle to get scanlines, and the JPEG makers.
val open_in_thumbnail :
string ->
Geometry.spec ->
int * int * (int * int * in_handle) * Marker.t listopen_in_thumbnail is the same as open_in but possibly scales down the image size based on the given Geometry.spec int the same way as load_thumbnail.
read_scanline h buf off reads a scanline from the handle and store in bytes at the offset off. (image's width * bytes_per_pixel) bytes are overwritten from off of bytes. No size check of buf is performed.
Scanline write handle
open_out path width height quality opens a JPEG file at path, with width, height and quality. It returns a scanline handle for write.
write_marker h m writes a maker to JPEG. It must be performed before calling write_scanline.
write_scanline h buf writes the contents of buf to the write handle. buf must have enough data for a scanline: (image's width * bytes_per_pixel) bytes of data must be available. No size check is performed.
Close the write handle
Accessing the header information without touching the pixel data
Checks the file header