package imagelib

  1. Overview
  2. Docs
Library implementing parsing of image formats such as PNG, BMP, PPM

Install

dune-project
 Dependency

Authors

Maintainers

Sources

imagelib-20221222.tbz
sha256=050d935711a5a5cead7a6b5e2bce13297a71d0cb47652ca42ff4e328df7118fd
sha512=28dae756945adb1c6a348d5c3e61840af7efb8df16c56bdf09ee4c69231774f169384f822359999ab315cc11634392dc4811ba932479aa1fdb78d25100b6733d

doc/imagelib/Image/index.html

Module ImageSource

Sourcemodule Pixmap : sig ... end
Sourcetype pixmap =
  1. | Grey of Pixmap.t
  2. | GreyA of Pixmap.t * Pixmap.t
  3. | RGB of Pixmap.t * Pixmap.t * Pixmap.t
  4. | RGBA of Pixmap.t * Pixmap.t * Pixmap.t * Pixmap.t
Sourcetype image = {
  1. width : int;
  2. height : int;
  3. max_val : int;
  4. pixels : pixmap;
}
Sourceval create_rgb : ?alpha:bool -> ?max_val:int -> int -> int -> image

create_rgb ?alpha ?max_val width height is an RGB image of dimensions width * height. Raises Invalid_argument if width or height are negative, or if max_val is not in the range [1;65535].

Sourceval create_grey : ?alpha:bool -> ?max_val:int -> int -> int -> image

create_rgb ?alpha ?max_val width height is a greyscale image of dimensions width * height. Raises Invalid_argument if width or height are negative, or if max_val is not in the range [1;65535].

Sourceval read_rgba : image -> int -> int -> (int -> int -> int -> int -> 'a) -> 'a
Sourceval read_rgb : image -> int -> int -> (int -> int -> int -> 'a) -> 'a
Sourceval read_greya : image -> int -> int -> (int -> int -> 'a) -> 'a
Sourceval read_grey : image -> int -> int -> (int -> 'a) -> 'a
Sourceval write_rgba : image -> int -> int -> int -> int -> int -> int -> unit
Sourceval write_rgb : image -> int -> int -> int -> int -> int -> unit
Sourceval write_greya : image -> int -> int -> int -> int -> unit
Sourceval write_grey : image -> int -> int -> int -> unit
Sourceval fill_rgb : ?alpha:int -> image -> int -> int -> int -> unit

fill_rgb ?alpha image r g b overwrites image with r,g,b colors. TODO

Sourceval fill_alpha : image -> int -> unit
Sourceval copy : image -> image

copy image is a copy of image backed my a new memory allocation, so that the mutations of either copy are independent of each other

Sourceval compare_image : image -> image -> int
Sourceexception Corrupted_image of string
Sourcemodule type ReadImage = sig ... end
Sourcemodule type ReadImageStreaming = sig ... end
Sourcemodule type WriteImage = sig ... end
Sourceexception Not_yet_implemented of string
Sourcemodule Resize : sig ... end