Module freya_engine::prelude
source · Modules§
Structs§
- Multiple decorations can be applied at once. Ex: Underline and overline is (0x1 | 0x2)
- Wrapper type of a font weight.
- Wrapper type for the width of a font.
Enums§
- Type that represents either a slice of
Color, or a slice of [Color4f] and a color space. Whenever this type is expected, it’s either possible to directly pass a&[Color], or a tuple of type(&[Color4f], &ColorSpace).
Functions§
- Allocates raster
Surface.crate::Canvasreturned bySurfacedraws directly into pixels. Allocates and zeroes pixel memory. Pixel memory size is height times width times four. Pixel memory is deleted whenSurfaceis deleted.
Type Aliases§
Bitmapdescribes a two-dimensional raster pixel array.Bitmapis built onImageInfo, containing integer width and height,ColorTypeand [AlphaType] describing the pixel format, andColorSpacedescribing the range of colors.Bitmappoints to [PixelRef], which describes the physical array of pixels.ImageInfobounds may be located anywhere fully inside [PixelRef] bounds.Imagedescribes a two dimensional array of pixels to draw. The pixels may be decoded in a raster bitmap, encoded in a [Picture] or compressed data stream, or located in GPU memory as a GPU texture.- MaskFilter is the base class for object that perform transformations on the mask before drawing it. An example subclass is Blur.
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_get_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.