Brr_canvas.CanvasSourceCanvas element.
The type for HTMLCanvasElement objects.
create ~w ~h [] is a canvas element with a render buffer of wxh pixels (they default to 0).
of_el e is a canvas from element e. This throws a JavaScript error if e is not a canvas element.
set_size_to_layout_size t sets the render buffer size to the canvas' element Brr.El.inner_w Brr.El.inner_h and values. If hidpi is true (defaults), these values are multiplied by Brr.Window.device_pixel_ratio.
Context are obtained by the modules that handle them.
C2d.get_context.Gl.get_context.Brr_webgpu.Gpu.Canvas_context.get.The type for image encode parameters.
image_encode ~type' ~quality () are image encoding parameters type' is the mime type of the image, it defaults to "image/png". quality a number from 0. to 1. if it makes sense for the data format (e.g. JPEG), default is implementation dependent.
to_data_url ~encode t is the canvas's image as a data url.
to_blob ~encode t is the canvas's image a blob object. None is returned either if the canvas has no pixels or if an error occurs during image serialisation.
capture_stream ~hz is a capture media stream for the canvas at the frequency of hz or manually if unspecified.