package mm

  1. Overview
  2. Docs
The mm library contains high-level APIs to create and manipulate multimedia streams (audio, video, MIDI)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.8.7.tar.gz
md5=a66de09d471855011ca42c7c9c267ef6
sha512=23ad187d851c6c73cc59b03aaf9856791985c17b0bfa14b3ffb4dd749ba10cadaaf28e353059eaba60a02813c4880053f9f2b483747b568f76c2524a4456592e

doc/mm.image/Mm_image/Image/Canvas/index.html

Module Image.CanvasSource

Canvas of images, i.e. formal sums of images of various dimensions with various offsets.

Parameters

module I : CanvasImage

Signature

Sourcetype t

A canvas.

Sourceval create : int -> int -> t

Create an empty canvas.

Sourceval make : ?width:int -> ?height:int -> ?x:int -> ?y:int -> I.t -> t

Create a canvas containing a given image. Negative dimensions are ignored, default ones are those of the image.

Sourceval width : t -> int

Width of the image.

Sourceval height : t -> int

Height of the image.

Sourceval viewport : ?x:int -> ?y:int -> int -> int -> t -> t

Change the width and height of the viewport of the canvas.

Sourceval size : t -> int

Size of a canvas in bytes.

Sourceval planes : t -> int

Number of planes in the image.

Sourceval add : t -> t -> t

Add two canvas. The first one is on top of the second one.

Sourceval covering : t -> bool

Whether the canvas covers the whole area with images (this function is imprecise: it might have false negatives).

Sourceval has_alpha : t -> bool

Whether the canvas has an alpha channel (i.e. it does not fully cover its viewport, or any of its elements has alpha).

Sourceval render : ?fresh:bool -> ?transparent:bool -> t -> I.t

Render the canvas as an image. If fresh is set to true, the resulting can be modified in place. If transparent is set to true, the non-covered portions are made transparent.

Sourceval rendered : ?transparent:bool -> t -> t

Rendered canvas.

Sourceval map : (I.t -> I.t) -> t -> t

Map a function on the underlying image. This of course triggers a render of the canvas.

Sourceval iter : (I.t -> unit) -> t -> t

Execute a function on the rendering of the canvas.

Sourceval translate : int -> int -> t -> t

Translate the image.

Sourceval bounding_box : t -> (int * int) * (int * int)

Bounding box (smallest box enclosing all images contained in the canavs): returns the lower-left corner and the dimensions.

Sourceval scale : ?scaler:(I.t -> I.t -> unit) -> Fraction.t -> Fraction.t -> t -> t

Scale the image proportionally by fractional coefficients with given numerator and denominator in the x and y directions. The viewport is left untouched. The scaler parameter can be specified in order to use a particular function to scale individual images. The viewport is left unchanged.

Sourceval resize : ?proportional:bool -> ?scaler:(I.t -> I.t -> unit) -> int -> int -> t -> t

Resize the image, scaling and changing the viewport.

Sourcemodule Draw : sig ... end