#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | ImpellerRect |
struct | ImpellerPoint |
struct | ImpellerSize |
struct | ImpellerISize |
struct | ImpellerRange |
struct | ImpellerMatrix |
struct | ImpellerColorMatrix |
struct | ImpellerRoundingRadii |
struct | ImpellerColor |
struct | ImpellerTextureDescriptor |
struct | ImpellerMapping |
struct | ImpellerContextVulkanSettings |
struct | ImpellerContextVulkanInfo |
struct | ImpellerTextDecoration |
Macros | |
#define | IMPELLER_EXTERN_C |
#define | IMPELLER_EXTERN_C_BEGIN |
#define | IMPELLER_EXTERN_C_END |
#define | IMPELLER_EXPORT_DECORATION __attribute__((visibility("default"))) |
#define | IMPELLER_EXPORT IMPELLER_EXPORT_DECORATION |
#define | IMPELLER_NULLABLE |
#define | IMPELLER_NONNULL |
#define | IMPELLER_NODISCARD |
#define | IMPELLER_MAKE_VERSION(variant, major, minor, patch) |
Pack a version in a uint32_t. More... | |
#define | IMPELLER_VERSION_VARIANT 1 |
#define | IMPELLER_VERSION_MAJOR 1 |
#define | IMPELLER_VERSION_MINOR 4 |
#define | IMPELLER_VERSION_PATCH 0 |
#define | IMPELLER_VERSION |
#define | IMPELLER_VERSION_GET_VARIANT(version) ((uint32_t)(version) >> 29U) |
#define | IMPELLER_VERSION_GET_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU) |
#define | IMPELLER_VERSION_GET_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) |
#define | IMPELLER_VERSION_GET_PATCH(version) ((uint32_t)(version) & 0xFFFU) |
#define | IMPELLER_INTERNAL_HANDLE_NAME(handle) handle##_ |
#define | IMPELLER_DEFINE_HANDLE(handle) typedef struct IMPELLER_INTERNAL_HANDLE_NAME(handle) * handle; |
Functions | |
IMPELLER_DEFINE_HANDLE (ImpellerContext) | |
IMPELLER_DEFINE_HANDLE (ImpellerDisplayList) | |
IMPELLER_DEFINE_HANDLE (ImpellerDisplayListBuilder) | |
IMPELLER_DEFINE_HANDLE (ImpellerPaint) | |
IMPELLER_DEFINE_HANDLE (ImpellerColorFilter) | |
IMPELLER_DEFINE_HANDLE (ImpellerColorSource) | |
IMPELLER_DEFINE_HANDLE (ImpellerImageFilter) | |
IMPELLER_DEFINE_HANDLE (ImpellerMaskFilter) | |
IMPELLER_DEFINE_HANDLE (ImpellerTypographyContext) | |
IMPELLER_DEFINE_HANDLE (ImpellerParagraph) | |
IMPELLER_DEFINE_HANDLE (ImpellerParagraphBuilder) | |
IMPELLER_DEFINE_HANDLE (ImpellerParagraphStyle) | |
IMPELLER_DEFINE_HANDLE (ImpellerLineMetrics) | |
IMPELLER_DEFINE_HANDLE (ImpellerGlyphInfo) | |
IMPELLER_DEFINE_HANDLE (ImpellerPath) | |
IMPELLER_DEFINE_HANDLE (ImpellerPathBuilder) | |
IMPELLER_DEFINE_HANDLE (ImpellerSurface) | |
IMPELLER_DEFINE_HANDLE (ImpellerTexture) | |
IMPELLER_DEFINE_HANDLE (ImpellerVulkanSwapchain) | |
IMPELLER_DEFINE_HANDLE (ImpellerFragmentProgram) | |
IMPELLER_EXPORT uint32_t | ImpellerGetVersion () |
Get the version of Impeller standalone API. This is the API that will be accepted for validity checks when provided to the context creation methods. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE | ImpellerContextCreateOpenGLESNew (uint32_t version, ImpellerProcAddressCallback IMPELLER_NONNULL gl_proc_address_callback, void *IMPELLER_NULLABLE gl_proc_address_callback_user_data) |
Create an OpenGL(ES) Impeller context. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE | ImpellerContextCreateMetalNew (uint32_t version) |
Create a Metal context using the system default Metal device. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE | ImpellerContextCreateVulkanNew (uint32_t version, const ImpellerContextVulkanSettings *IMPELLER_NONNULL settings) |
Create a Vulkan context using the provided Vulkan Settings. More... | |
IMPELLER_EXPORT void | ImpellerContextRetain (ImpellerContext IMPELLER_NULLABLE context) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerContextRelease (ImpellerContext IMPELLER_NULLABLE context) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT bool | ImpellerContextGetVulkanInfo (ImpellerContext IMPELLER_NONNULL context, ImpellerContextVulkanInfo *IMPELLER_NONNULL out_vulkan_info) |
Get internal Vulkan handles managed by the given Vulkan context. Ownership of the handles is still maintained by Impeller. This accessor is just available so embedders can create resources using the same device and instance as Impeller for interop. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerVulkanSwapchain IMPELLER_NULLABLE | ImpellerVulkanSwapchainCreateNew (ImpellerContext IMPELLER_NONNULL context, void *IMPELLER_NONNULL vulkan_surface_khr) |
Create a new Vulkan swapchain using a VkSurfaceKHR instance. Ownership of the surface is transferred over to Impeller. The Vulkan instance the surface is created from must the same as the context provided. More... | |
IMPELLER_EXPORT void | ImpellerVulkanSwapchainRetain (ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerVulkanSwapchainRelease (ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE | ImpellerVulkanSwapchainAcquireNextSurfaceNew (ImpellerVulkanSwapchain IMPELLER_NONNULL swapchain) |
A potentially blocking operation, acquires the next surface to render to. Since this may block, surface acquisition must be delayed for as long as possible to avoid an idle wait on the CPU. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE | ImpellerSurfaceCreateWrappedFBONew (ImpellerContext IMPELLER_NONNULL context, uint64_t fbo, ImpellerPixelFormat format, const ImpellerISize *IMPELLER_NONNULL size) |
Create a new surface by wrapping an existing framebuffer object. The framebuffer must be complete as determined by glCheckFramebufferStatus . The framebuffer is still owned by the caller and it must be collected once the surface is collected. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE | ImpellerSurfaceCreateWrappedMetalDrawableNew (ImpellerContext IMPELLER_NONNULL context, void *IMPELLER_NONNULL metal_drawable) |
Create a surface by wrapping a Metal drawable. This is useful during WSI when the drawable is the backing store of the Metal layer being drawn to. More... | |
IMPELLER_EXPORT void | ImpellerSurfaceRetain (ImpellerSurface IMPELLER_NULLABLE surface) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerSurfaceRelease (ImpellerSurface IMPELLER_NULLABLE surface) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT bool | ImpellerSurfaceDrawDisplayList (ImpellerSurface IMPELLER_NONNULL surface, ImpellerDisplayList IMPELLER_NONNULL display_list) |
Draw a display list onto the surface. The same display list can be drawn multiple times to different surfaces. More... | |
IMPELLER_EXPORT bool | ImpellerSurfacePresent (ImpellerSurface IMPELLER_NONNULL surface) |
Present the surface to the underlying window system. More... | |
IMPELLER_EXPORT void | ImpellerPathRetain (ImpellerPath IMPELLER_NULLABLE path) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerPathRelease (ImpellerPath IMPELLER_NULLABLE path) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerPathGetBounds (ImpellerPath IMPELLER_NONNULL path, ImpellerRect *IMPELLER_NONNULL out_bounds) |
Get the bounds of the path. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPathBuilder IMPELLER_NULLABLE | ImpellerPathBuilderNew () |
Create a new path builder. Paths themselves are immutable. A builder builds these immutable paths. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderRetain (ImpellerPathBuilder IMPELLER_NULLABLE builder) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderRelease (ImpellerPathBuilder IMPELLER_NULLABLE builder) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderMoveTo (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL location) |
Move the cursor to the specified location. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderLineTo (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL location) |
Add a line segment from the current cursor location to the given location. The cursor location is updated to be at the endpoint. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderQuadraticCurveTo (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL control_point, const ImpellerPoint *IMPELLER_NONNULL end_point) |
Add a quadratic curve from whose start point is the cursor to the specified end point using the a single control point. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderCubicCurveTo (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL control_point_1, const ImpellerPoint *IMPELLER_NONNULL control_point_2, const ImpellerPoint *IMPELLER_NONNULL end_point) |
Add a cubic curve whose start point is current cursor location to the specified end point using the two specified control points. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderAddRect (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect) |
Adds a rectangle to the path. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderAddArc (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, float start_angle_degrees, float end_angle_degrees) |
Add an arc to the path. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderAddOval (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds) |
Add an oval to the path. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderAddRoundedRect (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, const ImpellerRoundingRadii *IMPELLER_NONNULL rounding_radii) |
Add a rounded rect with potentially non-uniform radii to the path. More... | |
IMPELLER_EXPORT void | ImpellerPathBuilderClose (ImpellerPathBuilder IMPELLER_NONNULL builder) |
Close the path. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE | ImpellerPathBuilderCopyPathNew (ImpellerPathBuilder IMPELLER_NONNULL builder, ImpellerFillType fill) |
Create a new path by copying the existing built-up path. The existing path can continue being added to. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE | ImpellerPathBuilderTakePathNew (ImpellerPathBuilder IMPELLER_NONNULL builder, ImpellerFillType fill) |
Create a new path using the existing built-up path. The existing path builder now contains an empty path. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE | ImpellerPaintNew () |
Create a new paint with default values. More... | |
IMPELLER_EXPORT void | ImpellerPaintRetain (ImpellerPaint IMPELLER_NULLABLE paint) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerPaintRelease (ImpellerPaint IMPELLER_NULLABLE paint) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetColor (ImpellerPaint IMPELLER_NONNULL paint, const ImpellerColor *IMPELLER_NONNULL color) |
Set the paint color. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetBlendMode (ImpellerPaint IMPELLER_NONNULL paint, ImpellerBlendMode mode) |
Set the paint blend mode. The blend mode controls how the new paints contents are mixed with the values already drawn using previous draw calls. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetDrawStyle (ImpellerPaint IMPELLER_NONNULL paint, ImpellerDrawStyle style) |
Set the paint draw style. The style controls if the closed shapes are filled and/or stroked. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetStrokeCap (ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeCap cap) |
Sets how strokes rendered using this paint are capped. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetStrokeJoin (ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeJoin join) |
Sets how strokes rendered using this paint are joined. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetStrokeWidth (ImpellerPaint IMPELLER_NONNULL paint, float width) |
Set the width of the strokes rendered using this paint. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetStrokeMiter (ImpellerPaint IMPELLER_NONNULL paint, float miter) |
Set the miter limit of the strokes rendered using this paint. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetColorFilter (ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorFilter IMPELLER_NONNULL color_filter) |
Set the color filter of the paint. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetColorSource (ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorSource IMPELLER_NONNULL color_source) |
Set the color source of the paint. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetImageFilter (ImpellerPaint IMPELLER_NONNULL paint, ImpellerImageFilter IMPELLER_NONNULL image_filter) |
Set the image filter of a paint. More... | |
IMPELLER_EXPORT void | ImpellerPaintSetMaskFilter (ImpellerPaint IMPELLER_NONNULL paint, ImpellerMaskFilter IMPELLER_NONNULL mask_filter) |
Set the mask filter of a paint. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE | ImpellerTextureCreateWithContentsNew (ImpellerContext IMPELLER_NONNULL context, const ImpellerTextureDescriptor *IMPELLER_NONNULL descriptor, const ImpellerMapping *IMPELLER_NONNULL contents, void *IMPELLER_NULLABLE contents_on_release_user_data) |
Create a texture with decompressed bytes. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE | ImpellerTextureCreateWithOpenGLTextureHandleNew (ImpellerContext IMPELLER_NONNULL context, const ImpellerTextureDescriptor *IMPELLER_NONNULL descriptor, uint64_t handle) |
Create a texture with an externally created OpenGL texture handle. More... | |
IMPELLER_EXPORT void | ImpellerTextureRetain (ImpellerTexture IMPELLER_NULLABLE texture) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerTextureRelease (ImpellerTexture IMPELLER_NULLABLE texture) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT uint64_t | ImpellerTextureGetOpenGLHandle (ImpellerTexture IMPELLER_NONNULL texture) |
Get the OpenGL handle associated with this texture. If this is not an OpenGL texture, this method will always return 0. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerFragmentProgram IMPELLER_NULLABLE | ImpellerFragmentProgramNew (const ImpellerMapping *IMPELLER_NONNULL data, void *IMPELLER_NULLABLE data_release_user_data) |
Create a new fragment program using data obtained by compiling a GLSL shader with impellerc . More... | |
IMPELLER_EXPORT void | ImpellerFragmentProgramRetain (ImpellerFragmentProgram IMPELLER_NULLABLE fragment_program) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerFragmentProgramRelease (ImpellerFragmentProgram IMPELLER_NULLABLE fragment_program) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerColorSourceRetain (ImpellerColorSource IMPELLER_NULLABLE color_source) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerColorSourceRelease (ImpellerColorSource IMPELLER_NULLABLE color_source) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE | ImpellerColorSourceCreateLinearGradientNew (const ImpellerPoint *IMPELLER_NONNULL start_point, const ImpellerPoint *IMPELLER_NONNULL end_point, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation) |
Create a color source that forms a linear gradient. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE | ImpellerColorSourceCreateRadialGradientNew (const ImpellerPoint *IMPELLER_NONNULL center, float radius, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation) |
Create a color source that forms a radial gradient. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE | ImpellerColorSourceCreateConicalGradientNew (const ImpellerPoint *IMPELLER_NONNULL start_center, float start_radius, const ImpellerPoint *IMPELLER_NONNULL end_center, float end_radius, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation) |
Create a color source that forms a conical gradient. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE | ImpellerColorSourceCreateSweepGradientNew (const ImpellerPoint *IMPELLER_NONNULL center, float start, float end, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation) |
Create a color source that forms a sweep gradient. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE | ImpellerColorSourceCreateImageNew (ImpellerTexture IMPELLER_NONNULL image, ImpellerTileMode horizontal_tile_mode, ImpellerTileMode vertical_tile_mode, ImpellerTextureSampling sampling, const ImpellerMatrix *IMPELLER_NULLABLE transformation) |
Create a color source that samples from an image. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE | ImpellerColorSourceCreateFragmentProgramNew (ImpellerContext IMPELLER_NONNULL context, ImpellerFragmentProgram IMPELLER_NONNULL fragment_program, IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE samplers, size_t samplers_count, const uint8_t *IMPELLER_NULLABLE data, size_t data_bytes_length) |
Create a color source whose pixels are shaded by a fragment program. More... | |
IMPELLER_EXPORT void | ImpellerColorFilterRetain (ImpellerColorFilter IMPELLER_NULLABLE color_filter) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerColorFilterRelease (ImpellerColorFilter IMPELLER_NULLABLE color_filter) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE | ImpellerColorFilterCreateBlendNew (const ImpellerColor *IMPELLER_NONNULL color, ImpellerBlendMode blend_mode) |
Create a color filter that performs blending of pixel values independently. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE | ImpellerColorFilterCreateColorMatrixNew (const ImpellerColorMatrix *IMPELLER_NONNULL color_matrix) |
Create a color filter that transforms pixel color values independently. More... | |
IMPELLER_EXPORT void | ImpellerMaskFilterRetain (ImpellerMaskFilter IMPELLER_NULLABLE mask_filter) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerMaskFilterRelease (ImpellerMaskFilter IMPELLER_NULLABLE mask_filter) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerMaskFilter IMPELLER_NULLABLE | ImpellerMaskFilterCreateBlurNew (ImpellerBlurStyle style, float sigma) |
Create a mask filter that blurs contents in the masked shape. More... | |
IMPELLER_EXPORT void | ImpellerImageFilterRetain (ImpellerImageFilter IMPELLER_NULLABLE image_filter) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerImageFilterRelease (ImpellerImageFilter IMPELLER_NULLABLE image_filter) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE | ImpellerImageFilterCreateBlurNew (float x_sigma, float y_sigma, ImpellerTileMode tile_mode) |
Creates an image filter that applies a Gaussian blur. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE | ImpellerImageFilterCreateDilateNew (float x_radius, float y_radius) |
Creates an image filter that enhances the per-channel pixel values to the maximum value in a circle around the pixel. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE | ImpellerImageFilterCreateErodeNew (float x_radius, float y_radius) |
Creates an image filter that dampens the per-channel pixel values to the minimum value in a circle around the pixel. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE | ImpellerImageFilterCreateMatrixNew (const ImpellerMatrix *IMPELLER_NONNULL matrix, ImpellerTextureSampling sampling) |
Creates an image filter that applies a transformation matrix to the underlying image. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE | ImpellerImageFilterCreateFragmentProgramNew (ImpellerContext IMPELLER_NONNULL context, ImpellerFragmentProgram IMPELLER_NONNULL fragment_program, IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE samplers, size_t samplers_count, const uint8_t *IMPELLER_NULLABLE data, size_t data_bytes_length) |
Create an image filter where each pixel is shaded by a fragment program. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE | ImpellerImageFilterCreateComposeNew (ImpellerImageFilter IMPELLER_NONNULL outer, ImpellerImageFilter IMPELLER_NONNULL inner) |
Creates a composed filter that when applied is identical to subsequently applying the inner and then the outer filters. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListRetain (ImpellerDisplayList IMPELLER_NULLABLE display_list) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListRelease (ImpellerDisplayList IMPELLER_NULLABLE display_list) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE | ImpellerDisplayListBuilderNew (const ImpellerRect *IMPELLER_NULLABLE cull_rect) |
Create a new display list builder. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderRetain (ImpellerDisplayListBuilder IMPELLER_NULLABLE builder) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderRelease (ImpellerDisplayListBuilder IMPELLER_NULLABLE builder) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayList IMPELLER_NULLABLE | ImpellerDisplayListBuilderCreateDisplayListNew (ImpellerDisplayListBuilder IMPELLER_NONNULL builder) |
Create a new display list using the rendering intent already encoded in the builder. The builder is reset after this call. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderSave (ImpellerDisplayListBuilder IMPELLER_NONNULL builder) |
Stashes the current transformation and clip state onto a save stack. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderSaveLayer (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL bounds, ImpellerPaint IMPELLER_NULLABLE paint, ImpellerImageFilter IMPELLER_NULLABLE backdrop) |
Stashes the current transformation and clip state onto a save stack and creates and creates an offscreen layer onto which subsequent rendering intent will be directed to. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderRestore (ImpellerDisplayListBuilder IMPELLER_NONNULL builder) |
Pops the last entry pushed onto the save stack using a call to ImpellerDisplayListBuilderSave or ImpellerDisplayListBuilderSaveLayer . More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderScale (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, float x_scale, float y_scale) |
Apply a scale to the transformation matrix currently on top of the save stack. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderRotate (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, float angle_degrees) |
Apply a clockwise rotation to the transformation matrix currently on top of the save stack. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderTranslate (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, float x_translation, float y_translation) |
Apply a translation to the transformation matrix currently on top of the save stack. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderTransform (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerMatrix *IMPELLER_NONNULL transform) |
Appends the the provided transformation to the transformation already on the save stack. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderSetTransform (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerMatrix *IMPELLER_NONNULL transform) |
Clear the transformation on top of the save stack and replace it with a new value. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderGetTransform (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerMatrix *IMPELLER_NONNULL out_transform) |
Get the transformation currently built up on the top of the transformation stack. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderResetTransform (ImpellerDisplayListBuilder IMPELLER_NONNULL builder) |
Reset the transformation on top of the transformation stack to identity. More... | |
IMPELLER_EXPORT uint32_t | ImpellerDisplayListBuilderGetSaveCount (ImpellerDisplayListBuilder IMPELLER_NONNULL builder) |
Get the current size of the save stack. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderRestoreToCount (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, uint32_t count) |
Effectively calls ImpellerDisplayListBuilderRestore till the size of the save stack becomes a specified count. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderClipRect (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, ImpellerClipOperation op) |
Reduces the clip region to the intersection of the current clip and the given rectangle taking into account the clip operation. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderClipOval (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, ImpellerClipOperation op) |
Reduces the clip region to the intersection of the current clip and the given oval taking into account the clip operation. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderClipRoundedRect (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, const ImpellerRoundingRadii *IMPELLER_NONNULL radii, ImpellerClipOperation op) |
Reduces the clip region to the intersection of the current clip and the given rounded rectangle taking into account the clip operation. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderClipPath (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, ImpellerClipOperation op) |
Reduces the clip region to the intersection of the current clip and the given path taking into account the clip operation. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawPaint (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPaint IMPELLER_NONNULL paint) |
Fills the current clip with the specified paint. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawLine (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL from, const ImpellerPoint *IMPELLER_NONNULL to, ImpellerPaint IMPELLER_NONNULL paint) |
Draws a line segment. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawDashedLine (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL from, const ImpellerPoint *IMPELLER_NONNULL to, float on_length, float off_length, ImpellerPaint IMPELLER_NONNULL paint) |
Draws a dash line segment. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawRect (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, ImpellerPaint IMPELLER_NONNULL paint) |
Draws a rectangle. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawOval (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, ImpellerPaint IMPELLER_NONNULL paint) |
Draws an oval. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawRoundedRect (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, const ImpellerRoundingRadii *IMPELLER_NONNULL radii, ImpellerPaint IMPELLER_NONNULL paint) |
Draws a rounded rect. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawRoundedRectDifference (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL outer_rect, const ImpellerRoundingRadii *IMPELLER_NONNULL outer_radii, const ImpellerRect *IMPELLER_NONNULL inner_rect, const ImpellerRoundingRadii *IMPELLER_NONNULL inner_radii, ImpellerPaint IMPELLER_NONNULL paint) |
Draws a shape that is the different between the specified rectangles (each with configurable corner radii). More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawPath (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, ImpellerPaint IMPELLER_NONNULL paint) |
Draws the specified shape. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawDisplayList (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerDisplayList IMPELLER_NONNULL display_list, float opacity) |
Flattens the contents of another display list into the one currently being built. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawParagraph (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerParagraph IMPELLER_NONNULL paragraph, const ImpellerPoint *IMPELLER_NONNULL point) |
Draw a paragraph at the specified point. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawShadow (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, const ImpellerColor *IMPELLER_NONNULL color, float elevation, bool occluder_is_transparent, float device_pixel_ratio) |
Draw a shadow for a Path given a material elevation. If the occluding object is not opaque, additional hints (via the occluder_is_transparent argument) must be provided to render the shadow correctly. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawTexture (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerTexture IMPELLER_NONNULL texture, const ImpellerPoint *IMPELLER_NONNULL point, ImpellerTextureSampling sampling, ImpellerPaint IMPELLER_NULLABLE paint) |
Draw a texture at the specified point. More... | |
IMPELLER_EXPORT void | ImpellerDisplayListBuilderDrawTextureRect (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerTexture IMPELLER_NONNULL texture, const ImpellerRect *IMPELLER_NONNULL src_rect, const ImpellerRect *IMPELLER_NONNULL dst_rect, ImpellerTextureSampling sampling, ImpellerPaint IMPELLER_NULLABLE paint) |
Draw a portion of texture at the specified location. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE | ImpellerTypographyContextNew () |
Create a new typography contents. More... | |
IMPELLER_EXPORT void | ImpellerTypographyContextRetain (ImpellerTypographyContext IMPELLER_NULLABLE context) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerTypographyContextRelease (ImpellerTypographyContext IMPELLER_NULLABLE context) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT bool | ImpellerTypographyContextRegisterFont (ImpellerTypographyContext IMPELLER_NONNULL context, const ImpellerMapping *IMPELLER_NONNULL contents, void *IMPELLER_NULLABLE contents_on_release_user_data, const char *IMPELLER_NULLABLE family_name_alias) |
Register a custom font. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphStyle IMPELLER_NULLABLE | ImpellerParagraphStyleNew () |
Create a new paragraph style. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleRetain (ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleRelease (ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetForeground (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerPaint IMPELLER_NONNULL paint) |
Set the paint used to render the text glyph contents. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetBackground (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerPaint IMPELLER_NONNULL paint) |
Set the paint used to render the background of the text glyphs. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetFontWeight (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerFontWeight weight) |
Set the weight of the font to select when rendering glyphs. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetFontStyle (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerFontStyle style) |
Set whether the glyphs should be bolded or italicized. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetFontFamily (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL family_name) |
Set the font family. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetFontSize (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float size) |
Set the font size. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetHeight (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float height) |
The height of the text as a multiple of text size. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetTextAlignment (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerTextAlignment align) |
Set the alignment of text within the paragraph. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetTextDirection (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerTextDirection direction) |
Set the directionality of the text within the paragraph. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetTextDecoration (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const ImpellerTextDecoration *IMPELLER_NONNULL decoration) |
Set one of more text decorations on the paragraph. Decorations can be underlines, overlines, strikethroughs, etc.. The style of decorations can be set as well (dashed, dotted, wavy, etc..) More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetMaxLines (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, uint32_t max_lines) |
Set the maximum line count within the paragraph. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetLocale (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL locale) |
Set the paragraph locale. More... | |
IMPELLER_EXPORT void | ImpellerParagraphStyleSetEllipsis (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NULLABLE ellipsis) |
Set the UTF-8 string to use as the ellipsis. Pass nullptr to clear the setting to default. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE | ImpellerParagraphBuilderNew (ImpellerTypographyContext IMPELLER_NONNULL context) |
Create a new paragraph builder. More... | |
IMPELLER_EXPORT void | ImpellerParagraphBuilderRetain (ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerParagraphBuilderRelease (ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerParagraphBuilderPushStyle (ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, ImpellerParagraphStyle IMPELLER_NONNULL style) |
Push a new paragraph style onto the paragraph style stack managed by the paragraph builder. More... | |
IMPELLER_EXPORT void | ImpellerParagraphBuilderPopStyle (ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder) |
Pop a previously pushed paragraph style from the paragraph style stack. More... | |
IMPELLER_EXPORT void | ImpellerParagraphBuilderAddText (ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, const uint8_t *IMPELLER_NULLABLE data, uint32_t length) |
Add UTF-8 encoded text to the paragraph. The text will be styled according to the paragraph style already on top of the paragraph style stack. More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraph IMPELLER_NULLABLE | ImpellerParagraphBuilderBuildParagraphNew (ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, float width) |
Layout and build a new paragraph using the specified width. The resulting paragraph is immutable. The paragraph builder must be discarded and a new one created to build more paragraphs. More... | |
IMPELLER_EXPORT void | ImpellerParagraphRetain (ImpellerParagraph IMPELLER_NULLABLE paragraph) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerParagraphRelease (ImpellerParagraph IMPELLER_NULLABLE paragraph) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT float | ImpellerParagraphGetMaxWidth (ImpellerParagraph IMPELLER_NONNULL paragraph) |
IMPELLER_EXPORT float | ImpellerParagraphGetHeight (ImpellerParagraph IMPELLER_NONNULL paragraph) |
IMPELLER_EXPORT float | ImpellerParagraphGetLongestLineWidth (ImpellerParagraph IMPELLER_NONNULL paragraph) |
IMPELLER_EXPORT float | ImpellerParagraphGetMinIntrinsicWidth (ImpellerParagraph IMPELLER_NONNULL paragraph) |
IMPELLER_EXPORT float | ImpellerParagraphGetMaxIntrinsicWidth (ImpellerParagraph IMPELLER_NONNULL paragraph) |
IMPELLER_EXPORT float | ImpellerParagraphGetIdeographicBaseline (ImpellerParagraph IMPELLER_NONNULL paragraph) |
IMPELLER_EXPORT float | ImpellerParagraphGetAlphabeticBaseline (ImpellerParagraph IMPELLER_NONNULL paragraph) |
IMPELLER_EXPORT uint32_t | ImpellerParagraphGetLineCount (ImpellerParagraph IMPELLER_NONNULL paragraph) |
IMPELLER_EXPORT void | ImpellerParagraphGetWordBoundary (ImpellerParagraph IMPELLER_NONNULL paragraph, size_t code_unit_index, ImpellerRange *IMPELLER_NONNULL out_range) |
Get the range into the UTF-16 code unit buffer that represents the word at the specified caret location in the same buffer. More... | |
IMPELLER_EXPORT ImpellerLineMetrics IMPELLER_NULLABLE | ImpellerParagraphGetLineMetrics (ImpellerParagraph IMPELLER_NONNULL paragraph) |
Get the line metrics of this laid out paragraph. Calculating the line metrics is expensive. The first time line metrics are requested, they will be cached along with the paragraph (which is immutable). More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE | ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew (ImpellerParagraph IMPELLER_NONNULL paragraph, size_t code_unit_index) |
Create a new instance of glyph info that can be queried for information about the glyph at the given UTF-16 code unit index. The instance must be freed using ImpellerGlyphInfoRelease . More... | |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE | ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew (ImpellerParagraph IMPELLER_NONNULL paragraph, double x, double y) |
Create a new instance of glyph info that can be queried for information about the glyph closest to the specified coordinates relative to the origin of the paragraph. The instance must be freed using ImpellerGlyphInfoRelease . More... | |
IMPELLER_EXPORT void | ImpellerLineMetricsRetain (ImpellerLineMetrics IMPELLER_NULLABLE line_metrics) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerLineMetricsRelease (ImpellerLineMetrics IMPELLER_NULLABLE line_metrics) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT double | ImpellerLineMetricsGetUnscaledAscent (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
The rise from the baseline as calculated from the font and style for this line ignoring the height from the text style. More... | |
IMPELLER_EXPORT double | ImpellerLineMetricsGetAscent (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
The rise from the baseline as calculated from the font and style for this line. More... | |
IMPELLER_EXPORT double | ImpellerLineMetricsGetDescent (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
The drop from the baseline as calculated from the font and style for this line. More... | |
IMPELLER_EXPORT double | ImpellerLineMetricsGetBaseline (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
The y coordinate of the baseline for this line from the top of the paragraph. More... | |
IMPELLER_EXPORT bool | ImpellerLineMetricsIsHardbreak (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
Used to determine if this line ends with an explicit line break (e.g. ' ') or is the end of the paragraph. More... | |
IMPELLER_EXPORT double | ImpellerLineMetricsGetWidth (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
Width of the line from the left edge of the leftmost glyph to the right edge of the rightmost glyph. More... | |
IMPELLER_EXPORT double | ImpellerLineMetricsGetHeight (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
Total height of the line from the top edge to the bottom edge. More... | |
IMPELLER_EXPORT double | ImpellerLineMetricsGetLeft (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
The x coordinate of left edge of the line. More... | |
IMPELLER_EXPORT size_t | ImpellerLineMetricsGetCodeUnitStartIndex (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
Fetch the start index in the buffer of UTF-16 code units used to represent the paragraph line. More... | |
IMPELLER_EXPORT size_t | ImpellerLineMetricsGetCodeUnitEndIndex (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
Fetch the end index in the buffer of UTF-16 code units used to represent the paragraph line. More... | |
IMPELLER_EXPORT size_t | ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
Fetch the end index (excluding whitespace) in the buffer of UTF-16 code units used to represent the paragraph line. More... | |
IMPELLER_EXPORT size_t | ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line) |
Fetch the end index (including newlines) in the buffer of UTF-16 code units used to represent the paragraph line. More... | |
IMPELLER_EXPORT void | ImpellerGlyphInfoRetain (ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT void | ImpellerGlyphInfoRelease (ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op. More... | |
IMPELLER_EXPORT size_t | ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info) |
Fetch the start index in the buffer of UTF-16 code units used to represent the grapheme cluster for a glyph. More... | |
IMPELLER_EXPORT size_t | ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info) |
Fetch the end index in the buffer of UTF-16 code units used to represent the grapheme cluster for a glyph. More... | |
IMPELLER_EXPORT void | ImpellerGlyphInfoGetGraphemeClusterBounds (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info, ImpellerRect *IMPELLER_NONNULL out_bounds) |
Fetch the bounds of the grapheme cluster for the glyph in the coordinate space of the paragraph. More... | |
IMPELLER_EXPORT bool | ImpellerGlyphInfoIsEllipsis (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info) |
IMPELLER_EXPORT ImpellerTextDirection | ImpellerGlyphInfoGetTextDirection (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info) |
#define IMPELLER_DEFINE_HANDLE | ( | handle | ) | typedef struct IMPELLER_INTERNAL_HANDLE_NAME(handle) * handle; |
Definition at line 142 of file impeller.h.
#define IMPELLER_EXPORT IMPELLER_EXPORT_DECORATION |
Definition at line 48 of file impeller.h.
#define IMPELLER_EXPORT_DECORATION __attribute__((visibility("default"))) |
Definition at line 44 of file impeller.h.
#define IMPELLER_EXTERN_C |
----— ___ _ _ _ ____ ___ -----— ----— |_ _|_ __ ___ _ __ ___| | | ___ _ __ / \ | _ _ _| -----— ----— | || '_ ‘ _ | ’_ \ / _ \ | |/ _ \ '__| / _ \ | |_) | | -----— ----— | || | | | | | |_) | __/ | | __/ | / ___ | __/| | -----— ----— |___|_| |_| |_| .__/ ___|_|_|___|_| /_/ __| |___| -----—
This file describes a high-level, single-header, dependency-free, 2D graphics API.
The API fundamentals that include details about the object model, reference counting, and null-safety are described in the README.
Definition at line 36 of file impeller.h.
#define IMPELLER_EXTERN_C_BEGIN |
Definition at line 37 of file impeller.h.
#define IMPELLER_EXTERN_C_END |
Definition at line 38 of file impeller.h.
#define IMPELLER_INTERNAL_HANDLE_NAME | ( | handle | ) | handle##_ |
Definition at line 141 of file impeller.h.
#define IMPELLER_MAKE_VERSION | ( | variant, | |
major, | |||
minor, | |||
patch | |||
) |
Pack a version in a uint32_t.
[in] | variant | The version variant. |
[in] | major | The major version. |
[in] | minor | The minor version. |
[in] | patch | The patch version. |
Definition at line 79 of file impeller.h.
#define IMPELLER_NODISCARD |
Definition at line 64 of file impeller.h.
#define IMPELLER_NONNULL |
Definition at line 58 of file impeller.h.
#define IMPELLER_NULLABLE |
Definition at line 57 of file impeller.h.
#define IMPELLER_VERSION |
The current Impeller API version.
This version must be passed to APIs that create top-level objects like graphics contexts. Construction of the context may fail if the API version expected by the caller is not supported by the library.
The version currently supported by the library is returned by a call to ImpellerGetVersion
Since there are no API stability guarantees today, passing a version that is different to the one returned by ImpellerGetVersion
will always fail.
ImpellerGetVersion
Definition at line 103 of file impeller.h.
#define IMPELLER_VERSION_GET_MAJOR | ( | version | ) | (((uint32_t)(version) >> 22U) & 0x7FU) |
[in] | version | The packed version. |
Definition at line 119 of file impeller.h.
#define IMPELLER_VERSION_GET_MINOR | ( | version | ) | (((uint32_t)(version) >> 12U) & 0x3FFU) |
[in] | version | The packed version. |
Definition at line 127 of file impeller.h.
#define IMPELLER_VERSION_GET_PATCH | ( | version | ) | ((uint32_t)(version) & 0xFFFU) |
[in] | version | The packed version. |
Definition at line 135 of file impeller.h.
#define IMPELLER_VERSION_GET_VARIANT | ( | version | ) | ((uint32_t)(version) >> 29U) |
[in] | version | The packed version. |
Definition at line 112 of file impeller.h.
#define IMPELLER_VERSION_MAJOR 1 |
Definition at line 84 of file impeller.h.
#define IMPELLER_VERSION_MINOR 4 |
Definition at line 85 of file impeller.h.
#define IMPELLER_VERSION_PATCH 0 |
Definition at line 86 of file impeller.h.
#define IMPELLER_VERSION_VARIANT 1 |
Definition at line 83 of file impeller.h.
typedef enum ImpellerBlendMode ImpellerBlendMode |
typedef enum ImpellerBlurStyle ImpellerBlurStyle |
typedef void(* ImpellerCallback) (void *IMPELLER_NULLABLE user_data) |
A callback invoked by Impeller that passes a user supplied baton back to the user. Impeller does not interpret the baton in any way. The way the baton is specified and the thread on which the callback is invoked depends on how the user supplies the callback to Impeller.
Definition at line 338 of file impeller.h.
typedef enum ImpellerClipOperation ImpellerClipOperation |
typedef struct ImpellerColor ImpellerColor |
typedef struct ImpellerColorMatrix ImpellerColorMatrix |
A 4x5 matrix using row-major storage used for transforming color values.
To transform color values, a 5x5 matrix is constructed with the 5th row being identity. Then the following transformation is performed:
The translation column (m[4], m[9], m[14], m[19]) must be specified in non-normalized 8-bit unsigned integer space (0 to 255). Values outside this range will produce undefined results.
The identity transformation is thus:
Some examples:
To invert all colors:
To apply a sepia filter:
To apply a grayscale conversion filter:
typedef enum ImpellerColorSpace ImpellerColorSpace |
typedef struct ImpellerContextVulkanInfo ImpellerContextVulkanInfo |
typedef struct ImpellerContextVulkanSettings ImpellerContextVulkanSettings |
typedef enum ImpellerDrawStyle ImpellerDrawStyle |
typedef enum ImpellerFillType ImpellerFillType |
typedef enum ImpellerFontStyle ImpellerFontStyle |
typedef enum ImpellerFontWeight ImpellerFontWeight |
typedef struct ImpellerISize ImpellerISize |
typedef struct ImpellerMapping ImpellerMapping |
typedef struct ImpellerMatrix ImpellerMatrix |
A 4x4 transformation matrix using column-major storage.
typedef enum ImpellerPixelFormat ImpellerPixelFormat |
typedef struct ImpellerPoint ImpellerPoint |
typedef void* IMPELLER_NULLABLE(* ImpellerProcAddressCallback) (const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data) |
A callback used by Impeller to allow the user to resolve function pointers. A user supplied baton that is uninterpreted by Impeller is passed back to the user in the callback. How the baton is specified to Impeller and the thread on which the callback is invoked depends on how the callback is specified to Impeller.
Definition at line 347 of file impeller.h.
typedef struct ImpellerRange ImpellerRange |
typedef struct ImpellerRect ImpellerRect |
typedef struct ImpellerRoundingRadii ImpellerRoundingRadii |
typedef struct ImpellerSize ImpellerSize |
typedef enum ImpellerStrokeCap ImpellerStrokeCap |
typedef enum ImpellerStrokeJoin ImpellerStrokeJoin |
typedef enum ImpellerTextAlignment ImpellerTextAlignment |
typedef struct ImpellerTextDecoration ImpellerTextDecoration |
typedef enum ImpellerTextDecorationStyle ImpellerTextDecorationStyle |
typedef enum ImpellerTextDecorationType ImpellerTextDecorationType |
typedef enum ImpellerTextDirection ImpellerTextDirection |
typedef struct ImpellerTextureDescriptor ImpellerTextureDescriptor |
typedef enum ImpellerTextureSampling ImpellerTextureSampling |
typedef enum ImpellerTileMode ImpellerTileMode |
typedef void* IMPELLER_NULLABLE(* ImpellerVulkanProcAddressCallback) (void *IMPELLER_NULLABLE vulkan_instance, const char *IMPELLER_NONNULL vulkan_proc_name, void *IMPELLER_NULLABLE user_data) |
A callback used by Impeller to allow the user to resolve Vulkan function pointers. A user supplied baton that is uninterpreted by Impeller is passed back to the user in the callback.
Definition at line 356 of file impeller.h.
enum ImpellerBlendMode |
Definition at line 374 of file impeller.h.
enum ImpellerBlurStyle |
Enumerator | |
---|---|
kImpellerBlurStyleNormal | |
kImpellerBlurStyleSolid | |
kImpellerBlurStyleOuter | |
kImpellerBlurStyleInner |
Definition at line 440 of file impeller.h.
Enumerator | |
---|---|
kImpellerClipOperationDifference | |
kImpellerClipOperationIntersect |
Definition at line 369 of file impeller.h.
enum ImpellerColorSpace |
Enumerator | |
---|---|
kImpellerColorSpaceSRGB | |
kImpellerColorSpaceExtendedSRGB | |
kImpellerColorSpaceDisplayP3 |
Definition at line 447 of file impeller.h.
enum ImpellerDrawStyle |
Enumerator | |
---|---|
kImpellerDrawStyleFill | |
kImpellerDrawStyleStroke | |
kImpellerDrawStyleStrokeAndFill |
Definition at line 406 of file impeller.h.
enum ImpellerFillType |
enum ImpellerFontStyle |
Enumerator | |
---|---|
kImpellerFontStyleNormal | |
kImpellerFontStyleItalic |
Definition at line 465 of file impeller.h.
enum ImpellerFontWeight |
Definition at line 453 of file impeller.h.
enum ImpellerPixelFormat |
enum ImpellerStrokeCap |
Enumerator | |
---|---|
kImpellerStrokeCapButt | |
kImpellerStrokeCapRound | |
kImpellerStrokeCapSquare |
Definition at line 412 of file impeller.h.
enum ImpellerStrokeJoin |
Enumerator | |
---|---|
kImpellerStrokeJoinMiter | |
kImpellerStrokeJoinRound | |
kImpellerStrokeJoinBevel |
Definition at line 418 of file impeller.h.
Enumerator | |
---|---|
kImpellerTextAlignmentLeft | |
kImpellerTextAlignmentRight | |
kImpellerTextAlignmentCenter | |
kImpellerTextAlignmentJustify | |
kImpellerTextAlignmentStart | |
kImpellerTextAlignmentEnd |
Definition at line 470 of file impeller.h.
Enumerator | |
---|---|
kImpellerTextDecorationStyleSolid | |
kImpellerTextDecorationStyleDouble | |
kImpellerTextDecorationStyleDotted | |
kImpellerTextDecorationStyleDashed | |
kImpellerTextDecorationStyleWavy |
Definition at line 491 of file impeller.h.
Enumerator | |
---|---|
kImpellerTextDecorationTypeNone | |
kImpellerTextDecorationTypeUnderline | |
kImpellerTextDecorationTypeOverline | |
kImpellerTextDecorationTypeLineThrough |
Definition at line 484 of file impeller.h.
Enumerator | |
---|---|
kImpellerTextDirectionRTL | |
kImpellerTextDirectionLTR |
Definition at line 479 of file impeller.h.
Enumerator | |
---|---|
kImpellerTextureSamplingNearestNeighbor | |
kImpellerTextureSamplingLinear |
Definition at line 428 of file impeller.h.
enum ImpellerTileMode |
Enumerator | |
---|---|
kImpellerTileModeClamp | |
kImpellerTileModeRepeat | |
kImpellerTileModeMirror | |
kImpellerTileModeDecal |
Definition at line 433 of file impeller.h.
IMPELLER_DEFINE_HANDLE | ( | ImpellerColorFilter | ) |
Color filters are functions that take two colors and mix them to produce a single color. This color is then merged with the destination during blending.
IMPELLER_DEFINE_HANDLE | ( | ImpellerColorSource | ) |
Color sources are functions that generate colors for each texture element covered by a draw call. The colors for each element can be generated using a mathematical function (to produce gradients for example) or sampled from a texture.
IMPELLER_DEFINE_HANDLE | ( | ImpellerContext | ) |
An Impeller graphics context. Contexts are platform and client-rendering-API specific.
Contexts are thread-safe objects that are expensive to create. Most applications will only ever create a single context during their lifetimes. Once setup, Impeller is ready to render frames as performantly as possible.
During setup, context create the underlying graphics pipelines, allocators, worker threads, etc...
The general guidance is to create as few contexts as possible (typically just one) and share them as much as possible.
IMPELLER_DEFINE_HANDLE | ( | ImpellerDisplayList | ) |
Display lists represent encoded rendering intent. These objects are immutable, reusable, thread-safe, and context-agnostic.
While it is perfectly fine to create new display lists per frame, there may be opportunities for optimization when display lists are reused multiple times.
IMPELLER_DEFINE_HANDLE | ( | ImpellerDisplayListBuilder | ) |
Display list builders allow for the incremental creation of display lists.
Display list builders are context-agnostic.
IMPELLER_DEFINE_HANDLE | ( | ImpellerFragmentProgram | ) |
A fragment shader is a small program that is authored in GLSL and compiled using impellerc
that runs on each pixel covered by a polygon and allows the user to configure how it is shaded.
IMPELLER_DEFINE_HANDLE | ( | ImpellerGlyphInfo | ) |
Describes the metrics of glyphs in a paragraph line.
IMPELLER_DEFINE_HANDLE | ( | ImpellerImageFilter | ) |
Image filters are functions that are applied regions of a texture to produce a single color. Contrast this with color filters that operate independently on a per-pixel basis. The generated color is then merged with the destination during blending.
IMPELLER_DEFINE_HANDLE | ( | ImpellerLineMetrics | ) |
Describes the metrics of lines in a fully laid out paragraph.
Regardless of how the string of text is specified to the paragraph builder, offsets into buffers that are returned by line metrics are always assumed to be into buffers of UTF-16 code units.
IMPELLER_DEFINE_HANDLE | ( | ImpellerMaskFilter | ) |
Mask filters are functions that are applied over a shape after it has been drawn but before it has been blended into the final image.
IMPELLER_DEFINE_HANDLE | ( | ImpellerPaint | ) |
Paints control the behavior of draw calls encoded in a display list.
Like display lists, paints are context-agnostic.
IMPELLER_DEFINE_HANDLE | ( | ImpellerParagraph | ) |
An immutable, fully laid out paragraph.
IMPELLER_DEFINE_HANDLE | ( | ImpellerParagraphBuilder | ) |
Paragraph builders allow for the creation of fully laid out paragraphs (which themselves are immutable).
To build a paragraph, users push/pop paragraph styles onto a stack then add UTF-8 encoded text. The properties on the top of paragraph style stack when the text is added are used to layout and shape that subset of the paragraph.
ImpellerParagraphStyle
IMPELLER_DEFINE_HANDLE | ( | ImpellerParagraphStyle | ) |
Specified when building a paragraph, paragraph styles are managed in a stack with specify text properties to apply to text that is added to the paragraph builder.
IMPELLER_DEFINE_HANDLE | ( | ImpellerPath | ) |
Represents a two-dimensional path that is immutable and graphics context agnostic.
Paths in Impeller consist of linear, cubic Bézier curve, and quadratic Bézier curve segments. All other shapes are approximations using these building blocks.
Paths are created using path builder that allow for the configuration of the path segments, how they are filled, and/or stroked.
IMPELLER_DEFINE_HANDLE | ( | ImpellerPathBuilder | ) |
Path builders allow for the incremental building up of paths.
IMPELLER_DEFINE_HANDLE | ( | ImpellerSurface | ) |
A surface represents a render target for Impeller to direct the rendering intent specified the form of display lists to.
Render targets are how Impeller API users perform Window System Integration (WSI). Users wrap swapchain images as surfaces and draw display lists onto these surfaces to present content.
Creating surfaces is typically platform and client-rendering-API specific.
IMPELLER_DEFINE_HANDLE | ( | ImpellerTexture | ) |
A reference to a texture whose data is resident on the GPU. These can be referenced in draw calls and paints.
Creating textures is extremely expensive. Creating a single one can typically comfortably blow the frame budget of an application. Textures should be created on background threads.
IMPELLER_DEFINE_HANDLE | ( | ImpellerTypographyContext | ) |
Typography contexts allow for the layout and rendering of text.
These are typically expensive to create and applications will only ever need to create a single one of these during their lifetimes.
Unlike graphics context, typograhy contexts are not thread-safe. These must be created, used, and collected on a single thread.
IMPELLER_DEFINE_HANDLE | ( | ImpellerVulkanSwapchain | ) |
The primary form of WSI when using a Vulkan context, these swapchains use the VK_KHR_surface
Vulkan extension.
Creating a swapchain is extremely expensive. One must be created at application startup and re-used throughout the application lifecycle.
Swapchains are resilient to the underlying surfaces being resized. The swapchain images will be re-created as necessary on-demand.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateBlendNew | ( | const ImpellerColor *IMPELLER_NONNULL | color, |
ImpellerBlendMode | blend_mode | ||
) |
Create a color filter that performs blending of pixel values independently.
[in] | color | The color. |
[in] | blend_mode | The blend mode. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateColorMatrixNew | ( | const ImpellerColorMatrix *IMPELLER_NONNULL | color_matrix | ) |
Create a color filter that transforms pixel color values independently.
[in] | color_matrix | The color matrix. |
IMPELLER_EXPORT void ImpellerColorFilterRelease | ( | ImpellerColorFilter IMPELLER_NULLABLE | color_filter | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | color_filter | The color filter. |
IMPELLER_EXPORT void ImpellerColorFilterRetain | ( | ImpellerColorFilter IMPELLER_NULLABLE | color_filter | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | color_filter | The color filter. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateConicalGradientNew | ( | const ImpellerPoint *IMPELLER_NONNULL | start_center, |
float | start_radius, | ||
const ImpellerPoint *IMPELLER_NONNULL | end_center, | ||
float | end_radius, | ||
uint32_t | stop_count, | ||
const ImpellerColor *IMPELLER_NONNULL | colors, | ||
const float *IMPELLER_NONNULL | stops, | ||
ImpellerTileMode | tile_mode, | ||
const ImpellerMatrix *IMPELLER_NULLABLE | transformation | ||
) |
Create a color source that forms a conical gradient.
[in] | start_center | The start center. |
[in] | start_radius | The start radius. |
[in] | end_center | The end center. |
[in] | end_radius | The end radius. |
[in] | stop_count | The stop count. |
[in] | colors | The colors. |
[in] | stops | The stops. |
[in] | tile_mode | The tile mode. |
[in] | transformation | The transformation. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateFragmentProgramNew | ( | ImpellerContext IMPELLER_NONNULL | context, |
ImpellerFragmentProgram IMPELLER_NONNULL | fragment_program, | ||
IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE | samplers, | ||
size_t | samplers_count, | ||
const uint8_t *IMPELLER_NULLABLE | data, | ||
size_t | data_bytes_length | ||
) |
Create a color source whose pixels are shaded by a fragment program.
[in] | context | The context. |
[in] | fragment_program | The fragment program. |
samplers | The samplers. | |
[in] | samplers_count | The samplers count. |
[in] | data | The data (copied). |
[in] | data_bytes_length | The data bytes length. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateImageNew | ( | ImpellerTexture IMPELLER_NONNULL | image, |
ImpellerTileMode | horizontal_tile_mode, | ||
ImpellerTileMode | vertical_tile_mode, | ||
ImpellerTextureSampling | sampling, | ||
const ImpellerMatrix *IMPELLER_NULLABLE | transformation | ||
) |
Create a color source that samples from an image.
[in] | image | The image. |
[in] | horizontal_tile_mode | The horizontal tile mode. |
[in] | vertical_tile_mode | The vertical tile mode. |
[in] | sampling | The sampling. |
[in] | transformation | The transformation. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateLinearGradientNew | ( | const ImpellerPoint *IMPELLER_NONNULL | start_point, |
const ImpellerPoint *IMPELLER_NONNULL | end_point, | ||
uint32_t | stop_count, | ||
const ImpellerColor *IMPELLER_NONNULL | colors, | ||
const float *IMPELLER_NONNULL | stops, | ||
ImpellerTileMode | tile_mode, | ||
const ImpellerMatrix *IMPELLER_NULLABLE | transformation | ||
) |
Create a color source that forms a linear gradient.
[in] | start_point | The start point. |
[in] | end_point | The end point. |
[in] | stop_count | The stop count. |
[in] | colors | The colors. |
[in] | stops | The stops. |
[in] | tile_mode | The tile mode. |
[in] | transformation | The transformation. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateRadialGradientNew | ( | const ImpellerPoint *IMPELLER_NONNULL | center, |
float | radius, | ||
uint32_t | stop_count, | ||
const ImpellerColor *IMPELLER_NONNULL | colors, | ||
const float *IMPELLER_NONNULL | stops, | ||
ImpellerTileMode | tile_mode, | ||
const ImpellerMatrix *IMPELLER_NULLABLE | transformation | ||
) |
Create a color source that forms a radial gradient.
[in] | center | The center. |
[in] | radius | The radius. |
[in] | stop_count | The stop count. |
[in] | colors | The colors. |
[in] | stops | The stops. |
[in] | tile_mode | The tile mode. |
[in] | transformation | The transformation. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateSweepGradientNew | ( | const ImpellerPoint *IMPELLER_NONNULL | center, |
float | start, | ||
float | end, | ||
uint32_t | stop_count, | ||
const ImpellerColor *IMPELLER_NONNULL | colors, | ||
const float *IMPELLER_NONNULL | stops, | ||
ImpellerTileMode | tile_mode, | ||
const ImpellerMatrix *IMPELLER_NULLABLE | transformation | ||
) |
Create a color source that forms a sweep gradient.
[in] | center | The center. |
[in] | start | The start. |
[in] | end | The end. |
[in] | stop_count | The stop count. |
[in] | colors | The colors. |
[in] | stops | The stops. |
[in] | tile_mode | The tile mode. |
[in] | transformation | The transformation. |
IMPELLER_EXPORT void ImpellerColorSourceRelease | ( | ImpellerColorSource IMPELLER_NULLABLE | color_source | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | color_source | The color source. |
IMPELLER_EXPORT void ImpellerColorSourceRetain | ( | ImpellerColorSource IMPELLER_NULLABLE | color_source | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | color_source | The color source. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateMetalNew | ( | uint32_t | version | ) |
Create a Metal context using the system default Metal device.
[in] | version | The version specified in the IMPELLER_VERSION macro. |
Referenced by main().
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateOpenGLESNew | ( | uint32_t | version, |
ImpellerProcAddressCallback IMPELLER_NONNULL | gl_proc_address_callback, | ||
void *IMPELLER_NULLABLE | gl_proc_address_callback_user_data | ||
) |
Create an OpenGL(ES) Impeller context.
[in] | version | The version of the Impeller standalone API. See ImpellerGetVersion . If the specified here is not compatible with the version of the library, context creation will fail and NULL context returned from this call. |
[in] | gl_proc_address_callback | The gl proc address callback. For instance, eglGetProcAddress . |
[in] | gl_proc_address_callback_user_data | The gl proc address callback user data baton. This pointer is not interpreted by Impeller and will be returned as user data in the proc address callback. user data. |
Referenced by main().
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateVulkanNew | ( | uint32_t | version, |
const ImpellerContextVulkanSettings *IMPELLER_NONNULL | settings | ||
) |
Create a Vulkan context using the provided Vulkan Settings.
[in] | version | The version specified in the IMPELLER_VERSION macro. |
[in] | settings | The Vulkan settings. |
Referenced by main().
IMPELLER_EXPORT bool ImpellerContextGetVulkanInfo | ( | ImpellerContext IMPELLER_NONNULL | context, |
ImpellerContextVulkanInfo *IMPELLER_NONNULL | out_vulkan_info | ||
) |
Get internal Vulkan handles managed by the given Vulkan context. Ownership of the handles is still maintained by Impeller. This accessor is just available so embedders can create resources using the same device and instance as Impeller for interop.
[in] | context | The context |
[out] | out_vulkan_info | The out vulkan information |
Referenced by main().
IMPELLER_EXPORT void ImpellerContextRelease | ( | ImpellerContext IMPELLER_NULLABLE | context | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | context | The context. |
Referenced by main().
IMPELLER_EXPORT void ImpellerContextRetain | ( | ImpellerContext IMPELLER_NULLABLE | context | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | context | The context. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipOval | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | oval_bounds, | ||
ImpellerClipOperation | op | ||
) |
Reduces the clip region to the intersection of the current clip and the given oval taking into account the clip operation.
[in] | builder | The builder. |
[in] | oval_bounds | The oval bounds. |
[in] | op | The operation. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipPath | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerPath IMPELLER_NONNULL | path, | ||
ImpellerClipOperation | op | ||
) |
Reduces the clip region to the intersection of the current clip and the given path taking into account the clip operation.
[in] | builder | The builder. |
[in] | path | The path. |
[in] | op | The operation. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipRect | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | rect, | ||
ImpellerClipOperation | op | ||
) |
Reduces the clip region to the intersection of the current clip and the given rectangle taking into account the clip operation.
[in] | builder | The builder. |
[in] | rect | The rectangle. |
[in] | op | The operation. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipRoundedRect | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | rect, | ||
const ImpellerRoundingRadii *IMPELLER_NONNULL | radii, | ||
ImpellerClipOperation | op | ||
) |
Reduces the clip region to the intersection of the current clip and the given rounded rectangle taking into account the clip operation.
[in] | builder | The builder. |
[in] | rect | The rectangle. |
[in] | radii | The radii. |
[in] | op | The operation. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayList IMPELLER_NULLABLE ImpellerDisplayListBuilderCreateDisplayListNew | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder | ) |
Create a new display list using the rendering intent already encoded in the builder. The builder is reset after this call.
[in] | builder | The builder. |
Referenced by main().
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawDashedLine | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerPoint *IMPELLER_NONNULL | from, | ||
const ImpellerPoint *IMPELLER_NONNULL | to, | ||
float | on_length, | ||
float | off_length, | ||
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Draws a dash line segment.
[in] | builder | The builder. |
[in] | from | The starting point of the line. |
[in] | to | The end point of the line. |
[in] | on_length | On length. |
[in] | off_length | Off length. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawDisplayList | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerDisplayList IMPELLER_NONNULL | display_list, | ||
float | opacity | ||
) |
Flattens the contents of another display list into the one currently being built.
[in] | builder | The builder. |
[in] | display_list | The display list. |
[in] | opacity | The opacity. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawLine | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerPoint *IMPELLER_NONNULL | from, | ||
const ImpellerPoint *IMPELLER_NONNULL | to, | ||
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Draws a line segment.
[in] | builder | The builder. |
[in] | from | The starting point of the line. |
[in] | to | The end point of the line. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawOval | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | oval_bounds, | ||
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Draws an oval.
[in] | builder | The builder. |
[in] | oval_bounds | The oval bounds. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPaint | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Fills the current clip with the specified paint.
[in] | builder | The builder. |
[in] | paint | The paint. |
Referenced by main().
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawParagraph | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerParagraph IMPELLER_NONNULL | paragraph, | ||
const ImpellerPoint *IMPELLER_NONNULL | point | ||
) |
Draw a paragraph at the specified point.
[in] | builder | The builder. |
[in] | paragraph | The paragraph. |
[in] | point | The point. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPath | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerPath IMPELLER_NONNULL | path, | ||
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Draws the specified shape.
[in] | builder | The builder. |
[in] | path | The path. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRect | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | rect, | ||
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Draws a rectangle.
[in] | builder | The builder. |
[in] | rect | The rectangle. |
[in] | paint | The paint. |
Referenced by main().
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRoundedRect | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | rect, | ||
const ImpellerRoundingRadii *IMPELLER_NONNULL | radii, | ||
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Draws a rounded rect.
[in] | builder | The builder. |
[in] | rect | The rectangle. |
[in] | radii | The radii. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRoundedRectDifference | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | outer_rect, | ||
const ImpellerRoundingRadii *IMPELLER_NONNULL | outer_radii, | ||
const ImpellerRect *IMPELLER_NONNULL | inner_rect, | ||
const ImpellerRoundingRadii *IMPELLER_NONNULL | inner_radii, | ||
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Draws a shape that is the different between the specified rectangles (each with configurable corner radii).
[in] | builder | The builder. |
[in] | outer_rect | The outer rectangle. |
[in] | outer_radii | The outer radii. |
[in] | inner_rect | The inner rectangle. |
[in] | inner_radii | The inner radii. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawShadow | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerPath IMPELLER_NONNULL | path, | ||
const ImpellerColor *IMPELLER_NONNULL | color, | ||
float | elevation, | ||
bool | occluder_is_transparent, | ||
float | device_pixel_ratio | ||
) |
Draw a shadow for a Path given a material elevation. If the occluding object is not opaque, additional hints (via the occluder_is_transparent
argument) must be provided to render the shadow correctly.
[in] | builder | The builder. |
[in] | path | The shadow path. |
[in] | color | The shadow color. |
[in] | elevation | The material elevation. |
[in] | occluder_is_transparent | If the object casting the shadow is transparent. |
[in] | device_pixel_ratio | The device pixel ratio. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTexture | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerTexture IMPELLER_NONNULL | texture, | ||
const ImpellerPoint *IMPELLER_NONNULL | point, | ||
ImpellerTextureSampling | sampling, | ||
ImpellerPaint IMPELLER_NULLABLE | paint | ||
) |
Draw a texture at the specified point.
[in] | builder | The builder. |
[in] | texture | The texture. |
[in] | point | The point. |
[in] | sampling | The sampling. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTextureRect | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerTexture IMPELLER_NONNULL | texture, | ||
const ImpellerRect *IMPELLER_NONNULL | src_rect, | ||
const ImpellerRect *IMPELLER_NONNULL | dst_rect, | ||
ImpellerTextureSampling | sampling, | ||
ImpellerPaint IMPELLER_NULLABLE | paint | ||
) |
Draw a portion of texture at the specified location.
[in] | builder | The builder. |
[in] | texture | The texture. |
[in] | src_rect | The source rectangle. |
[in] | dst_rect | The destination rectangle. |
[in] | sampling | The sampling. |
[in] | paint | The paint. |
IMPELLER_EXPORT uint32_t ImpellerDisplayListBuilderGetSaveCount | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder | ) |
Get the current size of the save stack.
[in] | builder | The builder. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderGetTransform | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
ImpellerMatrix *IMPELLER_NONNULL | out_transform | ||
) |
Get the transformation currently built up on the top of the transformation stack.
[in] | builder | The builder. |
[out] | out_transform | The transform. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE ImpellerDisplayListBuilderNew | ( | const ImpellerRect *IMPELLER_NULLABLE | cull_rect | ) |
Create a new display list builder.
An optional cull rectangle may be specified. Impeller is allowed to treat the contents outside this rectangle as being undefined. This may aid performance optimizations.
[in] | cull_rect | The cull rectangle or NULL. |
Referenced by main().
IMPELLER_EXPORT void ImpellerDisplayListBuilderRelease | ( | ImpellerDisplayListBuilder IMPELLER_NULLABLE | builder | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | builder | The display list builder. |
Referenced by main().
IMPELLER_EXPORT void ImpellerDisplayListBuilderResetTransform | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder | ) |
Reset the transformation on top of the transformation stack to identity.
[in] | builder | The builder. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestore | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder | ) |
Pops the last entry pushed onto the save stack using a call to ImpellerDisplayListBuilderSave
or ImpellerDisplayListBuilderSaveLayer
.
[in] | builder | The builder. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestoreToCount | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
uint32_t | count | ||
) |
Effectively calls ImpellerDisplayListBuilderRestore till the size of the save stack becomes a specified count.
[in] | builder | The builder. |
[in] | count | The count. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderRetain | ( | ImpellerDisplayListBuilder IMPELLER_NULLABLE | builder | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | builder | The display list builder. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderRotate | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
float | angle_degrees | ||
) |
Apply a clockwise rotation to the transformation matrix currently on top of the save stack.
[in] | builder | The builder. |
[in] | angle_degrees | The angle in degrees. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderSave | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder | ) |
Stashes the current transformation and clip state onto a save stack.
[in] | builder | The builder. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderSaveLayer | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | bounds, | ||
ImpellerPaint IMPELLER_NULLABLE | paint, | ||
ImpellerImageFilter IMPELLER_NULLABLE | backdrop | ||
) |
Stashes the current transformation and clip state onto a save stack and creates and creates an offscreen layer onto which subsequent rendering intent will be directed to.
On the balancing call to restore, the supplied paints filters and blend modes will be used to composite the offscreen contents back onto the display display list.
[in] | builder | The builder. |
[in] | bounds | The bounds. |
[in] | paint | The paint. |
[in] | backdrop | The backdrop. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderScale | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
float | x_scale, | ||
float | y_scale | ||
) |
Apply a scale to the transformation matrix currently on top of the save stack.
[in] | builder | The builder. |
[in] | x_scale | The x scale. |
[in] | y_scale | The y scale. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderSetTransform | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerMatrix *IMPELLER_NONNULL | transform | ||
) |
Clear the transformation on top of the save stack and replace it with a new value.
[in] | builder | The builder. |
[in] | transform | The new transform. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderTransform | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
const ImpellerMatrix *IMPELLER_NONNULL | transform | ||
) |
Appends the the provided transformation to the transformation already on the save stack.
[in] | builder | The builder. |
[in] | transform | The transform to append. |
IMPELLER_EXPORT void ImpellerDisplayListBuilderTranslate | ( | ImpellerDisplayListBuilder IMPELLER_NONNULL | builder, |
float | x_translation, | ||
float | y_translation | ||
) |
Apply a translation to the transformation matrix currently on top of the save stack.
[in] | builder | The builder. |
[in] | x_translation | The x translation. |
[in] | y_translation | The y translation. |
IMPELLER_EXPORT void ImpellerDisplayListRelease | ( | ImpellerDisplayList IMPELLER_NULLABLE | display_list | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | display_list | The display list. |
Referenced by main().
IMPELLER_EXPORT void ImpellerDisplayListRetain | ( | ImpellerDisplayList IMPELLER_NULLABLE | display_list | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | display_list | The display list. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerFragmentProgram IMPELLER_NULLABLE ImpellerFragmentProgramNew | ( | const ImpellerMapping *IMPELLER_NONNULL | data, |
void *IMPELLER_NULLABLE | data_release_user_data | ||
) |
Create a new fragment program using data obtained by compiling a GLSL shader with impellerc
.
impellerc
. Providing raw GLSL strings will lead to a nullptr
return. Impeller does not compile shaders at runtime.[in] | data | The data compiled by impellerc . |
data_release_user_data | A baton passed back to the caller on the invocation of the mappings release callback. This call can happen on any thread. |
IMPELLER_EXPORT void ImpellerFragmentProgramRelease | ( | ImpellerFragmentProgram IMPELLER_NULLABLE | fragment_program | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | fragment_program | The fragment program. |
IMPELLER_EXPORT void ImpellerFragmentProgramRetain | ( | ImpellerFragmentProgram IMPELLER_NULLABLE | fragment_program | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | fragment_program | The fragment program. |
IMPELLER_EXPORT uint32_t ImpellerGetVersion | ( | ) |
Get the version of Impeller standalone API. This is the API that will be accepted for validity checks when provided to the context creation methods.
The current version of the API is denoted by the IMPELLER_VERSION
macro. This version must be passed to APIs that create top-level objects like graphics contexts. Construction of the context may fail if the API version expected by the caller is not supported by the library.
Since there are no API stability guarantees today, passing a version that is different to the one returned by ImpellerGetVersion
will always fail.
ImpellerContextCreateOpenGLESNew
IMPELLER_EXPORT void ImpellerGlyphInfoGetGraphemeClusterBounds | ( | ImpellerGlyphInfo IMPELLER_NONNULL | glyph_info, |
ImpellerRect *IMPELLER_NONNULL | out_bounds | ||
) |
Fetch the bounds of the grapheme cluster for the glyph in the coordinate space of the paragraph.
[in] | glyph_info | The glyph information. |
[out] | out_bounds | The grapheme cluster bounds. |
IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin | ( | ImpellerGlyphInfo IMPELLER_NONNULL | glyph_info | ) |
Fetch the start index in the buffer of UTF-16 code units used to represent the grapheme cluster for a glyph.
[in] | glyph_info | The glyph information. |
IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd | ( | ImpellerGlyphInfo IMPELLER_NONNULL | glyph_info | ) |
Fetch the end index in the buffer of UTF-16 code units used to represent the grapheme cluster for a glyph.
[in] | glyph_info | The glyph information. |
IMPELLER_EXPORT ImpellerTextDirection ImpellerGlyphInfoGetTextDirection | ( | ImpellerGlyphInfo IMPELLER_NONNULL | glyph_info | ) |
[in] | glyph_info | The glyph information. |
IMPELLER_EXPORT bool ImpellerGlyphInfoIsEllipsis | ( | ImpellerGlyphInfo IMPELLER_NONNULL | glyph_info | ) |
[in] | glyph_info | The glyph information. |
IMPELLER_EXPORT void ImpellerGlyphInfoRelease | ( | ImpellerGlyphInfo IMPELLER_NULLABLE | glyph_info | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | glyph_info | The glyph information. |
IMPELLER_EXPORT void ImpellerGlyphInfoRetain | ( | ImpellerGlyphInfo IMPELLER_NULLABLE | glyph_info | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | glyph_info | The glyph information. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateBlurNew | ( | float | x_sigma, |
float | y_sigma, | ||
ImpellerTileMode | tile_mode | ||
) |
Creates an image filter that applies a Gaussian blur.
The Gaussian blur applied may be an approximation for performance.
[in] | x_sigma | The x sigma. |
[in] | y_sigma | The y sigma. |
[in] | tile_mode | The tile mode. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateComposeNew | ( | ImpellerImageFilter IMPELLER_NONNULL | outer, |
ImpellerImageFilter IMPELLER_NONNULL | inner | ||
) |
Creates a composed filter that when applied is identical to subsequently applying the inner and then the outer filters.
``` destination = outer_filter(inner_filter(source)) ```
[in] | outer | The outer image filter. |
[in] | inner | The inner image filter. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateDilateNew | ( | float | x_radius, |
float | y_radius | ||
) |
Creates an image filter that enhances the per-channel pixel values to the maximum value in a circle around the pixel.
[in] | x_radius | The x radius. |
[in] | y_radius | The y radius. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateErodeNew | ( | float | x_radius, |
float | y_radius | ||
) |
Creates an image filter that dampens the per-channel pixel values to the minimum value in a circle around the pixel.
[in] | x_radius | The x radius. |
[in] | y_radius | The y radius. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateFragmentProgramNew | ( | ImpellerContext IMPELLER_NONNULL | context, |
ImpellerFragmentProgram IMPELLER_NONNULL | fragment_program, | ||
IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE | samplers, | ||
size_t | samplers_count, | ||
const uint8_t *IMPELLER_NULLABLE | data, | ||
size_t | data_bytes_length | ||
) |
Create an image filter where each pixel is shaded by a fragment program.
[in] | context | The context. |
[in] | fragment_program | The fragment program. |
samplers | The samplers. | |
[in] | samplers_count | The samplers count. |
[in] | data | The data (copied). |
[in] | data_bytes_length | The data bytes length. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateMatrixNew | ( | const ImpellerMatrix *IMPELLER_NONNULL | matrix, |
ImpellerTextureSampling | sampling | ||
) |
Creates an image filter that applies a transformation matrix to the underlying image.
[in] | matrix | The transformation matrix. |
[in] | sampling | The image sampling mode. |
IMPELLER_EXPORT void ImpellerImageFilterRelease | ( | ImpellerImageFilter IMPELLER_NULLABLE | image_filter | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | image_filter | The image filter. |
IMPELLER_EXPORT void ImpellerImageFilterRetain | ( | ImpellerImageFilter IMPELLER_NULLABLE | image_filter | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | image_filter | The image filter. |
IMPELLER_EXPORT double ImpellerLineMetricsGetAscent | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
The rise from the baseline as calculated from the font and style for this line.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT double ImpellerLineMetricsGetBaseline | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
The y coordinate of the baseline for this line from the top of the paragraph.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndex | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
Fetch the end index in the buffer of UTF-16 code units used to represent the paragraph line.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
Fetch the end index (excluding whitespace) in the buffer of UTF-16 code units used to represent the paragraph line.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
Fetch the end index (including newlines) in the buffer of UTF-16 code units used to represent the paragraph line.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitStartIndex | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
Fetch the start index in the buffer of UTF-16 code units used to represent the paragraph line.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT double ImpellerLineMetricsGetDescent | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
The drop from the baseline as calculated from the font and style for this line.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT double ImpellerLineMetricsGetHeight | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
Total height of the line from the top edge to the bottom edge.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT double ImpellerLineMetricsGetLeft | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
The x coordinate of left edge of the line.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT double ImpellerLineMetricsGetUnscaledAscent | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
The rise from the baseline as calculated from the font and style for this line ignoring the height from the text style.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT double ImpellerLineMetricsGetWidth | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
Width of the line from the left edge of the leftmost glyph to the right edge of the rightmost glyph.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT bool ImpellerLineMetricsIsHardbreak | ( | ImpellerLineMetrics IMPELLER_NONNULL | metrics, |
size_t | line | ||
) |
Used to determine if this line ends with an explicit line break (e.g. '
') or is the end of the paragraph.
[in] | metrics | The metrics. |
[in] | line | The line index (zero based). |
IMPELLER_EXPORT void ImpellerLineMetricsRelease | ( | ImpellerLineMetrics IMPELLER_NULLABLE | line_metrics | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | line_metrics | The line metrics. |
IMPELLER_EXPORT void ImpellerLineMetricsRetain | ( | ImpellerLineMetrics IMPELLER_NULLABLE | line_metrics | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | line_metrics | The line metrics. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerMaskFilter IMPELLER_NULLABLE ImpellerMaskFilterCreateBlurNew | ( | ImpellerBlurStyle | style, |
float | sigma | ||
) |
Create a mask filter that blurs contents in the masked shape.
[in] | style | The style. |
[in] | sigma | The sigma. |
IMPELLER_EXPORT void ImpellerMaskFilterRelease | ( | ImpellerMaskFilter IMPELLER_NULLABLE | mask_filter | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | mask_filter | The mask filter. |
IMPELLER_EXPORT void ImpellerMaskFilterRetain | ( | ImpellerMaskFilter IMPELLER_NULLABLE | mask_filter | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | mask_filter | The mask filter. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE ImpellerPaintNew | ( | ) |
IMPELLER_EXPORT void ImpellerPaintRelease | ( | ImpellerPaint IMPELLER_NULLABLE | paint | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | paint | The paint. |
Referenced by main().
IMPELLER_EXPORT void ImpellerPaintRetain | ( | ImpellerPaint IMPELLER_NULLABLE | paint | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerPaintSetBlendMode | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
ImpellerBlendMode | mode | ||
) |
Set the paint blend mode. The blend mode controls how the new paints contents are mixed with the values already drawn using previous draw calls.
[in] | paint | The paint. |
[in] | mode | The mode. |
IMPELLER_EXPORT void ImpellerPaintSetColor | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
const ImpellerColor *IMPELLER_NONNULL | color | ||
) |
IMPELLER_EXPORT void ImpellerPaintSetColorFilter | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
ImpellerColorFilter IMPELLER_NONNULL | color_filter | ||
) |
Set the color filter of the paint.
Color filters are functions that take two colors and mix them to produce a single color. This color is then usually merged with the destination during blending.
[in] | paint | The paint. |
[in] | color_filter | The color filter. |
IMPELLER_EXPORT void ImpellerPaintSetColorSource | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
ImpellerColorSource IMPELLER_NONNULL | color_source | ||
) |
Set the color source of the paint.
Color sources are functions that generate colors for each texture element covered by a draw call.
[in] | paint | The paint. |
[in] | color_source | The color source. |
IMPELLER_EXPORT void ImpellerPaintSetDrawStyle | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
ImpellerDrawStyle | style | ||
) |
Set the paint draw style. The style controls if the closed shapes are filled and/or stroked.
[in] | paint | The paint. |
[in] | style | The style. |
IMPELLER_EXPORT void ImpellerPaintSetImageFilter | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
ImpellerImageFilter IMPELLER_NONNULL | image_filter | ||
) |
Set the image filter of a paint.
Image filters are functions that are applied to regions of a texture to produce a single color.
[in] | paint | The paint. |
[in] | image_filter | The image filter. |
IMPELLER_EXPORT void ImpellerPaintSetMaskFilter | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
ImpellerMaskFilter IMPELLER_NONNULL | mask_filter | ||
) |
Set the mask filter of a paint.
[in] | paint | The paint. |
[in] | mask_filter | The mask filter. |
IMPELLER_EXPORT void ImpellerPaintSetStrokeCap | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
ImpellerStrokeCap | cap | ||
) |
Sets how strokes rendered using this paint are capped.
[in] | paint | The paint. |
[in] | cap | The stroke cap style. |
IMPELLER_EXPORT void ImpellerPaintSetStrokeJoin | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
ImpellerStrokeJoin | join | ||
) |
Sets how strokes rendered using this paint are joined.
[in] | paint | The paint. |
[in] | join | The join. |
IMPELLER_EXPORT void ImpellerPaintSetStrokeMiter | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
float | miter | ||
) |
Set the miter limit of the strokes rendered using this paint.
[in] | paint | The paint. |
[in] | miter | The miter limit. |
IMPELLER_EXPORT void ImpellerPaintSetStrokeWidth | ( | ImpellerPaint IMPELLER_NONNULL | paint, |
float | width | ||
) |
Set the width of the strokes rendered using this paint.
[in] | paint | The paint. |
[in] | width | The width. |
IMPELLER_EXPORT void ImpellerParagraphBuilderAddText | ( | ImpellerParagraphBuilder IMPELLER_NONNULL | paragraph_builder, |
const uint8_t *IMPELLER_NULLABLE | data, | ||
uint32_t | length | ||
) |
Add UTF-8 encoded text to the paragraph. The text will be styled according to the paragraph style already on top of the paragraph style stack.
[in] | paragraph_builder | The paragraph builder. |
[in] | data | The data. |
[in] | length | The length. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraph IMPELLER_NULLABLE ImpellerParagraphBuilderBuildParagraphNew | ( | ImpellerParagraphBuilder IMPELLER_NONNULL | paragraph_builder, |
float | width | ||
) |
Layout and build a new paragraph using the specified width. The resulting paragraph is immutable. The paragraph builder must be discarded and a new one created to build more paragraphs.
[in] | paragraph_builder | The paragraph builder. |
[in] | width | The paragraph width. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE ImpellerParagraphBuilderNew | ( | ImpellerTypographyContext IMPELLER_NONNULL | context | ) |
Create a new paragraph builder.
[in] | context | The context. |
IMPELLER_EXPORT void ImpellerParagraphBuilderPopStyle | ( | ImpellerParagraphBuilder IMPELLER_NONNULL | paragraph_builder | ) |
Pop a previously pushed paragraph style from the paragraph style stack.
[in] | paragraph_builder | The paragraph builder. |
IMPELLER_EXPORT void ImpellerParagraphBuilderPushStyle | ( | ImpellerParagraphBuilder IMPELLER_NONNULL | paragraph_builder, |
ImpellerParagraphStyle IMPELLER_NONNULL | style | ||
) |
Push a new paragraph style onto the paragraph style stack managed by the paragraph builder.
Not all paragraph styles can be combined. For instance, it does not make sense to mix text alignment for different text runs within a paragraph. In such cases, the preference of the the first paragraph style on the style stack will take hold.
If text is pushed onto the paragraph builder without a style previously pushed onto the stack, a default paragraph text style will be used. This may not always be desirable because some style element cannot be overridden. It is recommended that a default paragraph style always be pushed onto the stack before the addition of any text.
[in] | paragraph_builder | The paragraph builder. |
[in] | style | The style. |
IMPELLER_EXPORT void ImpellerParagraphBuilderRelease | ( | ImpellerParagraphBuilder IMPELLER_NULLABLE | paragraph_builder | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | paragraph_builder | The paragraph_builder. |
IMPELLER_EXPORT void ImpellerParagraphBuilderRetain | ( | ImpellerParagraphBuilder IMPELLER_NULLABLE | paragraph_builder | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | paragraph_builder | The paragraph builder. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph, |
size_t | code_unit_index | ||
) |
Create a new instance of glyph info that can be queried for information about the glyph at the given UTF-16 code unit index. The instance must be freed using ImpellerGlyphInfoRelease
.
[in] | paragraph | The paragraph. |
[in] | code_unit_index | The UTF-16 code unit index. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph, |
double | x, | ||
double | y | ||
) |
Create a new instance of glyph info that can be queried for information about the glyph closest to the specified coordinates relative to the origin of the paragraph. The instance must be freed using ImpellerGlyphInfoRelease
.
[in] | paragraph | The paragraph. |
[in] | x | The x coordinate relative to paragraph origin. |
[in] | y | The x coordinate relative to paragraph origin. |
Referenced by IMPELLER_HPP_NAMESPACE::Paragraph::GlyphInfoAtParagraphCoordinates().
IMPELLER_EXPORT float ImpellerParagraphGetAlphabeticBaseline | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT float ImpellerParagraphGetHeight | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT float ImpellerParagraphGetIdeographicBaseline | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT uint32_t ImpellerParagraphGetLineCount | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT ImpellerLineMetrics IMPELLER_NULLABLE ImpellerParagraphGetLineMetrics | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
Get the line metrics of this laid out paragraph. Calculating the line metrics is expensive. The first time line metrics are requested, they will be cached along with the paragraph (which is immutable).
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT float ImpellerParagraphGetLongestLineWidth | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT float ImpellerParagraphGetMaxIntrinsicWidth | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT float ImpellerParagraphGetMaxWidth | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT float ImpellerParagraphGetMinIntrinsicWidth | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph | ) |
ImpellerParagraphGetMaxWidth
[in] | paragraph | The paragraph. |
ImpellerParagraphGetMaxWidth
. IMPELLER_EXPORT void ImpellerParagraphGetWordBoundary | ( | ImpellerParagraph IMPELLER_NONNULL | paragraph, |
size_t | code_unit_index, | ||
ImpellerRange *IMPELLER_NONNULL | out_range | ||
) |
Get the range into the UTF-16 code unit buffer that represents the word at the specified caret location in the same buffer.
Word boundaries are defined more precisely in Unicode Standard Annex #29
[in] | paragraph | The paragraph |
[in] | code_unit_index | The code unit index |
[out] | code_unit_index | The range. |
IMPELLER_EXPORT void ImpellerParagraphRelease | ( | ImpellerParagraph IMPELLER_NULLABLE | paragraph | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT void ImpellerParagraphRetain | ( | ImpellerParagraph IMPELLER_NULLABLE | paragraph | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | paragraph | The paragraph. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphStyle IMPELLER_NULLABLE ImpellerParagraphStyleNew | ( | ) |
Create a new paragraph style.
IMPELLER_EXPORT void ImpellerParagraphStyleRelease | ( | ImpellerParagraphStyle IMPELLER_NULLABLE | paragraph_style | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | paragraph_style | The paragraph style. |
IMPELLER_EXPORT void ImpellerParagraphStyleRetain | ( | ImpellerParagraphStyle IMPELLER_NULLABLE | paragraph_style | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | paragraph_style | The paragraph style. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetBackground | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Set the paint used to render the background of the text glyphs.
[in] | paragraph_style | The paragraph style. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetEllipsis | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
const char *IMPELLER_NULLABLE | ellipsis | ||
) |
Set the UTF-8 string to use as the ellipsis. Pass nullptr
to clear the setting to default.
[in] | paragraph_style | The paragraph style. |
[in] | data | The ellipsis string UTF-8 data, or null. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontFamily | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
const char *IMPELLER_NONNULL | family_name | ||
) |
Set the font family.
[in] | paragraph_style | The paragraph style. |
[in] | family_name | The family name. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontSize | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
float | size | ||
) |
Set the font size.
[in] | paragraph_style | The paragraph style. |
[in] | size | The size. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontStyle | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
ImpellerFontStyle | style | ||
) |
Set whether the glyphs should be bolded or italicized.
[in] | paragraph_style | The paragraph style. |
[in] | style | The style. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontWeight | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
ImpellerFontWeight | weight | ||
) |
Set the weight of the font to select when rendering glyphs.
[in] | paragraph_style | The paragraph style. |
[in] | weight | The weight. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetForeground | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
ImpellerPaint IMPELLER_NONNULL | paint | ||
) |
Set the paint used to render the text glyph contents.
[in] | paragraph_style | The paragraph style. |
[in] | paint | The paint. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetHeight | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
float | height | ||
) |
The height of the text as a multiple of text size.
When height is 0.0, the line height will be determined by the font's metrics directly, which may differ from the font size. Otherwise the line height of the text will be a multiple of font size, and be exactly fontSize * height logical pixels tall.
[in] | paragraph_style | The paragraph style. |
[in] | height | The height. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetLocale | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
const char *IMPELLER_NONNULL | locale | ||
) |
Set the paragraph locale.
[in] | paragraph_style | The paragraph style. |
[in] | locale | The locale. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetMaxLines | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
uint32_t | max_lines | ||
) |
Set the maximum line count within the paragraph.
[in] | paragraph_style | The paragraph style. |
[in] | max_lines | The maximum lines. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextAlignment | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
ImpellerTextAlignment | align | ||
) |
Set the alignment of text within the paragraph.
[in] | paragraph_style | The paragraph style. |
[in] | align | The align. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextDecoration | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
const ImpellerTextDecoration *IMPELLER_NONNULL | decoration | ||
) |
Set one of more text decorations on the paragraph. Decorations can be underlines, overlines, strikethroughs, etc.. The style of decorations can be set as well (dashed, dotted, wavy, etc..)
[in] | ImpellerParagraphStyle | The paragraph style. |
[in] | decoration | The text decoration. |
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextDirection | ( | ImpellerParagraphStyle IMPELLER_NONNULL | paragraph_style, |
ImpellerTextDirection | direction | ||
) |
Set the directionality of the text within the paragraph.
[in] | paragraph_style | The paragraph style. |
[in] | direction | The direction. |
IMPELLER_EXPORT void ImpellerPathBuilderAddArc | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | oval_bounds, | ||
float | start_angle_degrees, | ||
float | end_angle_degrees | ||
) |
Add an arc to the path.
[in] | builder | The builder. |
[in] | oval_bounds | The oval bounds. |
[in] | start_angle_degrees | The start angle in degrees. |
[in] | end_angle_degrees | The end angle in degrees. |
IMPELLER_EXPORT void ImpellerPathBuilderAddOval | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | oval_bounds | ||
) |
Add an oval to the path.
[in] | builder | The builder. |
[in] | oval_bounds | The oval bounds. |
IMPELLER_EXPORT void ImpellerPathBuilderAddRect | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | rect | ||
) |
Adds a rectangle to the path.
[in] | builder | The builder. |
[in] | rect | The rectangle. |
IMPELLER_EXPORT void ImpellerPathBuilderAddRoundedRect | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
const ImpellerRect *IMPELLER_NONNULL | rect, | ||
const ImpellerRoundingRadii *IMPELLER_NONNULL | rounding_radii | ||
) |
Add a rounded rect with potentially non-uniform radii to the path.
[in] | builder | The builder. |
[in] | rect | The rectangle. |
[in] | rounding_radii | The rounding radii. |
IMPELLER_EXPORT void ImpellerPathBuilderClose | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder | ) |
Close the path.
[in] | builder | The builder. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE ImpellerPathBuilderCopyPathNew | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
ImpellerFillType | fill | ||
) |
Create a new path by copying the existing built-up path. The existing path can continue being added to.
[in] | builder | The builder. |
[in] | fill | The fill. |
IMPELLER_EXPORT void ImpellerPathBuilderCubicCurveTo | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
const ImpellerPoint *IMPELLER_NONNULL | control_point_1, | ||
const ImpellerPoint *IMPELLER_NONNULL | control_point_2, | ||
const ImpellerPoint *IMPELLER_NONNULL | end_point | ||
) |
Add a cubic curve whose start point is current cursor location to the specified end point using the two specified control points.
The new location of the cursor after this call is the end point supplied.
[in] | builder | The builder |
[in] | control_point_1 | The control point 1 |
[in] | control_point_2 | The control point 2 |
[in] | end_point | The end point |
IMPELLER_EXPORT void ImpellerPathBuilderLineTo | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
const ImpellerPoint *IMPELLER_NONNULL | location | ||
) |
Add a line segment from the current cursor location to the given location. The cursor location is updated to be at the endpoint.
[in] | builder | The builder. |
[in] | location | The location. |
IMPELLER_EXPORT void ImpellerPathBuilderMoveTo | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
const ImpellerPoint *IMPELLER_NONNULL | location | ||
) |
Move the cursor to the specified location.
[in] | builder | The builder. |
[in] | location | The location. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPathBuilder IMPELLER_NULLABLE ImpellerPathBuilderNew | ( | ) |
Create a new path builder. Paths themselves are immutable. A builder builds these immutable paths.
IMPELLER_EXPORT void ImpellerPathBuilderQuadraticCurveTo | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
const ImpellerPoint *IMPELLER_NONNULL | control_point, | ||
const ImpellerPoint *IMPELLER_NONNULL | end_point | ||
) |
Add a quadratic curve from whose start point is the cursor to the specified end point using the a single control point.
The new location of the cursor after this call is the end point.
[in] | builder | The builder. |
[in] | control_point | The control point. |
[in] | end_point | The end point. |
IMPELLER_EXPORT void ImpellerPathBuilderRelease | ( | ImpellerPathBuilder IMPELLER_NULLABLE | builder | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | builder | The builder. |
IMPELLER_EXPORT void ImpellerPathBuilderRetain | ( | ImpellerPathBuilder IMPELLER_NULLABLE | builder | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | builder | The builder. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE ImpellerPathBuilderTakePathNew | ( | ImpellerPathBuilder IMPELLER_NONNULL | builder, |
ImpellerFillType | fill | ||
) |
Create a new path using the existing built-up path. The existing path builder now contains an empty path.
[in] | builder | The builder. |
[in] | fill | The fill. |
IMPELLER_EXPORT void ImpellerPathGetBounds | ( | ImpellerPath IMPELLER_NONNULL | path, |
ImpellerRect *IMPELLER_NONNULL | out_bounds | ||
) |
Get the bounds of the path.
The bounds are conservative. That is, they may be larger than the actual shape of the path and could include the control points and isolated calls to move the cursor.
[in] | path | The path |
[out] | out_bounds | The conservative bounds of the path. |
IMPELLER_EXPORT void ImpellerPathRelease | ( | ImpellerPath IMPELLER_NULLABLE | path | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | path | The path. |
IMPELLER_EXPORT void ImpellerPathRetain | ( | ImpellerPath IMPELLER_NULLABLE | path | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | path | The path. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedFBONew | ( | ImpellerContext IMPELLER_NONNULL | context, |
uint64_t | fbo, | ||
ImpellerPixelFormat | format, | ||
const ImpellerISize *IMPELLER_NONNULL | size | ||
) |
Create a new surface by wrapping an existing framebuffer object. The framebuffer must be complete as determined by glCheckFramebufferStatus
. The framebuffer is still owned by the caller and it must be collected once the surface is collected.
[in] | context | The context. |
[in] | fbo | The framebuffer object handle. |
[in] | format | The format of the framebuffer. |
[in] | size | The size of the framebuffer is texels. |
Referenced by main().
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedMetalDrawableNew | ( | ImpellerContext IMPELLER_NONNULL | context, |
void *IMPELLER_NONNULL | metal_drawable | ||
) |
Create a surface by wrapping a Metal drawable. This is useful during WSI when the drawable is the backing store of the Metal layer being drawn to.
The Metal layer must be using the same device managed by the underlying context.
[in] | context | The context. The Metal device managed by this context must be the same used to create the drawable that is being wrapped. |
metal_drawable | The drawable to wrap as a surface. |
Referenced by main().
IMPELLER_EXPORT bool ImpellerSurfaceDrawDisplayList | ( | ImpellerSurface IMPELLER_NONNULL | surface, |
ImpellerDisplayList IMPELLER_NONNULL | display_list | ||
) |
Draw a display list onto the surface. The same display list can be drawn multiple times to different surfaces.
[in] | surface | The surface to draw the display list to. |
[in] | display_list | The display list to draw onto the surface. |
Referenced by main().
IMPELLER_EXPORT bool ImpellerSurfacePresent | ( | ImpellerSurface IMPELLER_NONNULL | surface | ) |
Present the surface to the underlying window system.
[in] | surface | The surface to present. |
Referenced by main().
IMPELLER_EXPORT void ImpellerSurfaceRelease | ( | ImpellerSurface IMPELLER_NULLABLE | surface | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | surface | The surface. |
Referenced by main().
IMPELLER_EXPORT void ImpellerSurfaceRetain | ( | ImpellerSurface IMPELLER_NULLABLE | surface | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | surface | The surface. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE ImpellerTextureCreateWithContentsNew | ( | ImpellerContext IMPELLER_NONNULL | context, |
const ImpellerTextureDescriptor *IMPELLER_NONNULL | descriptor, | ||
const ImpellerMapping *IMPELLER_NONNULL | contents, | ||
void *IMPELLER_NULLABLE | contents_on_release_user_data | ||
) |
Create a texture with decompressed bytes.
Impeller will do its best to perform the transfer of this data to GPU memory with a minimal number of copies. Towards this end, it may need to send this data to a different thread for preparation and transfer. To facilitate this transfer, it is recommended that the content mapping have a release callback attach to it. When there is a release callback, Impeller assumes that collection of the data can be deferred till texture upload is done and can happen on a background thread. When there is no release callback, Impeller may try to perform an eager copy of the data if it needs to perform data preparation and transfer on a background thread. Whether an extra data copy actually occurs will always depend on the rendering backend in use. But it is best practice to provide a release callback and be resilient to the data being released in a deferred manner on a background thread.
[in] | context | The context. |
[in] | descriptor | The texture descriptor. |
[in] | contents | The contents. |
[in] | contents_on_release_user_data | The baton passes to the contents release callback if one exists. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE ImpellerTextureCreateWithOpenGLTextureHandleNew | ( | ImpellerContext IMPELLER_NONNULL | context, |
const ImpellerTextureDescriptor *IMPELLER_NONNULL | descriptor, | ||
uint64_t | handle | ||
) |
Create a texture with an externally created OpenGL texture handle.
Ownership of the handle is transferred over to Impeller after a successful call to this method. Impeller is responsible for calling glDeleteTextures on this handle. Do not collect this handle yourself as this will lead to a double-free.
The handle must be created in the same context as the one used by Impeller. If a different context is used, that context must be in the same sharegroup as Impellers OpenGL context and all synchronization of texture contents must already be complete.
If the context is not an OpenGL context, this call will always fail.
[in] | context | The context |
[in] | descriptor | The descriptor |
[in] | handle | The handle |
IMPELLER_EXPORT uint64_t ImpellerTextureGetOpenGLHandle | ( | ImpellerTexture IMPELLER_NONNULL | texture | ) |
Get the OpenGL handle associated with this texture. If this is not an OpenGL texture, this method will always return 0.
OpenGL handles are lazily created, this method will return GL_NONE is no OpenGL handle is available. To ensure that this call eagerly creates an OpenGL texture, call this on a thread where Impeller knows there is an OpenGL context available.
[in] | texture | The texture. |
IMPELLER_EXPORT void ImpellerTextureRelease | ( | ImpellerTexture IMPELLER_NULLABLE | texture | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | texture | The texture. |
IMPELLER_EXPORT void ImpellerTextureRetain | ( | ImpellerTexture IMPELLER_NULLABLE | texture | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | texture | The texture. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE ImpellerTypographyContextNew | ( | ) |
Create a new typography contents.
IMPELLER_EXPORT bool ImpellerTypographyContextRegisterFont | ( | ImpellerTypographyContext IMPELLER_NONNULL | context, |
const ImpellerMapping *IMPELLER_NONNULL | contents, | ||
void *IMPELLER_NULLABLE | contents_on_release_user_data, | ||
const char *IMPELLER_NULLABLE | family_name_alias | ||
) |
Register a custom font.
The following font formats are supported: * OpenType font collections (.ttc extension) * TrueType fonts: (.ttf extension) * OpenType fonts: (.otf extension)
The font data is specified as a mapping. It is possible for the release callback of the mapping to not be called even past the destruction of the typography context. Care must be taken to not collect the mapping till the release callback is invoked by Impeller.
The family alias name can be NULL. In such cases, the font family specified in paragraph styles must match the family that is specified in the font data.
If the family name alias is not NULL, that family name must be used in the paragraph style to reference glyphs from this font instead of the one encoded in the font itself.
Multiple fonts (with glyphs for different styles) can be specified with the same family.
[in] | context | The context. |
[in] | contents | The contents. |
[in] | contents_on_release_user_data | The user data baton to be passed to the contents release callback. |
[in] | family_name_alias | The family name alias or NULL if the one specified in the font data is to be used. |
IMPELLER_EXPORT void ImpellerTypographyContextRelease | ( | ImpellerTypographyContext IMPELLER_NULLABLE | context | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | context | The typography context. |
IMPELLER_EXPORT void ImpellerTypographyContextRetain | ( | ImpellerTypographyContext IMPELLER_NULLABLE | context | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | context | The typography context. |
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerVulkanSwapchainAcquireNextSurfaceNew | ( | ImpellerVulkanSwapchain IMPELLER_NONNULL | swapchain | ) |
A potentially blocking operation, acquires the next surface to render to. Since this may block, surface acquisition must be delayed for as long as possible to avoid an idle wait on the CPU.
[in] | swapchain | The swapchain. |
Referenced by main().
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerVulkanSwapchain IMPELLER_NULLABLE ImpellerVulkanSwapchainCreateNew | ( | ImpellerContext IMPELLER_NONNULL | context, |
void *IMPELLER_NONNULL | vulkan_surface_khr | ||
) |
Create a new Vulkan swapchain using a VkSurfaceKHR instance. Ownership of the surface is transferred over to Impeller. The Vulkan instance the surface is created from must the same as the context provided.
[in] | context | The context. Must be a Vulkan context whose instance is the same used to create the surface passed into the next argument. |
vulkan_surface_khr | The vulkan surface. |
Referenced by main().
IMPELLER_EXPORT void ImpellerVulkanSwapchainRelease | ( | ImpellerVulkanSwapchain IMPELLER_NULLABLE | swapchain | ) |
Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
[in] | swapchain | The swapchain. |
Referenced by main().
IMPELLER_EXPORT void ImpellerVulkanSwapchainRetain | ( | ImpellerVulkanSwapchain IMPELLER_NULLABLE | swapchain | ) |
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
[in] | swapchain | The swapchain. |