Module surface
Expand description
Describes a drawing destination: a Surface manages the pixels or GPU resources that a
crate::Canvas draws into.
Enums§
Type Aliases§
- Async
Read Result - The result from
Image::async_rescale_and_read_pixels()orImage::async_rescale_and_read_pixels_yuv420(). - Surface
Surfaceis responsible for managing the pixels that a canvas draws into. The pixels can be allocated either in CPU memory (a raster surface) or on the GPU (aRenderTargetsurface).Surfacetakes care of allocating aCanvasthat will draw into the surface. CallSurface::canvas()to use that canvas (but don’t delete it, it is owned by the surface).Surfacealways has non-zero dimensions. If there is a request for a new surface, and either of the requested dimensions are zero, thenNonewill be returned.