Skip to main content

Module prelude

Module prelude 

Source
Available on crate feature engine only.

Modules§

color_filters
Factory functions for creating crate::ColorFilters, e.g. from a color matrix, a crate::BlendMode, or a crate::ColorTable.
gpu
GPU support for Skia: the Ganesh (crate::gpu::ganesh) and Graphite backends, their backend-specific APIs (D3D, GL, Metal, Vulkan), and the backend-agnostic GPU types shared between them.
gradient
Gradient specifications and shader factory functions for linear, radial, and two-point conical gradients.
image_filters
Factory functions for creating crate::ImageFilters. For filters that take an input filter, None means the dynamic source image is used.
images
Factory functions for creating crate::Images, e.g. from a crate::Bitmap, compressed data, or a crate::Picture.
shaders
Shader factory functions and Shader convenience constructors, re-exported from crate::shader::shaders.
svg
SVG (Scalable Vector Graphics) support: an SVG Canvas and the SVG DOM types for rendering SVG documents.
vkvulkan
Vulkan types and helpers shared by the Ganesh and Graphite backends, plus the Vulkan BackendContext used to create a Ganesh crate::gpu::DirectContext.

Structs§

Borrows
Budgeted
Indicates whether an allocation should count against a cache budget.
Canvas
Canvas provides an interface for drawing, and how the drawing is clipped and transformed. Canvas contains a stack of Matrix and clip values.
Color
32-bit ARGB color value, unpremultiplied. Color components are always in a known order. This is different from SkPMColor, which has its bytes in a configuration dependent order, to match the format of BGRA 8888 color type bitmaps. Color is the type used to specify colors in crate::Paint and in gradients.
Color4f
Colors
Specification for the colors in a gradient.
CubicResampler
Specify b and c (each between 0…1) to create a shader that applies the corresponding cubic reconstruction filter to the image.
Decoration
FontArguments
Represents a set of actual arguments for a font.
FontStyle
FramebufferInfo
GlyphClusterInfo
Gradient
Gradient specification combining colors and interpolation settings.
HSV
IPoint
IRect
ISize
Interpolation
Gradient interpolation settings.
LineMetrics
LocalResourceProvider
A resource provider that loads only local / inline base64 resources.
M44
4x4 matrix used by crate::Canvas and other parts of Skia.
Matrix
Pixmap
PlaceholderStyle
Point
PositionWithAffinity
RGB
RRect
Rect
SamplingOptions
SaveLayerRec
SaveLayerRec contains the state used to create the layer.
Size
SkColor
32-bit ARGB color value, unpremultiplied. Color components are always in a known order. This is different from SkPMColor, which has its bytes in a configuration dependent order, to match the format of BGRA 8888 color type bitmaps. Color is the type used to specify colors in crate::Paint and in gradients.
SkColor4f
SkHSV
SkMatrix
SkPoint
SkRGB
SkRRect
SkRect
SkTextDecoration
Multiple decorations can be applied at once. Ex: Underline and overline is (0x1 | 0x2)
SkTextShadow
SurfaceProps
Describes properties and constraints of a given surface. The rendering engine can parse these during drawing, and can sometimes optimize its performance (e.g. disabling an expensive feature).
SurfacePropsFlags
TextBox
TextDecoration
Multiple decorations can be applied at once. Ex: Underline and overline is (0x1 | 0x2)
TextShadow
V3
VariationCoordinate
A single axis/value pair in a crate::font_arguments::VariationPosition.
VariationPosition
Represents a position in the variation design space.
Weight
Wrapper type of a font weight.
Width
Wrapper type for the width of a font.

Enums§

AlphaType
BlendMode
BlurStyle
ClipOp
ColorType
Describes how pixel bits encode color. A pixel may be an alpha mask, a grayscale, RGB, or ARGB.
Corner
EncodedImageFormat
FilterMode
Format
GlyphPositions
Used to pass either a slice of Point or RSXform to Canvas::draw_glyphs_at.
MipmapMode
PaintCap
PaintJoin
PaintStyle
PixelGeometry
Description of how the LCD strips are arranged for each pixel. If this is unknown, or the pixels are meant to be “portable” and/or transformed before showing (e.g. rotated, scaled) then use PixelGeometry::Unknown.
PlaceholderAlignment
Where to vertically align the placeholder relative to the surrounding text.
RectHeightStyle
RectWidthStyle
SkBlurStyle
SkCorner
SkTextAlign
SkTextHeightBehavior
Slant
SurfaceOrigin
TextAlign
TextBaseline
TextDecorationStyle
TextDirection
TextHeightBehavior
TileMode

Traits§

PointerWrapper
This trait supports the conversion of a wrapper into it’s wrapped C/C++ pointer and back.

Functions§

blur
Create a filter that blurs its input by the separate X and Y sigmas. The provided tile mode is used when the blur kernel goes outside the input image.
raster_from_data
Creates CPU-backed Image from pixel data described by info. The pixels data will not be copied.
raster_n32_premul
Allocates raster Surface. crate::Canvas returned by Surface draws directly into pixels. Allocates and zeroes pixel memory. Pixel memory size is height times width times four. Pixel memory is deleted when Surface is deleted.
register_font_typeface
Registers a typeface and its available weight instances.
render_target
Returns Surface on GPU indicated by context. Allocates memory for pixels, based on the width, height, and crate::ColorType in ImageInfo. budgeted selects whether allocation for pixels is tracked by context. image_info describes the pixel format in crate::ColorType, and transparency in crate::AlphaType, and color matching in crate::ColorSpace.
set_resource_cache_single_allocation_byte_limit
When the cacheable entry is very large, adding it to the cache can cause most or all of the existing entries to be purged. To avoid this, set a limit for a single allocation. If a cacheable entry would have been cached, but its size exceeds this limit, then it is not cached at all.
set_resource_cache_total_bytes_limit
Set the memory usage limit for the resource cache, used for temporary bitmaps and other resources. Entries are purged from the cache when the memory usage exceeds this limit.
wrap_backend_render_target
Wraps a GPU-backed buffer into Surface. Caller must ensure backend_render_target is valid for the lifetime of returned Surface.
wrap_pixels
Allocates raster Surface. crate::Canvas returned by Surface draws directly into pixels.

Type Aliases§

ArcSize
BackendRenderTarget
Describes a render target on a specific GPU backend.
Bitmap
Bitmap describes a two-dimensional raster pixel array. Bitmap is built on ImageInfo, containing integer width and height, ColorType and AlphaType describing the pixel format, and ColorSpace describing the range of colors. Bitmap points to PixelRef, which describes the physical array of pixels. ImageInfo bounds may be located anywhere fully inside PixelRef bounds.
ColorSpace
Data
DirectContext
Font
Font controls options applied when drawing and measuring text.
FontCollection
FontEdging
Whether edge pixels draw opaque or with partial transparency.
FontFeature
FontHinting
FontMgr
GlyphId
Image
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.
ImageFilter
ImageInfo
Describes pixel dimensions and encoding. crate::Bitmap, crate::Image, crate::Pixmap, and crate::Surface can be created from ImageInfo. ImageInfo can be retrieved from crate::Bitmap and crate::Pixmap, but not from crate::Image and crate::Surface. For example, crate::Image and crate::Surface implementations may defer pixel depth, so may not completely specify ImageInfo.
Interface
crate::gpu::ganesh::DirectContext uses the following interface to make all calls into OpenGL. When a crate::gpu::ganesh::DirectContext is created it is given a Self. The interface’s function pointers must be valid for the OpenGL context associated with the crate::gpu::ganesh::DirectContext. On some platforms, such as Windows, function pointers for OpenGL extensions may vary between OpenGL contexts. So the caller must be careful to use a Self initialized for the correct context. All functions that should be available based on the OpenGL’s version and extension string must be non-NULL or crate::gpu::ganesh::DirectContext creation will fail. This can be tested with the Self::validate() method when the OpenGL context has been made current.
MaskFilter
MaskFilter is the base class for object that perform transformations on the mask before drawing it. An example subclass is Blur.
Paint
Paint controls options applied when drawing.
Paragraph
ParagraphBuilder
ParagraphStyle
Path
Path contain geometry. Path may be empty, or contain one or more verbs that outline a figure. Path always starts with a move verb to a Cartesian coordinate, and may be followed by additional verbs that add lines or curves. Adding a close verb makes the geometry into a continuous loop, a closed contour. Path may contain any number of contours, each beginning with a move verb.
PathBuilder
PathDirection
PathEffect
PathFillType
Picture
PictureRecorder
RecordingContext
RuntimeEffect
RuntimeEffect supports creating custom Shader and ColorFilter objects using Skia’s SkSL shading language.
Shader
SkData
SkImage
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.
SkMaskFilter
MaskFilter is the base class for object that perform transformations on the mask before drawing it. An example subclass is Blur.
SkParagraph
SkPath
Path contain geometry. Path may be empty, or contain one or more verbs that outline a figure. Path always starts with a move verb to a Cartesian coordinate, and may be followed by additional verbs that add lines or curves. Adding a close verb makes the geometry into a continuous loop, a closed contour. Path may contain any number of contours, each beginning with a move verb.
SkPathFillType
SkSurface
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 (a RenderTarget surface). Surface takes care of allocating a Canvas that will draw into the surface. Call Surface::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, then None will be returned.
StrutStyle
Surface
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 (a RenderTarget surface). Surface takes care of allocating a Canvas that will draw into the surface. Call Surface::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, then None will be returned.
TextBlob
TextIndex
TextRange
TextStyle
Typeface
TypefaceFontProvider
Uniform
Reflected description of a uniform variable in the effect’s SkSL.