Module C2d.Image_data

Image data objects

type t

The type for ImageData objects.

val create : ?color_space:Jstr.t -> ?data:Brr.Tarray.uint8_clamped -> w:int -> h:int -> unit -> t

create ~data ~w ~h () is the image data data for an image of width w and height h. If data is unspecified it is created as a transparent black rectangle. If color_space is specified the given color space is requested. Raises if data is specified and its length is not 4 * w * h.

val w : t -> int

w d is the image data width.

val h : t -> int

h d is the image data height.

data d is the image data of size 4 * w d * h d.

val color_space : t -> Jstr.t

color_space d is the color space of data.