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::Canvas
returned bySurface
draws directly into pixels. Allocates and zeroes pixel memory. Pixel memory size is height times width times four. Pixel memory is deleted whenSurface
is deleted.
Type Aliases§
Image
describes 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.
Surface
is 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 (aRenderTarget
surface).Surface
takes care of allocating aCanvas
that will draw into the surface. Callsurface_get_canvas()
to use that canvas (but don’t delete it, it is owned by the surface).Surface
always has non-zero dimensions. If there is a request for a new surface, and either of the requested dimensions are zero, thenNone
will be returned.