Expand description
Graphics Abstractions.
This module contains the abstractions and convenience types used for rendering.
The run-time library also makes use of RenderingCache to store the rendering primitives created by the backend in a type-erased manner.
Re-exports§
pub use euclid;
pub use border_radius::*;
Modules§
- border_
radius - This module contains border radius related types for the run-time library.
- cache
- This module contains image and caching related types for the run-time library.
- rendering_
metrics_ collector - This module contains a simple helper type to measure the average number of frames rendered per second.
Macros§
- Opaque
ImageV Table_ static - Instantiate a static OpaqueImageVTable for a given type and implements
vtable::HasStaticVTable<OpaqueImageVTable>
for it.
Structs§
- Bitmap
Font - A subset of an originally scalable font that’s rendered ahead of time.
- Bitmap
Glyph - A pre-rendered glyph with the alpha map and associated metrics
- Bitmap
Glyphs - A set of pre-rendered bitmap glyphs at a fixed pixel size
- Borrowed
OpenGL Texture - This structure contains fields to identify and render an OpenGL texture that Slint borrows from the application code. Use this to embed a native OpenGL texture into a Slint scene.
- Borrowed
OpenGL Texture Builder - Factory to create
slint::Image
from an existing OpenGL texture. - Cached
Graphics Data - CachedGraphicsData allows the graphics backend to store an arbitrary piece of data associated with an item, which is typically computed by accessing properties. The dependency_tracker is used to allow for a lazy computation. Typically, back ends store either compute intensive data or handles that refer to data that’s stored in GPU memory.
- Cached
Path - A struct that provides a path as a string as well as the last modification time of the file it points to.
- Character
MapEntry - An entry in the character map of a
BitmapFont
. - Color
- Color represents a color in the Slint run-time, represented using 8-bit channels for
red, green, blue and the alpha (opacity).
It can be conveniently converted using the
to_
andfrom_
(a)rgb helper functions: - Conic
Gradient Brush - The ConicGradientBrush describes a way of filling a shape with a gradient that rotates around a center point
- FitResult
- The result of the fit function
- Font
Request - FontRequest collects all the developer-configurable properties for fonts, such as family, weight, etc.
It is submitted as a request to the platform font system (i.e. CoreText on macOS) and in exchange the
backend returns a
Box<dyn Font>
. - Gradient
Stop - GradientStop describes a single color stop in a gradient. The colors between multiple stops are interpolated.
- Hsva
Color - HsvaColor stores the hue, saturation, value and alpha components of a color
in the HSV color space as
f32
fields. This is merely a helper struct for use withColor
. - Image
- An image type that can be displayed by the Image element. You can construct
Image objects from a path to an image file on disk, using
Self::load_from_path
. - Linear
Gradient Brush - The LinearGradientBrush describes a way of filling a shape with different colors, which are interpolated between different stops. The colors are aligned with a line that’s rotated by the LinearGradient’s angle.
- Load
Image Error - Error generated if an image cannot be loaded for any reasons.
- Nine
Slice Image - Represent a nine-slice image with the base image and the 4 borders
- Opaque
ImageTO - Invariant, same as vtable::Inner: vtable and ptr has to be valid and ptr an instance matching the vtable
- Opaque
ImageV Table - Path
ArcTo - PathArcTo describes the event of moving the cursor on the path across an arc to the specified x/y coordinates, with the specified x/y radius and additional properties.
- Path
ArcTo Fields Offsets - Helper struct containing the offsets of the fields of the struct
PathArcTo
- Path
Cubic To - PathCubicTo describes a smooth Bézier curve from the path’s current position to the specified x/y location, using two control points.
- Path
Cubic ToFields Offsets - Helper struct containing the offsets of the fields of the struct
PathCubicTo
- Path
Data Iterator - PathDataIterator is a data structure that acts as starting point for iterating through the low-level events of a path. If the path was constructed from said events, then it is a very thin abstraction. If the path was created from higher-level elements, then an intermediate lyon path is required/built.
- Path
Line To - PathLineTo describes the event of moving the cursor on the path to the specified location along a straight line.
- Path
Line ToFields Offsets - Helper struct containing the offsets of the fields of the struct
PathLineTo
- Path
Move To - PathMoveTo describes the event of setting the cursor on the path to use as starting
point for sub-sequent events, such as
LineTo
. Moving the cursor also implicitly closes sub-paths and therefore beings a new sub-path. - Path
Move ToFields Offsets - Helper struct containing the offsets of the fields of the struct
PathMoveTo
- Path
Quadratic To - PathCubicTo describes a smooth Bézier curve from the path’s current position to the specified x/y location, using one control points.
- Path
Quadratic ToFields Offsets - Helper struct containing the offsets of the fields of the struct
PathQuadraticTo
- Radial
Gradient Brush - The RadialGradientBrush describes a way of filling a shape with a circular gradient
- Rendering
Cache - The RenderingCache, in combination with CachedGraphicsData, allows back ends to store data that’s either intensive to compute or has bad CPU locality. Back ends typically keep a RenderingCache instance and use the item’s cached_rendering_data() integer as index in the vec_arena::Arena.
- Rgba
Color - RgbaColor stores the red, green, blue and alpha components of a color
with the precision of the generic parameter T. For example if T is f32,
the values are normalized between 0 and 1. If T is u8, they values range
is 0 to 255.
This is merely a helper class for use with
Color
. - Shared
Pixel Buffer - SharedPixelBuffer is a container for storing image data as pixels. It is internally reference counted and cheap to clone.
- Static
Texture - Some raw pixel data which is typically stored in the binary
- Static
Textures - A texture is stored in read-only memory and may be composed of sub-textures.
Enums§
- Borrowed
OpenGL Texture Origin - This enum describes the origin to use when rendering a borrowed OpenGL texture.
Use this with
BorrowedOpenGLTextureBuilder::origin
. - Brush
- A brush is a data structure that is used to describe how a shape, such as a rectangle, path or even text, shall be filled. A brush can also be applied to the outline of a shape, that means the fill of the outline itself.
- Image
Cache Key - ImageCacheKey encapsulates the different ways of indexing images in the cache of decoded images.
- Image
Inner - A resource is a reference to binary data, for example images. They can be accessible on the file system or embedded in the resulting binary. Or they might be URLs to a web server and a downloaded is necessary before they can be used. cbindgen:prefix-with-name
- Path
Data - PathData represents a path described by either high-level elements or low-level events and coordinates.
- Path
Element - PathElement describes a single element on a path, such as move-to, line-to, etc.
- Requested
GraphicsAPI - Internal enum specify which graphics API should be used, when the backend selector requests that from a built-in backend.
- Requested
OpenGL Version - Internal enum to specify which version of OpenGL to request from the windowing system.
- Shared
Image Buffer - SharedImageBuffer is a container for images that are stored in CPU accessible memory.
- Texture
Pixel Format - The pixel format used for textures.
Statics§
- NINE_
SLICE_ VT - VTable for RC wrapped SVG helper struct.
- PARSED_
SVG_ VT - VTable for RC wrapped SVG helper struct.
Traits§
- Opaque
Image - Note: Was generated from the
#[vtable]
macro onOpaqueImageVTable
Functions§
- fit
- Return an FitResult that can be used to render an image in a buffer that matches a given ImageFit
- fit9slice
- Generate an iterator of
FitResult
for each slice of a nine-slice border image - line_
for_ angle - Returns the start / end points of a gradient within a rectangle of the given size, based on the angle (in degree).
- load_
image_ from_ embedded_ data - Load an image from an image embedded in the binary. This is called by the generated code.
Type Aliases§
- IntRect
- 2D Rectangle with integer coordinates
- IntSize
- 2D Size in integer coordinates
- Point
- 2D Point
- Rect
- 2D Rectangle
- Rgb8
Pixel - Convenience alias for a pixel with three color channels (red, green and blue), each encoded as u8.
- Rgba8
Pixel - Convenience alias for a pixel with four color channels (red, green, blue and alpha), each encoded as u8.
- Size
- 2D Size
- Transform
- 2D Transform