package camlimages
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=1c9a68bdc3d348c9f859d490dadf384926213e47a584159832f7fc4a20242865
md5=1ddba74d210b86a899b5d6565f45c2dc
doc/camlimages.core/Images/index.html
Module Images
Source
The image data structure definition.
Exception for illegal point access
Exception for illegal internal image type
Exception for unsupported image FILE format
Colors: the copies of color.mli
Image formats
Functions for filename extensions
returns the corresponding extension "gif", "bmp" etc. for given format
returns the image format guessed from the file extension of a given file name
Lower interface
type info = Info.info =
| Info_DPI of float
(*dot per inch
*)| Info_BigEndian
| Info_LittleEndian
(*endianness of image file
*)| Info_ColorModel of colormodel
(*color model of image file
*)| Info_Depth of int
(*Image bit depth
*)| Info_Corrupted
(*For corrupted PNG files
*)
Infos attached to bitmaps
Image file header
file_format filename
reads the header of image file filename
and returns its format and some useful information found in the header (ex. width, height). file_format
does not read image contents, but just quickly returns file header information.
file_format
does not depend on any external libraries
Load options
Save options
Option queries
type format_methods = {
check_header : string -> header;
load : (string -> load_option list -> t) option;
save : (string -> save_option list -> t -> unit) option;
load_sequence : (string -> load_option list -> sequence) option;
save_sequence : (string -> save_option list -> sequence -> unit) option;
}
If you write new drivers for some image format, use this function to register their loading/saving functions into the libaray
load filename options
read the header of an image file filename
, loads the image by calling corresponding loading method, and returns it. If the file format is not supported by the library, a Wrong_file_type exception will be raised. You can specify loading options in options
such as progressive meter function.
save filename formatopt options image
saves image
into a file filename
. The image format can be specified by formatopt
. If formatopt
is Some format
, then format
is used. If it is None
, then the image format is guessed from filename
. You can specify some saving parameters options
. Some options are specific to some image formats and do not work with the others.
Free the image. If you turn on image swapping (see bitmap.mli), you can call this function explicitly to tell the library that this image is no longer used. (This is not required, though.)
sub dst x y width height
returns sub-bitmap of dst
, at (x, y) - (x + width - 1, y + height - 1).
blit src sx sy dst dx dy width height
copies the rectangle region of src
at (sx, sy) - (sx + width - 1, sy + height - 1) to dst
, at (dx, dy) - (dx + width - 1, dy + height - 1).