package mm

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Image.RGBA32Source

Operations on images stored in RGBA32 format (ie RGB channels + an alpha channel, one byte for each).

Sourcemodule Color : sig ... end
Sourcetype t

An image.

Sourceval width : t -> int
Sourceval height : t -> int
Sourceval dimensions : t -> int * int
Sourceval data : t -> data
Sourceval size : t -> int
Sourceval stride : t -> int
Sourceval create : int -> int -> t
Sourceval make : ?stride:int -> int -> int -> data -> t
Sourceval get_pixel : t -> int -> int -> Color.t
Sourceval set_pixel : t -> int -> int -> Color.t -> unit
Sourceval get_pixel_rgba : t -> int -> int -> Pixel.rgba
Sourceval set_pixel_rgba : t -> int -> int -> Pixel.rgba -> unit
Sourceval copy : t -> t
Sourceval blit : ?blank:bool -> ?x:int -> ?y:int -> ?w:int -> ?h:int -> t -> t -> unit
Sourceval blit_all : t -> t -> unit

blit_all src dst copies all the contents of src into dst.

Conversions from/to other formats

Sourceval of_RGB24_string : string -> int -> t
Sourceval to_RGB24_string : t -> string
Sourceval of_BGRA : BGRA.t -> t
Sourceval to_BGRA : t -> BGRA.t
Sourceval to_int_image : t -> int array array
Sourceval to_BMP : t -> string
Sourceval of_PPM : ?alpha:RGB8.Color.t -> string -> t
Sourceval swap_rb : t -> unit

Swap red and blue channels. Useful for quickly handling BGRA formats.

Manipulation of images

Sourceval add : ?x:int -> ?y:int -> ?w:int -> ?h:int -> t -> t -> unit
Sourceval fill_all : t -> Color.t -> unit
Sourceval blank_all : t -> unit
Sourceval fill_alpha : t -> int -> unit
Sourceval blank : t -> unit
Sourceval randomize_all : t -> unit
Sourceval randomize : t -> unit
Sourceval scale : ?proportional:bool -> t -> t -> unit

scale src dst scales the image src to dst.

Sourcemodule Scale : sig ... end
Sourcemodule Effect : sig ... end
Sourcemodule Draw : sig ... end
Sourcemodule Motion : sig ... end
OCaml

Innovation. Community. Security.