IndexRenderingBLContext

BLContext Class Reference [¶]

Rendering context [C++ API].

Member Functions

Construction & Destruction
Overloaded Operators
Target Information
Context Lifetime and Others
Properties
State Management
Transformations
Rendering Hints
Approximation Options
Composition Options
Style Options
Fill Style & Options
Stroke Style & Options
Clip Operations
Clear Geometry Operations
Fill Geometry Operations
Fill Text & Glyphs Operations
Fill Mask Operations
Stroke Geometry Operations
Stroke Text & Glyphs Operations
Image Blit Operations
Public Member Functions inherited from BLContextCore

Additional Inherited Members

Public Attributes inherited from BLObjectCore

BLContext::BLContext()noexcept[1/6][¶]

Creates a default constructed rendering context.

Default constructed means that the instance is valid, but uninitialized, which means the rendering context does not have attached any target. Any attempt to use uninitialized context results in BL_ERROR_NOT_INITIALIZED error.

BLContext::BLContext(
BLContext&& other
)noexcept[2/6][¶]

Move constructor.

Moves the other rendering context into this one and resets the other rendering context to a default-constructed state. This is an efficient way of "moving" the rendering context as it doesn't touch its internal reference count, which is atomic, because moving is internally implemented as a trivial memory copy.

BLContext::BLContext(
const BLContext& other
)noexcept[3/6][¶]

Copy constructor.

Creates a weak-copy of the other rendering context by increasing it's internal reference counter. This context and other would point to the same data and would be otherwise identical. Any change to other would also affect this context.

This function is mostly provided for C++ users that may keep a global reference to the same rendering context, for example, otherwise sharing is not that useful as the rendering context has states that are manipulated during rendering.

Two weak copies of the same rendering context cannot be used by different threads simultaneously.

BLContext::BLContext(
BLImageCore& target
)explicitnoexcept[4/6][¶]

Creates a new rendering context for rendering to the image target.

This is a simplified constructor that can be used to create a rendering context without any additional parameters, which means that the rendering context will use a single-threaded synchronous rendering.

Note

Since Blend2D doesn't use exceptions in C++ this function always succeeds even when an error happened. The underlying C-API function bl_context_init_as() returns an error, but it just cannot be propagated back. Use begin() function, which returns a BLResult to check the status of the call immediately.

BLContext::BLContext(
BLImageCore& target,
const BLContextCreateInfo& create_info
)noexcept[5/6][¶]

Creates a new rendering context for rendering to the image target.

This is an advanced constructor that can be used to create a rendering context with additional parameters. These parameters can be used to specify the number of threads to be used during rendering and to select other features.

Note

Since Blend2D doesn't use exceptions in C++ this function always succeeds even when an error happened. The underlying C-API function bl_context_init_as() returns an error, but it just cannot be propagated back. Use begin() function, which returns a BLResult to check the status of the call immediately.

BLContext::BLContext(
BLImageCore& target,
const BLContextCreateInfo* create_info
)noexcept[6/6][¶]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

BLContext::~BLContext()noexcept[¶]

Destroys the rendering context.

Waits for all operations, detaches the target from the rendering context and then destroys it. Does nothing if the context is not initialized.

Note

Destroying the rendering context would always internally call flush(BL_CONTEXT_FLUSH_SYNC), which would flush the render calls queue in case multi-threaded rendering is used.

BLContext::operator bool() constexplicitnoexcept[¶]

Returns true if the rendering context is initialized (has target attached).

Provided for users that want to use bool idiom in C++ to check for the status of the object.

BLContext ctx(some_image);
if (ctx) {
// Rendering context is initialized.
}

BLContext& BLContext::operator=(
const BLContext& other
)noexcept[1/2][¶]

Implements a copy-assignment operator.

Copying a rendering context creates a weak-copy only, which means that all copied instances share the same underlying rendering context. The rendering context internally uses atomic reference counting to manage ots lifetime.

BLContext& BLContext::operator=(
BLContext&& other
)noexcept[2/2][¶]

Implements a move-assignment operator.

Moves the rendering context of other to this rendering context and makes the other rendering context default constructed (which uses an internal "null" implementation that renders to nothing).

bool BLContext::operator==(
const BLContext& other
) constnodiscardnoexcept[¶]

Returns whether this and other point to the same rendering context.

bool BLContext::operator!=(
const BLContext& other
) constnodiscardnoexcept[¶]

Returns whether this and other are different rendering contexts.

BLSize BLContext::target_size() constnodiscardnoexcept[¶]

Returns the target size in abstract units (pixels in case of BLImage).

double BLContext::target_width() constnodiscardnoexcept[¶]

Returns the target width in abstract units (pixels in case of BLImage).

double BLContext::target_height() constnodiscardnoexcept[¶]

Returns the target height in abstract units (pixels in case of BLImage).

BLImage* BLContext::target_image() constnodiscardnoexcept[¶]

Returns the target image or null if there is no target image.

Note

The rendering context doesn't own the image, but it increases its writer count, which means that the image will not be destroyed even when user destroys it during the rendering (in such case it will be destroyed after the rendering ends when the writer count goes to zero). This means that the rendering context must hold the image and not the pointer to the BLImage passed to either the constructor or begin() function. So the returned pointer is not the same as the pointer passed to begin(), but it points to the same underlying data.

BLContextType BLContext::context_type() constnodiscardnoexcept[¶]

Returns the type of this context, see BLContextType.

bool BLContext::is_valid() constnodiscardnoexcept[¶]

Tests whether the context is a valid rendering context that has attached target to it.

bool BLContext::equals(
const BLContext& other
) constnodiscardnoexcept[¶]

Returns whether this and other point to the same rendering context.

BLResult BLContext::reset()noexcept[¶]

Resets this rendering context to the default constructed one.

Similar behavior to the destructor, but the rendering context will still be a valid object after the call to reset() and would behave like a default constructed context.

BLResult BLContext::assign(
const BLContext& other
)noexcept[1/2][¶]

Assigns the other rendering context to this rendering context.

This is the same as using C++ copy-assignment operator, see operator=().

BLResult BLContext::assign(
BLContext&& other
)noexcept[2/2][¶]

Moves the other rendering context to this rendering context, which would make ther other rendering context default initialized.

This is the same as using C++ move-assignment operator, see operator=().

BLResult BLContext::begin()noexcept[1/3][¶]

Begins rendering to the given image.

This is a simplified begin() function that can be used to create a rendering context without any additional parameters, which means that the rendering context will use a single-threaded synchronous rendering.

If this operation succeeds then the rendering context will have exclusive access to the image data. This means that no other renderer can use it during rendering.

BLResult BLContext::begin(
BLImageCore& image,
const BLContextCreateInfo& create_info
)noexcept[2/3][¶]

Begins rendering to the given image.

This is an advanced begin() function that can be used to create a rendering context with additional parameters. These parameters can be used to specify the number of threads to be used during rendering and to select other features.

If this operation succeeds then the rendering context will have exclusive access to the image data. This means that no other renderer can use it during rendering.

BLResult BLContext::begin(
BLImageCore& image,
const BLContextCreateInfo* create_info
)noexcept[3/3][¶]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

BLResult BLContext::end()noexcept[¶]

Waits for completion of all render commands and detaches the rendering context from the rendering target. After end() completes the rendering context implementation would be released and replaced by a built-in null instance (no context).

Note

Calling end() would implicitly call flush(BL_CONTEXT_FLUSH_SYNC), which would flush the render calls queue in case multi-threaded rendering is used.

BLResult BLContext::flush()noexcept[¶]

Flushes the context, see BLContextFlushFlags.

BLResult BLContext::get_property(
const char* name,
BLVarCore& value_out
) constnoexcept[1/2][¶]

Gets a property of the given name and assigns it to an initialized value_out.

BLResult BLContext::get_property(
BLVarCore& value_out
) constnoexcept[2/2][¶]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

BLResult BLContext::set_property(
const char* name,
const BLObjectCore& value
)noexcept[1/2][¶]

Sets a property of the given name to value.

BLResult BLContext::set_property(
const BLObjectCore& value
)noexcept[2/2][¶]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

uint32_t BLContext::thread_count() constnodiscardnoexcept[¶]

Queries the number of threads that the rendering context uses.

If the returned value is zero it means that the rendering is synchronous, otherwise it describes the number of threads used for asynchronous rendering which include the user thread. For example if the returned value is 2 it means that the rendering context uses the user thread and one more worker.

BLContextErrorFlags BLContext::accumulated_error_flags() constnodiscardnoexcept[¶]

Queries accumulated errors as flags, see BLContextErrorFlags.

Errors may accumulate during the lifetime of the rendering context.

uint32_t BLContext::saved_state_count() constnodiscardnoexcept[¶]

Returns the number of saved states in the context (0 means no saved states).

Note

Each successful call to save() increments the saved-state counter and each successful call to restore() decrements it. However, the calls must be successful as the rendering context allows to restrict the number of save states, for example, or to use a BLContextCookie to guard state save and restoration.

BLResult BLContext::save()noexcept[1/2][¶]

Saves the current rendering context state.

Blend2D uses optimizations that make save() a cheap operation. Only core values are actually saved in save(), others will only be saved if they are modified. This means that consecutive calls to save() and restore() do almost nothing.

BLResult BLContext::save()noexcept[2/2][¶]

Saves the current rendering context state and creates a restoration cookie.

If you use a cookie to save a state you have to use the same cookie to restore it otherwise the restore() would fail. Please note that cookies are not a means of security, they are provided for making it easier to guarantee that a code that you may not control won't break your context.

BLResult BLContext::restore()noexcept[1/2][¶]

Restores the top-most saved context-state.

Possible return conditions:

BLResult BLContext::restore(
const BLContextCookie& cookie
)noexcept[2/2][¶]

Restores to the point that matches the given cookie.

More than one state can be restored in case that the cookie points to some previous state in the list.

Possible return conditions:

const BLMatrix2D& BLContext::meta_transform() constnodiscardnoexcept[¶]

Returns a meta transformation matrix.

Meta matrix is a core transformation matrix that is normally not changed by transformations applied to the context. Instead it acts as a secondary matrix used to create the final transformation matrix from meta and user matrices.

Meta matrix can be used to scale the whole context for HI-DPI rendering or to change the orientation of the image being rendered, however, the number of use-cases is unlimited.

To change the meta-matrix you must first change user-matrix and then call user_to_meta(), which would update meta-matrix and clear user-matrix.

See user_transform() and user_to_meta().

const BLMatrix2D& BLContext::user_transform() constnodiscardnoexcept[¶]

Returns a user transformation matrix.

User matrix contains all transformations that happened to the rendering context unless the context was restored or user_to_meta() was called.

const BLMatrix2D& BLContext::final_transform() constnodiscardnoexcept[¶]

Returns a final transformation matrix.

Final transformation matrix is a combination of meta and user transformation matrices. It's the final transformation that the rendering context applies to all input coordinates.

BLResult BLContext::set_transform(
const BLMatrix2D& transform
)noexcept[¶]

Sets user transformation matrix to m.

Note

This only assigns the user transformation matrix, which means that the meta transformation matrix is kept as is. This means that the final transformation matrix will be recalculated based on the given transform.

BLResult BLContext::reset_transform()noexcept[¶]

Resets user transformation matrix to identity.

Note

This only resets the user transformation matrix, which means that the meta transformation matrix is kept as is. This means that the final transformation matrix after reset_transform() would be the same as meta transformation matrix.

BLResult BLContext::translate(
double x,
double y
)noexcept[1/3][¶]

Translates the used transformation matrix by [x, y].

BLResult BLContext::translate(
const BLPointI& p
)noexcept[2/3][¶]

Translates the used transformation matrix by [p] (integer).

BLResult BLContext::translate(
const BLPoint& p
)noexcept[3/3][¶]

Translates the used transformation matrix by [p] (floating-point).

BLResult BLContext::scale(
double xy
)noexcept[1/4][¶]

Scales the user transformation matrix by xy (both X and Y is scaled by xy).

BLResult BLContext::scale(
double x,
double y
)noexcept[2/4][¶]

Scales the user transformation matrix by [x, y].

BLResult BLContext::scale(
const BLPointI& p
)noexcept[3/4][¶]

Scales the user transformation matrix by [p] (integer).

BLResult BLContext::scale(
const BLPoint& p
)noexcept[4/4][¶]

Scales the user transformation matrix by [p] (floating-point).

BLResult BLContext::skew(
double x,
double y
)noexcept[1/2][¶]

Skews the user transformation matrix by [x, y].

BLResult BLContext::skew(
const BLPoint& p
)noexcept[2/2][¶]

Skews the user transformation matrix by [p] (floating-point).

BLResult BLContext::rotate(
double angle
)noexcept[1/4][¶]

Rotates the user transformation matrix by angle.

BLResult BLContext::rotate(
double angle,
double x,
double y
)noexcept[2/4][¶]

Rotates the user transformation matrix at [x, y] by angle.

BLResult BLContext::rotate(
double angle,
const BLPoint& origin
)noexcept[3/4][¶]

Rotates the user transformation matrix at origin (integer) by angle.

BLResult BLContext::rotate(
double angle,
const BLPointI& origin
)noexcept[4/4][¶]

Rotates the user transformation matrix at origin (floating-point) by angle.

BLResult BLContext::apply_transform(
const BLMatrix2D& transform
)noexcept[¶]

Transforms the user transformation matrix by transform.

BLResult BLContext::post_translate(
double x,
double y
)noexcept[1/3][¶]

Post-translates the used transformation matrix by [x, y].

Note

Post-translation uses a reversed order of matrix multiplication when compared to translate().

BLResult BLContext::post_translate(
const BLPointI& p
)noexcept[2/3][¶]

Post-Translates the used transformation matrix by [p] (integer).

Note

Post-translation uses a reversed order of matrix multiplication when compared to translate().

BLResult BLContext::post_translate(
const BLPoint& p
)noexcept[3/3][¶]

Post-translates the used transformation matrix by [p] (floating-point).

Note

Post-translation uses a reversed order of matrix multiplication when compared to translate().

BLResult BLContext::post_scale(
double xy
)noexcept[1/4][¶]

Post-scales the user transformation matrix by xy (both X and Y is scaled by xy).

Note

Post-scale uses a reversed order of matrix multiplication when compared to scale().

BLResult BLContext::post_scale(
double x,
double y
)noexcept[2/4][¶]

Post-scales the user transformation matrix by [x, y].

Note

Post-scale uses a reversed order of matrix multiplication when compared to scale().

BLResult BLContext::post_scale(
const BLPointI& p
)noexcept[3/4][¶]

Post-scales the user transformation matrix by [p] (integer).

Note

Post-scale uses a reversed order of matrix multiplication when compared to scale().

BLResult BLContext::post_scale(
const BLPoint& p
)noexcept[4/4][¶]

Post-scales the user transformation matrix by [p] (floating-point).

Note

Post-scale uses a reversed order of matrix multiplication when compared to scale().

BLResult BLContext::post_skew(
double x,
double y
)noexcept[1/2][¶]

Skews the user transformation matrix by [x, y].

Note

Post-skew uses a reversed order of matrix multiplication when compared to skew().

BLResult BLContext::post_skew(
const BLPoint& p
)noexcept[2/2][¶]

Skews the user transformation matrix by [p] (floating-point).

Note

Post-skew uses a reversed order of matrix multiplication when compared to skew().

BLResult BLContext::post_rotate(
double angle
)noexcept[1/4][¶]

Rotates the user transformation matrix by angle.

Note

Post-rotation uses a reversed order of matrix multiplication when compared to rotate().

BLResult BLContext::post_rotate(
double angle,
double x,
double y
)noexcept[2/4][¶]

Rotates the user transformation matrix at [x, y] by angle.

Note

Post-rotation uses a reversed order of matrix multiplication when compared to rotate().

BLResult BLContext::post_rotate(
double angle,
const BLPoint& origin
)noexcept[3/4][¶]

Rotates the user transformation matrix at origin (integer) by angle.

Note

Post-rotation uses a reversed order of matrix multiplication when compared to rotate().

BLResult BLContext::post_rotate(
double angle,
const BLPointI& origin
)noexcept[4/4][¶]

Rotates the user transformation matrix at origin (floating-point) by angle.

Note

Post-rotation uses a reversed order of matrix multiplication when compared to rotate().

BLResult BLContext::post_transform(
const BLMatrix2D& transform
)noexcept[¶]

Transforms the user transformation matrix by transform.

Note

Post-transform uses a reversed order of matrix multiplication when compared to apply_transform().

BLResult BLContext::user_to_meta()noexcept[¶]

Stores the result of combining the current MetaTransform and UserTransform to MetaTransform and resets UserTransform to identity as shown below:

MetaTransform = MetaTransform x UserTransform
UserTransform = Identity

Please note that this operation is irreversible. The only way to restore a meta-matrix is to save() the rendering context state, then to use user_to_meta(), and then restored by restore() when needed.

const BLContextHints& BLContext::hints() constnodiscardnoexcept[¶]

Returns rendering context hints.

BLResult BLContext::set_hint(
BLContextHint hint_type,
uint32_t value
)noexcept[¶]

Sets the given rendering hint hint_type to value.

BLResult BLContext::set_hints(
const BLContextHints& hints
)noexcept[¶]

Sets all rendering hints of this context to hints.

BLRenderingQuality BLContext::rendering_quality() constnodiscardnoexcept[¶]

Returns the rendering quality hint.

Note

This is the same as calling hints() and extracting the rendering quality from it.

BLResult BLContext::set_rendering_quality()noexcept[¶]

Sets rendering quality hint to value.

BLGradientQuality BLContext::gradient_quality() constnodiscardnoexcept[¶]

Returns the gradient quality hint.

Note

This is the same as calling hints() and extracting the gradient quality from it.

BLResult BLContext::set_gradient_quality()noexcept[¶]

Sets gradient quality hint to value.

BLPatternQuality BLContext::pattern_quality() constnodiscardnoexcept[¶]

Returns the pattern quality hint.

Note

This is the same as calling hints() and extracting the pattern quality from it.

BLResult BLContext::set_pattern_quality()noexcept[¶]

Sets pattern quality hint to value.

const BLApproximationOptions& BLContext::approximation_options() constnodiscardnoexcept[¶]

Returns approximation options.

BLResult BLContext::set_approximation_options(
const BLApproximationOptions& options
)noexcept[¶]

Sets approximation options to options.

BLFlattenMode BLContext::flatten_mode() constnodiscardnoexcept[¶]

Returns flatten mode (how curves are flattened).

BLResult BLContext::set_flatten_mode()noexcept[¶]

Sets flatten mode (how curves are flattened).

double BLContext::flatten_tolerance() constnodiscardnoexcept[¶]

Returns tolerance used for curve flattening.

BLResult BLContext::set_flatten_tolerance(
double tolerance
)noexcept[¶]

Sets tolerance used for curve flattening.

BLCompOp BLContext::comp_op() constnodiscardnoexcept[¶]

Returns a composition operator.

BLResult BLContext::set_comp_op(
BLCompOp comp_op
)noexcept[¶]

Sets the composition operator to comp_op, see BLCompOp.

The composition operator is part of the rendering context state and is subject to save() and restore(). The default composition operator is BL_COMP_OP_SRC_OVER, which would be returned immediately after the rendering context is created.

double BLContext::global_alpha() constnodiscardnoexcept[¶]

Returns a global alpha value.

BLResult BLContext::set_global_alpha(
double alpha
)noexcept[¶]

Sets the global alpha value.

The global alpha value is part of the rendering context state and is subject to save() and restore(). The default value is 1.0, which would be returned immediately after the rendering context is created.

BLObjectType BLContext::style_type() constnodiscardnoexcept[¶]

Returns the current style type associated with the given style slot.

BLResult BLContext::get_style(
BLVarCore& style_out
) constnoexcept[¶]

Reads a style state associated with the given style slot and writes it into style_out.

Note

This function returns the original style passed to the rendering context with its original transformation matrix if it's not a solid color. Consider using get_transformed_style() if you want to get a style with the transformation matrix that the rendering context actually uses to render it.

Warning

This function requires an initialized variant. Use a C++ provided BLVar class instead of C-API BLVarCore to retrieve a style. BLVar is always initialized and properly destroyed.

BLResult BLContext::get_transformed_style(
BLVarCore& style_out
) constnoexcept[¶]

Reads a style state associated with the given style slot and writes it into style_out.

The retrieved style uses a transformation matrix that is a combination of style transformation matrix and the rendering context matrix at a time set_style() was called.

Warning

This function requires an initialized variant. Use a C++ provided BLVar class instead of C-API BLVarCore to retrieve a style. BLVar is always initialized and properly destroyed.

template<typename StyleT>
BLResult BLContext::set_style(
const StyleT& style
)noexcept[1/2][¶]

Sets style to be used with the given style slot operation.

Note

The style argument could be BLRgba, BLRgba32, BLRgba64, BLGradient, BLPattern, and BLVar.

template<typename StyleT>
BLResult BLContext::set_style(
const StyleT& style,
)noexcept[2/2][¶]

Sets style to be used with the given style slot operation and applied transform_mode.

This is a convenience function that allows to control how the given style is transformed. By default, if transform_mode is not provided, the rendering context combines the style transformation matrix with user transformation matrix, which is compatible with how it transforms geometry. However, if that' undesired, a transform_mode can override the default operation.

Note

The style argument could be BLGradient, BLPattern, and BLVar.

BLResult BLContext::disable_style()noexcept[¶]

Sets the given style slot to NULL, which disables it.

Styles set to NULL would reject all rendering operations that would otherwise use that style.

double BLContext::style_alpha() constnodiscardnoexcept[¶]

Returns fill or alpha value associated with the given style slot.

The function behaves like fill_alpha() or stroke_alpha() depending on style slot, see BLContextStyleSlot.

BLResult BLContext::set_style_alpha(
double alpha
)noexcept[¶]

Set fill or stroke alpha value associated with the given style slot.

The function behaves like set_fill_alpha() or set_stroke_alpha() depending on style slot, see BLContextStyleSlot.

BLResult BLContext::swap_styles()noexcept[¶]

Swaps fill and stroke styles, see BLContextStyleSwapMode for options.

BLObjectType BLContext::fill_style_type() constnodiscardnoexcept[¶]

Returns the current fill style type.

BLResult BLContext::get_fill_style() constnoexcept[¶]

Reads a fill style state and writes it into style_out variant.

Note

This function returns the original style passed to the rendering context with its original transformation matrix if it's not a solid color. Consider using get_transformed_fill_style() if you want to get a fill style with the transformation matrix that the rendering context actually uses to render it.

Warning

This function requires an initialized variant. Use a C++ provided BLVar class instead of C-API BLVarCore to retrieve a style. BLVar is always initialized and properly destroyed.

BLResult BLContext::get_transformed_fill_style() constnoexcept[¶]

Reads a fill style state and writes it into styleOut variant.

Note

Unlike getFillStyle() this function returns a style, which was transformed by the rendering context at the time it was set (using a past transformation matrix). When this style is set to the rendering context again with all transformations bypassed (by using BL_CONTEXT_STYLE_TRANSFORM_MODE_NONE option) it would make the style identical.

Warning

This function requires an initialized variant. Use a C++ provided BLVar class instead of C-API BLVarCore to retrieve a style. BLVar is always initialized and properly destroyed.

template<typename StyleT>
BLResult BLContext::set_fill_style(
const StyleT& style
)noexcept[1/2][¶]

Sets fill style.

Note

The style argument could be BLRgba, BLRgba32, BLRgba64, BLGradient, BLPattern, and BLVar.

template<typename StyleT>
BLResult BLContext::set_fill_style(
const StyleT& style,
)noexcept[2/2][¶]

Sets fill style to style.

Note

The style argument could be BLGradient, BLPattern, and BLVar.

BLResult BLContext::disable_fill_style()noexcept[¶]

Sets fill style to NULL, which disables it.

double BLContext::fill_alpha() constnodiscardnoexcept[¶]

Returns fill alpha value.

BLResult BLContext::set_fill_alpha(
double alpha
)noexcept[¶]

Sets fill alpha value.

BLFillRule BLContext::fill_rule() constnodiscardnoexcept[¶]

Returns fill-rule, see BLFillRule.

BLResult BLContext::set_fill_rule(
BLFillRule fill_rule
)noexcept[¶]

Sets fill-rule, see BLFillRule.

BLObjectType BLContext::stroke_style_type() constnodiscardnoexcept[¶]

Returns the current stroke style type.

BLResult BLContext::get_stroke_style() constnoexcept[¶]

Reads a stroke style state and writes it into style_out variant.

Note

This function returns the original style passed to the rendering context with its original transformation matrix if it's not a solid color. Consider using get_transformed_stroke_style() if you want to get a stroke style with the transformation matrix that the rendering context actually uses to render it.

Warning

This function requires an initialized variant. Use a C++ provided BLVar class instead of C-API BLVarCore to retrieve a style. BLVar is always initialized and properly destroyed.

BLResult BLContext::get_transformed_stroke_style() constnoexcept[¶]

Reads a stroke style state and writes it into styleOut variant.

Note

Unlike getStrokeStyle() this function returns a style, which was transformed by the rendering context at the time it was set (using a past transformation matrix). When this style is set to the rendering context again with all transformations bypassed (by using BL_CONTEXT_STYLE_TRANSFORM_MODE_NONE option) it would make the style identical.

Warning

This function requires an initialized variant. Use a C++ provided BLVar class instead of C-API BLVarCore to retrieve a style. BLVar is always initialized and properly destroyed.

template<typename StyleT>
BLResult BLContext::set_stroke_style(
const StyleT& style
)noexcept[1/2][¶]

Sets stroke style.

Note

The style argument could be BLRgba, BLRgba32, BLRgba64, BLGradient, BLPattern, and BLVar.

template<typename StyleT>
BLResult BLContext::set_stroke_style(
const StyleT& style,
)noexcept[2/2][¶]

Sets fill style to style.

Note

The style argument could be BLGradient, BLPattern, and BLVar.

BLResult BLContext::disable_stroke_style()noexcept[¶]

Sets stroke style to NULL, which disables it.

double BLContext::stroke_width() constnodiscardnoexcept[¶]

Returns stroke width.

double BLContext::stroke_miter_limit() constnodiscardnoexcept[¶]

Returns stroke miter-limit.

BLStrokeJoin BLContext::stroke_join() constnodiscardnoexcept[¶]

Returns stroke join, see BLStrokeJoin.

BLStrokeCap BLContext::stroke_start_cap() constnodiscardnoexcept[¶]

Returns stroke start-cap, see BLStrokeCap.

BLStrokeCap BLContext::stroke_end_cap() constnodiscardnoexcept[¶]

Returns stroke end-cap, see BLStrokeCap.

BLStrokeTransformOrder BLContext::stroke_transform_order() constnodiscardnoexcept[¶]

Returns stroke transform order, see BLStrokeTransformOrder.

double BLContext::stroke_dash_offset() constnodiscardnoexcept[¶]

Returns stroke dash-offset.

const BLArray<double>& BLContext::stroke_dash_array() constnodiscardnoexcept[¶]

Returns stroke dash-array.

const BLStrokeOptions& BLContext::stroke_options() constnodiscardnoexcept[¶]

Returns stroke options as a reference to BLStrokeOptions.

BLResult BLContext::set_stroke_width(
double width
)noexcept[¶]

Sets stroke width to width.

BLResult BLContext::set_stroke_miter_limit(
double miter_limit
)noexcept[¶]

Sets miter limit to miter_limit.

BLResult BLContext::set_stroke_join(
BLStrokeJoin stroke_join
)noexcept[¶]

Sets stroke join to stroke_join, see BLStrokeJoin.

BLResult BLContext::set_stroke_cap(
BLStrokeCap stroke_cap
)noexcept[¶]

Sets stroke cap of the specified type to stroke_cap, see BLStrokeCap.

BLResult BLContext::set_stroke_start_cap(
BLStrokeCap stroke_cap
)noexcept[¶]

Sets stroke start cap to stroke_cap, see BLStrokeCap.

BLResult BLContext::set_stroke_end_cap(
BLStrokeCap stroke_cap
)noexcept[¶]

Sets stroke end cap to stroke_cap, see BLStrokeCap.

BLResult BLContext::set_stroke_caps(
BLStrokeCap stroke_cap
)noexcept[¶]

Sets all stroke caps to stroke_cap, see BLStrokeCap.

BLResult BLContext::set_stroke_transform_order()noexcept[¶]

Sets stroke transformation order to transform_order, see BLStrokeTransformOrder.

BLResult BLContext::set_stroke_dash_offset(
double dash_offset
)noexcept[¶]

Sets stroke dash-offset to dash_offset.

BLResult BLContext::set_stroke_dash_array(
const BLArray<double>& dash_array
)noexcept[¶]

Sets stroke dash-array to dash_array.

BLResult BLContext::set_stroke_options(
const BLStrokeOptions& options
)noexcept[¶]

Sets all stroke options.

double BLContext::stroke_alpha() constnodiscardnoexcept[¶]

Returns stroke alpha value.

BLResult BLContext::set_stroke_alpha(
double alpha
)noexcept[¶]

Sets stroke alpha value to alpha.

BLResult BLContext::restore_clipping()noexcept[¶]

Restores clipping to the last saved state or to the context default clipping if there is no saved state.

If there are no saved states then it resets clipping completely to the initial state that was used when the rendering context was created.

BLResult BLContext::clear_all()noexcept[¶]

Clear everything to a transparent black, which is the same operation as temporarily setting the composition operator to BL_COMP_OP_CLEAR and then filling everything by fill_all().

Note

If the target surface doesn't have alpha, but has X component, like BL_FORMAT_XRGB32, the X component would be set to 1.0, which would translate to 0xFF in case of BL_FORMAT_XRGB32.

BLResult BLContext::clear_rect(
const BLRectI& rect
)noexcept[1/3][¶]

Clears a rectangle rect (integer coordinates) to a transparent black, which is the same operation as temporarily setting the composition operator to BL_COMP_OP_CLEAR and then calling fill_rect(rect).

Note

If the target surface doesn't have alpha, but has X component, like BL_FORMAT_XRGB32, the X component would be set to 1.0, which would translate to 0xFF in case of BL_FORMAT_XRGB32.

BLResult BLContext::clear_rect(
const BLRect& rect
)noexcept[2/3][¶]

Clears a rectangle rect (floating-point coordinates) to a transparent black, which is the same operation as temporarily setting the composition operator to BL_COMP_OP_CLEAR and then calling fill_rect(rect).

Note

If the target surface doesn't have alpha, but has X component, like BL_FORMAT_XRGB32, the X component would be set to 1.0, which would translate to 0xFF in case of BL_FORMAT_XRGB32.

BLResult BLContext::clear_rect(
double x,
double y,
double w,
double h
)noexcept[3/3][¶]

Clears a rectangle [x, y, w, h] (floating-point coordinates) to a transparent black, which is the same operation as temporarily setting the composition operator to BL_COMP_OP_CLEAR and then calling fill_rect(x, y, w, h).

Note

If the target surface doesn't have alpha, but has X component, like BL_FORMAT_XRGB32, the X component would be set to 1.0, which would translate to 0xFF in case of BL_FORMAT_XRGB32.

BLResult BLContext::fill_all()noexcept[1/2][¶]

Fills everything non-clipped with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_all(
const StyleT& style
)noexcept[2/2][¶]

Fills everything non-clipped with an explicit fill style.

BLResult BLContext::fill_box(
const BLBox& box
)noexcept[1/6][¶]

Fills a box (floating point coordinates) with the current fill style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use fill_rect() instead.

template<typename StyleT>
BLResult BLContext::fill_box(
const BLBox& box,
const StyleT& style
)noexcept[2/6][¶]

Fills a box (floating point coordinates) with an explicit fill style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use fill_rect() instead.

BLResult BLContext::fill_box(
const BLBoxI& box
)noexcept[3/6][¶]

Fills a box (integer coordinates) with the current fill style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use fill_rect() instead.

template<typename StyleT>
BLResult BLContext::fill_box(
const BLBoxI& box,
const StyleT& style
)noexcept[4/6][¶]

Fills a box (integer coordinates) with an explicit fill style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use fill_rect() instead.

BLResult BLContext::fill_box(
double x0,
double y0,
double x1,
double y1
)noexcept[5/6][¶]

Fills a box [x0, y0, x1, y1] (floating point coordinates) with the current fill style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use fill_rect() instead.

template<typename StyleT>
BLResult BLContext::fill_box(
double x0,
double y0,
double x1,
double y1,
const StyleT& style
)noexcept[6/6][¶]

Fills a box [x0, y0, x1, y1] (floating point coordinates) with an explicit fill style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use fill_rect() instead.

BLResult BLContext::fill_rect(
const BLRectI& rect
)noexcept[1/6][¶]

Fills a rectangle rect (integer coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_rect(
const BLRectI& rect,
const StyleT& style
)noexcept[2/6][¶]

Fills a rectangle rect (integer coordinates) with an explicit fill style.

BLResult BLContext::fill_rect(
const BLRect& rect
)noexcept[3/6][¶]

Fills a rectangle rect (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_rect(
const BLRect& rect,
const StyleT& style
)noexcept[4/6][¶]

Fills a rectangle rect (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_rect(
double x,
double y,
double w,
double h
)noexcept[5/6][¶]

Fills a rectangle [x, y, w, h] (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_rect(
double x,
double y,
double w,
double h,
const StyleT& style
)noexcept[6/6][¶]

Fills a rectangle [x, y, w, h] (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_circle(
const BLCircle& circle
)noexcept[1/4][¶]

Fills a circle (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_circle(
const BLCircle& circle,
const StyleT& style
)noexcept[2/4][¶]

Fills a circle (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_circle(
double cx,
double cy,
double r
)noexcept[3/4][¶]

Fills a circle at [cx, cy] and radius r (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_circle(
double cx,
double cy,
double r,
const StyleT& style
)noexcept[4/4][¶]

Fills a circle at [cx, cy] and radius r (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_ellipse(
const BLEllipse& ellipse
)noexcept[1/4][¶]

Fills an ellipse (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_ellipse(
const BLEllipse& ellipse,
const StyleT& style
)noexcept[2/4][¶]

Fills an ellipse (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_ellipse(
double cx,
double cy,
double rx,
double ry
)noexcept[3/4][¶]

Fills an ellipse at [cx, cy] with radius [rx, ry] (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_ellipse(
double cx,
double cy,
double rx,
double ry,
const StyleT& style
)noexcept[4/4][¶]

Fills an ellipse at [cx, cy] with radius [rx, ry] (floating point coordinates) with en explicit fill style.

BLResult BLContext::fill_round_rect(
const BLRoundRect& rr
)noexcept[1/8][¶]

Fills a rounded rectangle rr (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_round_rect(
const BLRoundRect& rr,
const StyleT& style
)noexcept[2/8][¶]

Fills a rounded rectangle rr (floating point coordinates) with en explicit fill style.

BLResult BLContext::fill_round_rect(
const BLRect& rect,
double r
)noexcept[3/8][¶]

Fills a rounded rectangle bounded by rect with radius r with the current fill style.

BLResult BLContext::fill_round_rect(
const BLRect& rect,
double rx,
double ry
)noexcept[4/8][¶]

Fills a rounded rectangle bounded by rect with radius [rx, ry] with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_round_rect(
const BLRect& rect,
double rx,
double ry,
const StyleT& style
)noexcept[5/8][¶]

Fills a rounded rectangle bounded by rect with radius [rx, ry] with en explicit fill style.

BLResult BLContext::fill_round_rect(
double x,
double y,
double w,
double h,
double r
)noexcept[6/8][¶]

Fills a rounded rectangle bounded by [x, y, w, h] with radius r with the current fill style.

BLResult BLContext::fill_round_rect(
double x,
double y,
double w,
double h,
double rx,
double ry
)noexcept[7/8][¶]

Fills a rounded rectangle bounded as [x, y, w, h] with radius [rx, ry] with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_round_rect(
double x,
double y,
double w,
double h,
double rx,
double ry,
const StyleT& style
)noexcept[8/8][¶]

Fills a rounded rectangle bounded as [x, y, w, h] with radius [rx, ry] with an explicit fill style.

BLResult BLContext::fill_chord(
const BLArc& chord
)noexcept[1/5][¶]

Fills a chord (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_chord(
const BLArc& chord,
const StyleT& style
)noexcept[2/5][¶]

Fills a chord (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_chord(
double cx,
double cy,
double r,
double start,
double sweep
)noexcept[3/5][¶]

Fills a chord at [cx, cy] with radius r at start of sweep (floating point coordinates) with the current fill style.

BLResult BLContext::fill_chord(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep
)noexcept[4/5][¶]

Fills a chord at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_chord(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep,
const StyleT& style
)noexcept[5/5][¶]

Fills a chord at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_pie(
const BLArc& pie
)noexcept[1/5][¶]

Fills a pie (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_pie(
const BLArc& pie,
const StyleT& style
)noexcept[2/5][¶]

Fills a pie (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_pie(
double cx,
double cy,
double r,
double start,
double sweep
)noexcept[3/5][¶]

Fills a pie at [cx, cy] with radius r at start of sweep (floating point coordinates) with the current fill style.

BLResult BLContext::fill_pie(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep
)noexcept[4/5][¶]

Fills a pie at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_pie(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep,
const StyleT& style
)noexcept[5/5][¶]

Fills a pie at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_triangle(
const BLTriangle& triangle
)noexcept[1/4][¶]

Fills a triangle (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_triangle(
const BLTriangle& triangle,
const StyleT& style
)noexcept[2/4][¶]

Fills a triangle (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_triangle(
double x0,
double y0,
double x1,
double y1,
double x2,
double y2
)noexcept[3/4][¶]

Fills a triangle defined by [x0, y0], [x1, y1], [x2, y2] (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_triangle(
double x0,
double y0,
double x1,
double y1,
double x2,
double y2,
const StyleT& style
)noexcept[4/4][¶]

Fills a triangle defined by [x0, y0], [x1, y1], [x2, y2] (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_polygon(
const BLArrayView<BLPoint>& poly
)noexcept[1/8][¶]

Fills a polygon poly (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_polygon(
const BLArrayView<BLPoint>& poly,
const StyleT& style
)noexcept[2/8][¶]

Fills a polygon poly (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_polygon(
const BLPoint* poly,
size_t n
)noexcept[3/8][¶]

Fills a polygon poly having n vertices (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_polygon(
const BLPoint* poly,
size_t n,
const StyleT& style
)noexcept[4/8][¶]

Fills a polygon poly having n vertices (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_polygon(
const BLArrayView<BLPointI>& poly
)noexcept[5/8][¶]

Fills a polygon poly (integer coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_polygon(
const BLArrayView<BLPointI>& poly,
const StyleT& style
)noexcept[6/8][¶]

Fills a polygon poly (integer coordinates) with an explicit fill style.

BLResult BLContext::fill_polygon(
const BLPointI* poly,
size_t n
)noexcept[7/8][¶]

Fills a polygon poly having n vertices (integer coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_polygon(
const BLPointI* poly,
size_t n,
const StyleT& style
)noexcept[8/8][¶]

Fills a polygon poly having n vertices (integer coordinates) with an explicit fill style.

BLResult BLContext::fill_box_array(
const BLArrayView<BLBox>& array
)noexcept[1/8][¶]

Fills an array of boxes (floating point coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_box_array(
const BLArrayView<BLBox>& array,
const StyleT& style
)noexcept[2/8][¶]

Fills an array of boxes (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_box_array(
const BLBox* array,
size_t n
)noexcept[3/8][¶]

Fills an array of boxes of size n (floating point coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_box_array(
const BLBox* array,
size_t n,
const StyleT& style
)noexcept[4/8][¶]

Fills an array of boxes of size n (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_box_array(
const BLArrayView<BLBoxI>& array
)noexcept[5/8][¶]

Fills an array of boxes (integer coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_box_array(
const BLArrayView<BLBoxI>& array,
const StyleT& style
)noexcept[6/8][¶]

Fills an array of boxes (integer coordinates) with an explicit fill style.

BLResult BLContext::fill_box_array(
const BLBoxI* array,
size_t n
)noexcept[7/8][¶]

Fills an array of boxes of size n (integer coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_box_array(
const BLBoxI* array,
size_t n,
const StyleT& style
)noexcept[8/8][¶]

Fills an array of boxes of size n (integer coordinates) with an explicit fill style.

BLResult BLContext::fill_rect_array(
const BLArrayView<BLRect>& array
)noexcept[1/8][¶]

Fills an array of rectangles (floating point coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_rect_array(
const BLArrayView<BLRect>& array,
const StyleT& style
)noexcept[2/8][¶]

Fills an array of rectangles (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_rect_array(
const BLRect* array,
size_t n
)noexcept[3/8][¶]

Fills an array of rectangles of size n (floating point coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_rect_array(
const BLRect* array,
size_t n,
const StyleT& style
)noexcept[4/8][¶]

Fills an array of rectangles of size n (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_rect_array(
const BLArrayView<BLRectI>& array
)noexcept[5/8][¶]

Fills an array of rectangles (integer coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_rect_array(
const BLArrayView<BLRectI>& array,
const StyleT& style
)noexcept[6/8][¶]

Fills an array of rectangles (integer coordinates) with an explicit fill style.

BLResult BLContext::fill_rect_array(
const BLRectI* array,
size_t n
)noexcept[7/8][¶]

Fills an array of rectangles of size n (integer coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_rect_array(
const BLRectI* array,
size_t n,
const StyleT& style
)noexcept[8/8][¶]

Fills an array of rectangles of size n (integer coordinates) with an explicit fill style.

BLResult BLContext::fill_path(
const BLPathCore& path
)noexcept[1/4][¶]

Fills the given path with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_path(
const BLPathCore& path,
const StyleT& style
)noexcept[2/4][¶]

Fills the given path with an explicit fill style.

BLResult BLContext::fill_path(
const BLPoint& origin,
const BLPathCore& path
)noexcept[3/4][¶]

Fills the given path translated by origin with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_path(
const BLPoint& origin,
const BLPathCore& path,
const StyleT& style
)noexcept[4/4][¶]

Fills the given path translated by origin with an explicit fill style.

BLResult BLContext::fill_geometry(
const void* data
)noexcept[1/2][¶]

Fills the passed geometry specified by geometry type and data with the default fill style.

Note

This function provides a low-level interface that can be used in cases in which geometry type and data parameters are passed to a wrapper function that just passes them to the rendering context. It's a good way of creating wrappers, but generally low-level for a general purpose use, so please use this with caution.

template<typename StyleT>
BLResult BLContext::fill_geometry(
const void* data,
const StyleT& style
)noexcept[2/2][¶]

Fills the passed geometry specified by geometry type and data with an explicit fill style.

Note

This function provides a low-level interface that can be used in cases in which geometry type and data parameters are passed to a wrapper function that just passes them to the rendering context. It's a good way of creating wrappers, but generally low-level for a general purpose use, so please use this with caution.

BLResult BLContext::fill_utf8_text(
const BLPointI& origin,
const BLFontCore& font,
const char* text,
size_t size = SIZE_MAX
)noexcept[1/8][¶]

Fills UTF-8 encoded string passed as text and size by using the given font at origin (integer coordinates) with the default fill style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, use either this function with a size parameter set (which contains the number of bytes of text string, and not the number of UTF-8 characters) or an overloaded function that accepts a convenience BLStringView parameter instead of text and size.

template<typename StyleT>
BLResult BLContext::fill_utf8_text(
const BLPointI& origin,
const BLFontCore& font,
const char* text,
size_t size,
const StyleT& style
)noexcept[2/8][¶]

Fills UTF-8 encoded string passed as text and size by using the given font at origin (integer coordinates) with an explicit fill style.

Note

Pass SIZE_MAX to size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, use either this function with a size parameter set (which contains the number of bytes of text string, and not the number of UTF-8 characters) or an overloaded function that accepts a convenience BLStringView parameter instead of text and size.

BLResult BLContext::fill_utf8_text(
const BLPointI& origin,
const BLFontCore& font,
const BLStringView& view
)noexcept[3/8][¶]

Fills UTF-8 encoded string passed as string view by using the given font at origin (floating point coordinates) with the default fill style.

template<typename StyleT>
BLResult BLContext::fill_utf8_text(
const BLPointI& origin,
const BLFontCore& font,
const BLStringView& view,
const StyleT& style
)noexcept[4/8][¶]

Fills UTF-8 encoded string passed as string view by using the given font at origin (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_utf8_text(
const BLPoint& origin,
const BLFontCore& font,
const char* text,
size_t size = SIZE_MAX
)noexcept[5/8][¶]

Fills UTF-8 encoded string passed as text and size by using the given font at origin (integer coordinates) with the default fill style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, use either this function with a size parameter set (which contains the number of bytes of text string, and not the number of UTF-8 characters) or an overloaded function that accepts a convenience BLStringView parameter instead of text and size.

template<typename StyleT>
BLResult BLContext::fill_utf8_text(
const BLPoint& origin,
const BLFontCore& font,
const char* text,
size_t size,
const StyleT& style
)noexcept[6/8][¶]

Fills UTF-8 encoded string passed as text and size by using the given font at origin (integer coordinates) with an explicit fill style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, use either this function with a size parameter set (which contains the number of bytes of text string, and not the number of UTF-8 characters) or an overloaded function that accepts a convenience BLStringView parameter instead of text and size.

BLResult BLContext::fill_utf8_text(
const BLPoint& origin,
const BLFontCore& font,
const BLStringView& view
)noexcept[7/8][¶]

Fills UTF-8 encoded string passed as string view by using the given font at origin (floating point coordinates).

template<typename StyleT>
BLResult BLContext::fill_utf8_text(
const BLPoint& origin,
const BLFontCore& font,
const BLStringView& view,
const StyleT& style
)noexcept[8/8][¶]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

BLResult BLContext::fill_utf16_text(
const BLPointI& origin,
const BLFontCore& font,
const uint16_t* text,
size_t size = SIZE_MAX
)noexcept[1/4][¶]

Fills UTF-16 encoded string passed as text and size by using the given font at origin (integer coordinates) with the default fill style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated UTF-16 string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 16-bit values).

template<typename StyleT>
BLResult BLContext::fill_utf16_text(
const BLPointI& origin,
const BLFontCore& font,
const uint16_t* text,
size_t size,
const StyleT& style
)noexcept[2/4][¶]

Fills UTF-16 encoded string passed as text and size by using the given font at origin (integer coordinates) with an explicit fill style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 16-bit values).

BLResult BLContext::fill_utf16_text(
const BLPoint& origin,
const BLFontCore& font,
const uint16_t* text,
size_t size = SIZE_MAX
)noexcept[3/4][¶]

Fills UTF-16 encoded string passed as text and size by using the given font at origin (floating point coordinates) with the default fill style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated UTF-16 string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 16-bit values).

template<typename StyleT>
BLResult BLContext::fill_utf16_text(
const BLPoint& origin,
const BLFontCore& font,
const uint16_t* text,
size_t size,
const StyleT& style
)noexcept[4/4][¶]

Fills UTF-16 encoded string passed as text and size by using the given font at origin (floating point coordinates) with an explicit fill style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 16-bit values).

BLResult BLContext::fill_utf32_text(
const BLPointI& origin,
const BLFontCore& font,
const uint32_t* text,
size_t size = SIZE_MAX
)noexcept[1/4][¶]

Fills UTF-32 encoded string passed as text and size by using the given font at origin (integer coordinates) with the default fill style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated UTF-32 string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 32-bit values).

template<typename StyleT>
BLResult BLContext::fill_utf32_text(
const BLPointI& origin,
const BLFontCore& font,
const uint32_t* text,
size_t size,
const StyleT& style
)noexcept[2/4][¶]

Fills UTF-32 encoded string passed as text and size by using the given font at origin (integer coordinates) with an explicit fill style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 32-bit values).

BLResult BLContext::fill_utf32_text(
const BLPoint& origin,
const BLFontCore& font,
const uint32_t* text,
size_t size = SIZE_MAX
)noexcept[3/4][¶]

Fills UTF-32 encoded string passed as text and size by using the given font at origin (floating point coordinates) with the default fill style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated UTF-32 string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 32-bit values).

template<typename StyleT>
BLResult BLContext::fill_utf32_text(
const BLPoint& origin,
const BLFontCore& font,
const uint32_t* text,
size_t size,
const StyleT& style
)noexcept[4/4][¶]

Fills UTF-32 encoded string passed as text and size by using the given font at origin (floating point coordinates) with an explicit fill style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 32-bit values).

BLResult BLContext::fill_glyph_run(
const BLPointI& origin,
const BLFontCore& font,
const BLGlyphRun& glyph_run
)noexcept[1/4][¶]

Fills a glyph_run by using the given font at origin (integer coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_glyph_run(
const BLPointI& origin,
const BLFontCore& font,
const BLGlyphRun& glyph_run,
const StyleT& style
)noexcept[2/4][¶]

Fills a glyph_run by using the given font at origin (integer coordinates) with an explicit fill style.

BLResult BLContext::fill_glyph_run(
const BLPoint& origin,
const BLFontCore& font,
const BLGlyphRun& glyph_run
)noexcept[3/4][¶]

Fills the passed glyph_run by using the given font at origin (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_glyph_run(
const BLPoint& origin,
const BLFontCore& font,
const BLGlyphRun& glyph_run,
const StyleT& style
)noexcept[4/4][¶]

Fills the passed glyph_run by using the given font at origin (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_mask(
const BLPointI& origin,
const BLImage& mask
)noexcept[1/8][¶]

Fills a source mask image at coordinates specified by origin (int coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_mask(
const BLPointI& origin,
const BLImage& mask,
const StyleT& style
)noexcept[2/8][¶]

Fills a source mask image at coordinates specified by origin (int coordinates) with an explicit fill style.

BLResult BLContext::fill_mask(
const BLPointI& origin,
const BLImage& mask,
const BLRectI& mask_area
)noexcept[3/8][¶]

Fills a source mask image specified by mask_area at coordinates specified by origin (int coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_mask(
const BLPointI& origin,
const BLImage& mask,
const BLRectI& mask_area,
const StyleT& style
)noexcept[4/8][¶]

Fills a source mask image specified by mask_area at coordinates specified by origin (int coordinates) with an explicit fill style.

BLResult BLContext::fill_mask(
const BLPoint& origin,
const BLImage& mask
)noexcept[5/8][¶]

Fills a source mask image at coordinates specified by origin (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_mask(
const BLPoint& origin,
const BLImage& mask,
const StyleT& style
)noexcept[6/8][¶]

Fills a source mask image at coordinates specified by origin (floating point coordinates) with an explicit fill style.

BLResult BLContext::fill_mask(
const BLPoint& origin,
const BLImage& mask,
const BLRectI& mask_area
)noexcept[7/8][¶]

Fills a source mask image specified by mask_area at coordinates specified by origin (floating point coordinates) with the current fill style.

template<typename StyleT>
BLResult BLContext::fill_mask(
const BLPoint& origin,
const BLImage& mask,
const BLRectI& mask_area,
const StyleT& style
)noexcept[8/8][¶]

Fills a source mask image specified by mask_area at coordinates specified by origin (floating point coordinates) with an explicit fill style.

BLResult BLContext::stroke_box(
const BLBox& box
)noexcept[1/6][¶]

Strokes a box (floating point coordinates) with the current stroke style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use stroke_rect() instead.

template<typename StyleT>
BLResult BLContext::stroke_box(
const BLBox& box,
const StyleT& style
)noexcept[2/6][¶]

Strokes a box (floating point coordinates) with an explicit stroke style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use stroke_rect() instead.

BLResult BLContext::stroke_box(
const BLBoxI& box
)noexcept[3/6][¶]

Strokes a box (integer coordinates) with the current stroke style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use stroke_rect() instead.

template<typename StyleT>
BLResult BLContext::stroke_box(
const BLBoxI& box,
const StyleT& style
)noexcept[4/6][¶]

Strokes a box (integer coordinates) with an explicit stroke style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use stroke_rect() instead.

BLResult BLContext::stroke_box(
double x0,
double y0,
double x1,
double y1
)noexcept[5/6][¶]

Strokes a box [x0, y0, x1, y1] (floating point coordinates) with the current stroke style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use stroke_rect() instead.

template<typename StyleT>
BLResult BLContext::stroke_box(
double x0,
double y0,
double x1,
double y1,
const StyleT& style
)noexcept[6/6][¶]

Strokes a box [x0, y0, x1, y1] (floating point coordinates) with an explicit stroke style.

Note

Box is defined as [x0, y0, x1, y1], if you need [x, y, w, h], use stroke_rect() instead.

BLResult BLContext::stroke_rect(
const BLRectI& rect
)noexcept[1/6][¶]

Strokes a rectangle rect (integer coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_rect(
const BLRectI& rect,
const StyleT& style
)noexcept[2/6][¶]

Strokes a rectangle rect (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_rect(
const BLRect& rect
)noexcept[3/6][¶]

Strokes a rectangle rect (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_rect(
const BLRect& rect,
const StyleT& style
)noexcept[4/6][¶]

Strokes a rectangle rect (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_rect(
double x,
double y,
double w,
double h
)noexcept[5/6][¶]

Strokes a rectangle [x, y, w, h] (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_rect(
double x,
double y,
double w,
double h,
const StyleT& style
)noexcept[6/6][¶]

Strokes a rectangle [x, y, w, h] (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_line(
const BLLine& line
)noexcept[1/6][¶]

Strokes a line specified as line (floating point coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_line(
const BLLine& line,
const StyleT& style
)noexcept[2/6][¶]

Strokes a line specified as line (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_line(
const BLPoint& p0,
const BLPoint& p1
)noexcept[3/6][¶]

Strokes a line starting at p0 and ending at p1 (floating point coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_line(
const BLPoint& p0,
const BLPoint& p1,
const StyleT& style
)noexcept[4/6][¶]

Strokes a line starting at p0 and ending at p1 (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_line(
double x0,
double y0,
double x1,
double y1
)noexcept[5/6][¶]

Strokes a line starting at [x0, y0] and ending at [x1, y1] (floating point coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_line(
double x0,
double y0,
double x1,
double y1,
const StyleT& style
)noexcept[6/6][¶]

Strokes a line starting at [x0, y0] and ending at [x1, y1] (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_circle(
const BLCircle& circle
)noexcept[1/4][¶]

Strokes a circle (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_circle(
const BLCircle& circle,
const StyleT& style
)noexcept[2/4][¶]

Strokes a circle (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_circle(
double cx,
double cy,
double r
)noexcept[3/4][¶]

Strokes a circle at [cx, cy] and radius r (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_circle(
double cx,
double cy,
double r,
const StyleT& style
)noexcept[4/4][¶]

Strokes a circle at [cx, cy] and radius r (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_ellipse(
const BLEllipse& ellipse
)noexcept[1/4][¶]

Strokes an ellipse (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_ellipse(
const BLEllipse& ellipse,
const StyleT& style
)noexcept[2/4][¶]

Strokes an ellipse (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_ellipse(
double cx,
double cy,
double rx,
double ry
)noexcept[3/4][¶]

Strokes an ellipse at [cx, cy] with radius [rx, ry] (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_ellipse(
double cx,
double cy,
double rx,
double ry,
const StyleT& style
)noexcept[4/4][¶]

Strokes an ellipse at [cx, cy] with radius [rx, ry] (floating point coordinates) with en explicit stroke style.

BLResult BLContext::stroke_round_rect(
const BLRoundRect& rr
)noexcept[1/8][¶]

Strokes a rounded rectangle rr (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_round_rect(
const BLRoundRect& rr,
const StyleT& style
)noexcept[2/8][¶]

Strokes a rounded rectangle rr (floating point coordinates) with en explicit stroke style.

BLResult BLContext::stroke_round_rect(
const BLRect& rect,
double r
)noexcept[3/8][¶]

Strokes a rounded rectangle bounded by rect with radius r with the current stroke style.

BLResult BLContext::stroke_round_rect(
const BLRect& rect,
double rx,
double ry
)noexcept[4/8][¶]

Strokes a rounded rectangle bounded by rect with radius [rx, ry] with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_round_rect(
const BLRect& rect,
double rx,
double ry,
const StyleT& style
)noexcept[5/8][¶]

Strokes a rounded rectangle bounded by rect with radius [rx, ry] with en explicit stroke style.

BLResult BLContext::stroke_round_rect(
double x,
double y,
double w,
double h,
double r
)noexcept[6/8][¶]

Strokes a rounded rectangle bounded by [x, y, w, h] with radius r with the current stroke style.

BLResult BLContext::stroke_round_rect(
double x,
double y,
double w,
double h,
double rx,
double ry
)noexcept[7/8][¶]

Strokes a rounded rectangle bounded as [x, y, w, h] with radius [rx, ry] with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_round_rect(
double x,
double y,
double w,
double h,
double rx,
double ry,
const StyleT& style
)noexcept[8/8][¶]

Strokes a rounded rectangle bounded as [x, y, w, h] with radius [rx, ry] with an explicit stroke style.

BLResult BLContext::stroke_arc(
const BLArc& arc
)noexcept[1/5][¶]

Strokes an arc with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_arc(
const BLArc& arc,
const StyleT& style
)noexcept[2/5][¶]

Strokes an arc with an explicit stroke `style.

BLResult BLContext::stroke_arc(
double cx,
double cy,
double r,
double start,
double sweep
)noexcept[3/5][¶]

Strokes a chord at [cx, cy] with radius r at start of sweep (floating point coordinates) with the current stroke style.

BLResult BLContext::stroke_arc(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep
)noexcept[4/5][¶]

Strokes a chord at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_arc(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep,
const StyleT& style
)noexcept[5/5][¶]

Strokes a chord at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_chord(
const BLArc& chord
)noexcept[1/5][¶]

Strokes a chord (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_chord(
const BLArc& chord,
const StyleT& style
)noexcept[2/5][¶]

Strokes a chord (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_chord(
double cx,
double cy,
double r,
double start,
double sweep
)noexcept[3/5][¶]

Strokes a chord at [cx, cy] with radius r at start of sweep (floating point coordinates) with the current stroke style.

BLResult BLContext::stroke_chord(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep
)noexcept[4/5][¶]

Strokes a chord at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_chord(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep,
const StyleT& style
)noexcept[5/5][¶]

Strokes a chord at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_pie(
const BLArc& pie
)noexcept[1/5][¶]

Strokes a pie (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_pie(
const BLArc& pie,
const StyleT& style
)noexcept[2/5][¶]

Strokes a pie (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_pie(
double cx,
double cy,
double r,
double start,
double sweep
)noexcept[3/5][¶]

Strokes a pie at [cx, cy] with radius r at start of sweep (floating point coordinates) with the current stroke style.

BLResult BLContext::stroke_pie(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep
)noexcept[4/5][¶]

Strokes a pie at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_pie(
double cx,
double cy,
double rx,
double ry,
double start,
double sweep,
const StyleT& style
)noexcept[5/5][¶]

Strokes a pie at [cx, cy] with radius [rx, ry] at start of sweep (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_triangle(
const BLTriangle& triangle
)noexcept[1/4][¶]

Strokes a triangle (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_triangle(
const BLTriangle& triangle,
const StyleT& style
)noexcept[2/4][¶]

Strokes a triangle (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_triangle(
double x0,
double y0,
double x1,
double y1,
double x2,
double y2
)noexcept[3/4][¶]

Strokes a triangle defined by [x0, y0], [x1, y1], [x2, y2] (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_triangle(
double x0,
double y0,
double x1,
double y1,
double x2,
double y2,
const StyleT& style
)noexcept[4/4][¶]

Strokes a triangle defined by [x0, y0], [x1, y1], [x2, y2] (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_polyline(
const BLArrayView<BLPoint>& poly
)noexcept[1/8][¶]

Strokes a polyline poly (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_polyline(
const BLArrayView<BLPoint>& poly,
const StyleT& style
)noexcept[2/8][¶]

Strokes a polyline poly (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_polyline(
const BLPoint* poly,
size_t n
)noexcept[3/8][¶]

Strokes a polyline poly having n vertices (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_polyline(
const BLPoint* poly,
size_t n,
const StyleT& style
)noexcept[4/8][¶]

Strokes a polyline poly having n vertices (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_polyline(
const BLArrayView<BLPointI>& poly
)noexcept[5/8][¶]

Strokes a polyline poly (integer coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_polyline(
const BLArrayView<BLPointI>& poly,
const StyleT& style
)noexcept[6/8][¶]

Strokes a polyline poly (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_polyline(
const BLPointI* poly,
size_t n
)noexcept[7/8][¶]

Strokes a polyline poly having n vertices (integer coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_polyline(
const BLPointI* poly,
size_t n,
const StyleT& style
)noexcept[8/8][¶]

Strokes a polyline poly having n vertices (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_polygon(
const BLArrayView<BLPoint>& poly
)noexcept[1/8][¶]

Strokes a polygon poly (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_polygon(
const BLArrayView<BLPoint>& poly,
const StyleT& style
)noexcept[2/8][¶]

Strokes a polygon poly (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_polygon(
const BLPoint* poly,
size_t n
)noexcept[3/8][¶]

Strokes a polygon poly having n vertices (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_polygon(
const BLPoint* poly,
size_t n,
const StyleT& style
)noexcept[4/8][¶]

Strokes a polygon poly having n vertices (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_polygon(
const BLArrayView<BLPointI>& poly
)noexcept[5/8][¶]

Strokes a polygon poly (integer coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_polygon(
const BLArrayView<BLPointI>& poly,
const StyleT& style
)noexcept[6/8][¶]

Strokes a polygon poly (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_polygon(
const BLPointI* poly,
size_t n
)noexcept[7/8][¶]

Strokes a polygon poly having n vertices (integer coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_polygon(
const BLPointI* poly,
size_t n,
const StyleT& style
)noexcept[8/8][¶]

Strokes a polygon poly having n vertices (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_box_array(
const BLArrayView<BLBox>& array
)noexcept[1/8][¶]

Strokes an array of boxes (floating point coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_box_array(
const BLArrayView<BLBox>& array,
const StyleT& style
)noexcept[2/8][¶]

Strokes an array of boxes (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_box_array(
const BLBox* array,
size_t n
)noexcept[3/8][¶]

Strokes an array of boxes of size n (floating point coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_box_array(
const BLBox* array,
size_t n,
const StyleT& style
)noexcept[4/8][¶]

Strokes an array of boxes of size n (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_box_array(
const BLArrayView<BLBoxI>& array
)noexcept[5/8][¶]

Strokes an array of boxes (integer coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_box_array(
const BLArrayView<BLBoxI>& array,
const StyleT& style
)noexcept[6/8][¶]

Strokes an array of boxes (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_box_array(
const BLBoxI* array,
size_t n
)noexcept[7/8][¶]

Strokes an array of boxes of size n (integer coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_box_array(
const BLBoxI* array,
size_t n,
const StyleT& style
)noexcept[8/8][¶]

Strokes an array of boxes of size n (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_rect_array(
const BLArrayView<BLRect>& array
)noexcept[1/8][¶]

Strokes an array of rectangles (floating point coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_rect_array(
const BLArrayView<BLRect>& array,
const StyleT& style
)noexcept[2/8][¶]

Strokes an array of rectangles (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_rect_array(
const BLRect* array,
size_t n
)noexcept[3/8][¶]

Strokes an array of rectangles of size n (floating point coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_rect_array(
const BLRect* array,
size_t n,
const StyleT& style
)noexcept[4/8][¶]

Strokes an array of rectangles of size n (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_rect_array(
const BLArrayView<BLRectI>& array
)noexcept[5/8][¶]

Strokes an array of rectangles (integer coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_rect_array(
const BLArrayView<BLRectI>& array,
const StyleT& style
)noexcept[6/8][¶]

Strokes an array of rectangles (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_rect_array(
const BLRectI* array,
size_t n
)noexcept[7/8][¶]

Strokes an array of rectangles of size n (integer coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_rect_array(
const BLRectI* array,
size_t n,
const StyleT& style
)noexcept[8/8][¶]

Strokes an array of rectangles of size n (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_path(
const BLPathCore& path
)noexcept[1/4][¶]

Strokes the given path with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_path(
const BLPathCore& path,
const StyleT& style
)noexcept[2/4][¶]

Strokes the given path with an explicit stroke style.

BLResult BLContext::stroke_path(
const BLPoint& origin,
const BLPathCore& path
)noexcept[3/4][¶]

Strokes the given path translated by origin with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_path(
const BLPoint& origin,
const BLPathCore& path,
const StyleT& style
)noexcept[4/4][¶]

Strokes the given path translated by origin with an explicit stroke style.

BLResult BLContext::stroke_geometry(
const void* data
)noexcept[1/2][¶]

Strokes the passed geometry specified by geometry type and data with the default stroke style.

Note

This function provides a low-level interface that can be used in cases in which geometry type and data parameters are passed to a wrapper function that just passes them to the rendering context. It's a good way of creating wrappers, but generally low-level for a general purpose use, so please use this with caution.

template<typename StyleT>
BLResult BLContext::stroke_geometry(
const void* data,
const StyleT& style
)noexcept[2/2][¶]

Strokes the passed geometry specified by geometry type and data with an explicit stroke style.

Note

This function provides a low-level interface that can be used in cases in which geometry type and data parameters are passed to a wrapper function that just passes them to the rendering context. It's a good way of creating wrappers, but generally low-level for a general purpose use, so please use this with caution.

BLResult BLContext::stroke_utf8_text(
const BLPointI& origin,
const BLFontCore& font,
const char* text,
size_t size = SIZE_MAX
)noexcept[1/8][¶]

Strokes UTF-8 encoded string passed as text and size by using the given font at origin (integer coordinates) with the default stroke style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, use either this function with a size parameter set (which contains the number of bytes of text string, and not the number of UTF-8 characters) or an overloaded function that accepts a convenience BLStringView parameter instead of text and size.

template<typename StyleT>
BLResult BLContext::stroke_utf8_text(
const BLPointI& origin,
const BLFontCore& font,
const char* text,
size_t size,
const StyleT& style
)noexcept[2/8][¶]

Strokes UTF-8 encoded string passed as text and size by using the given font at origin (integer coordinates) with an explicit stroke style.

Note

Pass SIZE_MAX to size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, use either this function with a size parameter set (which contains the number of bytes of text string, and not the number of UTF-8 characters) or an overloaded function that accepts a convenience BLStringView parameter instead of text and size.

BLResult BLContext::stroke_utf8_text(
const BLPointI& origin,
const BLFontCore& font,
const BLStringView& view
)noexcept[3/8][¶]

Strokes UTF-8 encoded string passed as string view by using the given font at origin (floating point coordinates) with the default stroke style.

template<typename StyleT>
BLResult BLContext::stroke_utf8_text(
const BLPointI& origin,
const BLFontCore& font,
const BLStringView& view,
const StyleT& style
)noexcept[4/8][¶]

Strokes UTF-8 encoded string passed as string view by using the given font at origin (floating point coordinates) with an explicit stroke style.

BLResult BLContext::stroke_utf8_text(
const BLPoint& origin,
const BLFontCore& font,
const char* text,
size_t size = SIZE_MAX
)noexcept[5/8][¶]

Strokes UTF-8 encoded string passed as text and size by using the given font at origin (integer coordinates) with the default stroke style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, use either this function with a size parameter set (which contains the number of bytes of text string, and not the number of UTF-8 characters) or an overloaded function that accepts a convenience BLStringView parameter instead of text and size.

template<typename StyleT>
BLResult BLContext::stroke_utf8_text(
const BLPoint& origin,
const BLFontCore& font,
const char* text,
size_t size,
const StyleT& style
)noexcept[6/8][¶]

Strokes UTF-8 encoded string passed as text and size by using the given font at origin (integer coordinates) with an explicit stroke style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, use either this function with a size parameter set (which contains the number of bytes of text string, and not the number of UTF-8 characters) or an overloaded function that accepts a convenience BLStringView parameter instead of text and size.

BLResult BLContext::stroke_utf8_text(
const BLPoint& origin,
const BLFontCore& font,
const BLStringView& view
)noexcept[7/8][¶]

Strokes UTF-8 encoded string passed as string view by using the given font at origin (floating point coordinates).

template<typename StyleT>
BLResult BLContext::stroke_utf8_text(
const BLPoint& origin,
const BLFontCore& font,
const BLStringView& view,
const StyleT& style
)noexcept[8/8][¶]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

BLResult BLContext::stroke_utf16_text(
const BLPointI& origin,
const BLFontCore& font,
const uint16_t* text,
size_t size = SIZE_MAX
)noexcept[1/4][¶]

Strokes UTF-16 encoded string passed as text and size by using the given font at origin (integer coordinates) with the default stroke style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated UTF-16 string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 16-bit values).

template<typename StyleT>
BLResult BLContext::stroke_utf16_text(
const BLPointI& origin,
const BLFontCore& font,
const uint16_t* text,
size_t size,
const StyleT& style
)noexcept[2/4][¶]

Strokes UTF-16 encoded string passed as text and size by using the given font at origin (integer coordinates) with an explicit stroke style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 16-bit values).

BLResult BLContext::stroke_utf16_text(
const BLPoint& origin,
const BLFontCore& font,
const uint16_t* text,
size_t size = SIZE_MAX
)noexcept[3/4][¶]

Strokes UTF-16 encoded string passed as text and size by using the given font at origin (floating point coordinates) with the default stroke style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated UTF-16 string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 16-bit values).

template<typename StyleT>
BLResult BLContext::stroke_utf16_text(
const BLPoint& origin,
const BLFontCore& font,
const uint16_t* text,
size_t size,
const StyleT& style
)noexcept[4/4][¶]

Strokes UTF-16 encoded string passed as text and size by using the given font at origin (floating point coordinates) with an explicit stroke style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 16-bit values).

BLResult BLContext::stroke_utf32_text(
const BLPointI& origin,
const BLFontCore& font,
const uint32_t* text,
size_t size = SIZE_MAX
)noexcept[1/4][¶]

Strokes UTF-32 encoded string passed as text and size by using the given font at origin (integer coordinates) with the default stroke style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated UTF-32 string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 32-bit values).

template<typename StyleT>
BLResult BLContext::stroke_utf32_text(
const BLPointI& origin,
const BLFontCore& font,
const uint32_t* text,
size_t size,
const StyleT& style
)noexcept[2/4][¶]

Strokes UTF-32 encoded string passed as text and size by using the given font at origin (integer coordinates) with an explicit stroke style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 32-bit values).

BLResult BLContext::stroke_utf32_text(
const BLPoint& origin,
const BLFontCore& font,
const uint32_t* text,
size_t size = SIZE_MAX
)noexcept[3/4][¶]

Strokes UTF-32 encoded string passed as text and size by using the given font at origin (floating point coordinates) with the default stroke style.

Note

The size parameter defaults to SIZE_MAX, which informs Blend2D that the input is a null terminated UTF-32 string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 32-bit values).

template<typename StyleT>
BLResult BLContext::stroke_utf32_text(
const BLPoint& origin,
const BLFontCore& font,
const uint32_t* text,
size_t size,
const StyleT& style
)noexcept[4/4][¶]

Strokes UTF-32 encoded string passed as text and size by using the given font at origin (floating point coordinates) with an explicit stroke style.

Note

Pass SIZE_MAX in size to inform Blend2D that the input is a null terminated string. If you want to pass a non-null terminated string or a substring of an existing string, specify size parameter to the size of the text buffer in code units (the number of 32-bit values).

BLResult BLContext::stroke_glyph_run(
const BLPointI& origin,
const BLFontCore& font,
const BLGlyphRun& glyph_run
)noexcept[1/4][¶]

Strokes a glyph_run by using the given font at origin (integer coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_glyph_run(
const BLPointI& origin,
const BLFontCore& font,
const BLGlyphRun& glyph_run,
const StyleT& style
)noexcept[2/4][¶]

Strokes a glyph_run by using the given font at origin (integer coordinates) with an explicit stroke style.

BLResult BLContext::stroke_glyph_run(
const BLPoint& origin,
const BLFontCore& font,
const BLGlyphRun& glyph_run
)noexcept[3/4][¶]

Strokes the passed glyph_run by using the given font at origin (floating point coordinates) with the current stroke style.

template<typename StyleT>
BLResult BLContext::stroke_glyph_run(
const BLPoint& origin,
const BLFontCore& font,
const BLGlyphRun& glyph_run,
const StyleT& style
)noexcept[4/4][¶]

Strokes the passed glyph_run by using the given font at origin (floating point coordinates) with an explicit stroke style.

BLResult BLContext::blit_image(
const BLPointI& origin,
const BLImageCore& src
)noexcept[1/8][¶]

Blits source image src at coordinates specified by origin (int coordinates).

BLResult BLContext::blit_image(
const BLPointI& origin,
const BLImageCore& src,
const BLRectI& src_area
)noexcept[2/8][¶]

Blits an area in source image src specified by src_area at coordinates specified by origin (int coordinates).

BLResult BLContext::blit_image(
const BLPoint& origin,
const BLImageCore& src
)noexcept[3/8][¶]

Blits source image src at coordinates specified by origin (floating point coordinates).

BLResult BLContext::blit_image(
const BLPoint& origin,
const BLImageCore& src,
const BLRectI& src_area
)noexcept[4/8][¶]

Blits an area of source image src specified by src_area at coordinates specified by origin (floating point coordinates).

BLResult BLContext::blit_image(
const BLRectI& rect,
const BLImageCore& src
)noexcept[5/8][¶]

Blits a source image src scaled to fit into rect rectangle (int coordinates).

BLResult BLContext::blit_image(
const BLRectI& rect,
const BLImageCore& src,
const BLRectI& src_area
)noexcept[6/8][¶]

Blits an area of source image src specified by src_area scaled to fit into rect rectangle (int coordinates).

BLResult BLContext::blit_image(
const BLRect& rect,
const BLImageCore& src
)noexcept[7/8][¶]

Blits a source image src scaled to fit into rect rectangle (floating point coordinates).

BLResult BLContext::blit_image(
const BLRect& rect,
const BLImageCore& src,
const BLRectI& src_area
)noexcept[8/8][¶]

Blits an area of source image src specified by src_area scaled to fit into rect rectangle (floating point coordinates).