Module C2d.Image_data

Image data objects

type t

The type for ImageData objects.

val create : ?⁠data:Brr.Tarray.uint8_clamped -> w:int -> h:int -> 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. 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.

val data : t -> Brr.Tarray.uint8_clamped

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