BLContext Class Reference [¶]
Rendering context [C++ API].
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.
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.
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.
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.
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.
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.
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.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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.
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.
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.
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.
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).
Returns whether this and other
point to the same rendering context.
Returns whether this and other
are different rendering contexts.
Returns the target size in abstract units (pixels in case of BLImage).
Returns the target width in abstract units (pixels in case of BLImage).
Returns the target height in abstract units (pixels in case of BLImage).
Returns the target image or null if there is no target image.
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.
Returns the type of this context, see BLContextType.
Tests whether the context is a valid rendering context that has attached target to it.
Returns whether this and other
point to the same rendering context.
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.
Assigns the other
rendering context to this rendering context.
This is the same as using C++ copy-assignment operator, see operator=().
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=().
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.
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.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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).
Calling end()
would implicitly call flush(BL_CONTEXT_FLUSH_SYNC)
, which would flush the render calls queue in case multi-threaded rendering is used.
Flushes the context, see BLContextFlushFlags.
Gets a property of the given name
and assigns it to an initialized value_out
.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Sets a property of the given name
to value
.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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.
Queries accumulated errors as flags, see BLContextErrorFlags.
Errors may accumulate during the lifetime of the rendering context.
Returns the number of saved states in the context (0 means no saved states).
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.
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.
Restores the top-most saved context-state.
Possible return conditions:
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:
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()
.
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.
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.
Sets user transformation matrix to m
.
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
.
Resets user transformation matrix to identity.
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.
Translates the used transformation matrix by [x, y]
.
Translates the used transformation matrix by [p]
(integer).
Translates the used transformation matrix by [p]
(floating-point).
Scales the user transformation matrix by xy
(both X and Y is scaled by xy
).
Scales the user transformation matrix by [x, y]
.
Scales the user transformation matrix by [p]
(floating-point).
Skews the user transformation matrix by [x, y]
.
Skews the user transformation matrix by [p]
(floating-point).
Rotates the user transformation matrix by angle
.
Rotates the user transformation matrix at [x, y]
by angle
.
Rotates the user transformation matrix at origin
(integer) by angle
.
Rotates the user transformation matrix at origin
(floating-point) by angle
.
Transforms the user transformation matrix by transform
.
Post-translates the used transformation matrix by [x, y]
.
Post-translation uses a reversed order of matrix multiplication when compared to translate().
Post-Translates the used transformation matrix by [p]
(integer).
Post-translation uses a reversed order of matrix multiplication when compared to translate().
Post-translates the used transformation matrix by [p]
(floating-point).
Post-translation uses a reversed order of matrix multiplication when compared to translate().
Post-scales the user transformation matrix by xy
(both X and Y is scaled by xy
).
Post-scale uses a reversed order of matrix multiplication when compared to scale().
Post-scales the user transformation matrix by [x, y]
.
Post-scale uses a reversed order of matrix multiplication when compared to scale().
Post-scales the user transformation matrix by [p]
(integer).
Post-scale uses a reversed order of matrix multiplication when compared to scale().
Post-scales the user transformation matrix by [p]
(floating-point).
Post-scale uses a reversed order of matrix multiplication when compared to scale().
Skews the user transformation matrix by [x, y]
.
Post-skew uses a reversed order of matrix multiplication when compared to skew().
Skews the user transformation matrix by [p]
(floating-point).
Post-skew uses a reversed order of matrix multiplication when compared to skew().
Rotates the user transformation matrix by angle
.
Post-rotation uses a reversed order of matrix multiplication when compared to rotate().
Rotates the user transformation matrix at [x, y]
by angle
.
Post-rotation uses a reversed order of matrix multiplication when compared to rotate().
Rotates the user transformation matrix at origin
(integer) by angle
.
Post-rotation uses a reversed order of matrix multiplication when compared to rotate().
Rotates the user transformation matrix at origin
(floating-point) by angle
.
Post-rotation uses a reversed order of matrix multiplication when compared to rotate().
Transforms the user transformation matrix by transform
.
Post-transform uses a reversed order of matrix multiplication when compared to apply_transform().
Stores the result of combining the current MetaTransform
and UserTransform
to MetaTransform
and resets UserTransform
to identity as shown below:
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.
Returns rendering context hints.
Sets the given rendering hint hint_type
to value
.
Returns the rendering quality hint.
This is the same as calling hints() and extracting the rendering quality from it.
Sets rendering quality hint to value
.
Returns the gradient quality hint.
This is the same as calling hints() and extracting the gradient quality from it.
Sets gradient quality hint to value
.
Returns the pattern quality hint.
This is the same as calling hints() and extracting the pattern quality from it.
Sets pattern quality hint to value
.
Returns approximation options.
Returns flatten mode (how curves are flattened).
Sets flatten mode
(how curves are flattened).
Returns tolerance used for curve flattening.
Sets tolerance used for curve flattening.
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.
Returns a global alpha value.
Returns the current style type associated with the given style slot
.
Reads a style state associated with the given style slot
and writes it into style_out
.
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.
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.
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.
The style
argument could be BLGradient, BLPattern, and BLVar.
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.
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.
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.
Swaps fill and stroke styles, see BLContextStyleSwapMode for options.
Returns the current fill style type.
Reads a fill style state and writes it into style_out
variant.
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.
Reads a fill style state and writes it into styleOut
variant.
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.
Sets fill style to style
.
The style
argument could be BLGradient, BLPattern, and BLVar.
Returns fill alpha value.
Returns fill-rule, see BLFillRule.
Sets fill-rule, see BLFillRule.
Returns the current stroke style type.
Reads a stroke style state and writes it into style_out
variant.
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.
Reads a stroke style state and writes it into styleOut
variant.
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.
Sets fill style to style
.
The style
argument could be BLGradient, BLPattern, and BLVar.
Returns stroke width.
Returns stroke miter-limit.
Returns stroke join, see BLStrokeJoin.
Returns stroke start-cap, see BLStrokeCap.
Returns stroke end-cap, see BLStrokeCap.
Returns stroke transform order, see BLStrokeTransformOrder.
Returns stroke dash-offset.
Returns stroke dash-array.
Returns stroke options as a reference to BLStrokeOptions.
Sets miter limit to miter_limit
.
Sets stroke join to stroke_join
, see BLStrokeJoin.
Sets stroke cap of the specified type
to stroke_cap
, see BLStrokeCap.
Sets stroke start cap to stroke_cap
, see BLStrokeCap.
Sets stroke end cap to stroke_cap
, see BLStrokeCap.
Sets all stroke caps to stroke_cap
, see BLStrokeCap.
Sets stroke transformation order to transform_order
, see BLStrokeTransformOrder.
Sets stroke dash-offset to dash_offset
.
Returns stroke alpha value.
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.
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()
.
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.
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)
.
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.
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)
.
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.
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)
.
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.
Fills everything non-clipped with the current fill style.
Fills everything non-clipped with an explicit fill style
.
Fills a box
(floating point coordinates) with the current fill style.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use fill_rect() instead.
Fills a box
(floating point coordinates) with an explicit fill style
.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use fill_rect() instead.
Fills a box
(integer coordinates) with the current fill style.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use fill_rect() instead.
Fills a box
(integer coordinates) with an explicit fill style
.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use fill_rect() instead.
Fills a box [x0, y0, x1, y1]
(floating point coordinates) with the current fill style.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use fill_rect() instead.
Fills a box [x0, y0, x1, y1]
(floating point coordinates) with an explicit fill style
.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use fill_rect() instead.
Fills a rectangle rect
(integer coordinates) with the current fill style.
Fills a rectangle rect
(integer coordinates) with an explicit fill style
.
Fills a rectangle rect
(floating point coordinates) with the current fill style.
Fills a rectangle rect
(floating point coordinates) with an explicit fill style
.
Fills a rectangle [x, y, w, h]
(floating point coordinates) with the current fill style.
Fills a rectangle [x, y, w, h]
(floating point coordinates) with an explicit fill style
.
Fills a circle
(floating point coordinates) with the current fill style.
Fills a circle
(floating point coordinates) with an explicit fill style
.
Fills a circle at [cx, cy]
and radius r
(floating point coordinates) with the current fill style.
Fills a circle at [cx, cy]
and radius r
(floating point coordinates) with an explicit fill style
.
Fills an ellipse
(floating point coordinates) with the current fill style.
Fills an ellipse
(floating point coordinates) with an explicit fill style
.
Fills an ellipse at [cx, cy]
with radius [rx, ry]
(floating point coordinates) with the current fill style.
Fills an ellipse at [cx, cy]
with radius [rx, ry]
(floating point coordinates) with en explicit fill style
.
Fills a rounded rectangle rr
(floating point coordinates) with the current fill style.
Fills a rounded rectangle rr
(floating point coordinates) with en explicit fill style
.
Fills a rounded rectangle bounded by rect
with radius r
with the current fill style.
Fills a rounded rectangle bounded by rect
with radius [rx, ry]
with the current fill style.
Fills a rounded rectangle bounded by rect
with radius [rx, ry]
with en explicit fill style
.
Fills a rounded rectangle bounded by [x, y, w, h]
with radius r
with the current fill style.
Fills a rounded rectangle bounded as [x, y, w, h]
with radius [rx, ry]
with the current fill style.
Fills a rounded rectangle bounded as [x, y, w, h]
with radius [rx, ry]
with an explicit fill style
.
Fills a chord
(floating point coordinates) with the current fill style.
Fills a chord
(floating point coordinates) with an explicit fill style
.
Fills a chord at [cx, cy]
with radius r
at start
of sweep
(floating point coordinates) with the current fill style.
Fills a chord at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with the current fill style.
Fills a chord at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with an explicit fill style
.
Fills a pie
(floating point coordinates) with the current fill style.
Fills a pie
(floating point coordinates) with an explicit fill style
.
Fills a pie at [cx, cy]
with radius r
at start
of sweep
(floating point coordinates) with the current fill style.
Fills a pie at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with the current fill style.
Fills a pie at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with an explicit fill style
.
Fills a triangle
(floating point coordinates) with the current fill style.
Fills a triangle
(floating point coordinates) with an explicit fill style
.
Fills a triangle defined by [x0, y0]
, [x1, y1]
, [x2, y2]
(floating point coordinates) with the current fill style.
Fills a triangle defined by [x0, y0]
, [x1, y1]
, [x2, y2]
(floating point coordinates) with an explicit fill style
.
Fills a polygon poly
(floating point coordinates) with the current fill style.
Fills a polygon poly
(floating point coordinates) with an explicit fill style
.
Fills a polygon poly
having n
vertices (floating point coordinates) with the current fill style.
Fills a polygon poly
having n
vertices (floating point coordinates) with an explicit fill style
.
Fills a polygon poly
(integer coordinates) with the current fill style.
Fills a polygon poly
(integer coordinates) with an explicit fill style
.
Fills a polygon poly
having n
vertices (integer coordinates) with the current fill style.
Fills a polygon poly
having n
vertices (integer coordinates) with an explicit fill style
.
Fills an array
of boxes (floating point coordinates) with the default fill style.
Fills an array
of boxes (floating point coordinates) with an explicit fill style
.
Fills an array
of boxes of size n
(floating point coordinates) with the default fill style.
Fills an array
of boxes of size n
(floating point coordinates) with an explicit fill style
.
Fills an array
of boxes (integer coordinates) with the default fill style.
Fills an array
of boxes (integer coordinates) with an explicit fill style
.
Fills an array
of boxes of size n
(integer coordinates) with the default fill style.
Fills an array of boxes of size n
(integer coordinates) with an explicit fill style
.
Fills an array
of rectangles (floating point coordinates) with the default fill style.
Fills an array
of rectangles (floating point coordinates) with an explicit fill style
.
Fills an array
of rectangles of size n
(floating point coordinates) with the default fill style.
Fills an array
of rectangles of size n
(floating point coordinates) with an explicit fill style
.
Fills an array of rectangles (integer coordinates) with the default fill style.
Fills an array of rectangles (integer coordinates) with an explicit fill style
.
Fills an array
of rectangles of size n
(integer coordinates) with the default fill style.
Fills an array
of rectangles of size n
(integer coordinates) with an explicit fill style
.
Fills the given path
with an explicit fill style
.
Fills the given path
translated by origin
with the default fill style.
Fills the given path
translated by origin
with an explicit fill style
.
Fills the passed geometry specified by geometry type
and data
with the default fill style.
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.
Fills the passed geometry specified by geometry type
and data
with an explicit fill style
.
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.
Fills UTF-8 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with the default fill style.
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
.
Fills UTF-8 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with an explicit fill style
.
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
.
Fills UTF-8 encoded string passed as string view
by using the given font
at origin
(floating point coordinates) with the default fill style.
Fills UTF-8 encoded string passed as string view
by using the given font
at origin
(floating point coordinates) with an explicit fill style
.
Fills UTF-8 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with the default fill style.
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
.
Fills UTF-8 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with an explicit fill style
.
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
.
Fills UTF-8 encoded string passed as string view
by using the given font
at origin
(floating point coordinates).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Fills UTF-16 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with the default fill style.
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).
Fills UTF-16 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with an explicit fill style
.
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).
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.
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).
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
.
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).
Fills UTF-32 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with the default fill style.
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).
Fills UTF-32 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with an explicit fill style
.
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).
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.
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).
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
.
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).
Fills a glyph_run
by using the given font
at origin
(integer coordinates) with the current fill style.
Fills a glyph_run
by using the given font
at origin
(integer coordinates) with an explicit fill style
.
Fills the passed glyph_run
by using the given font
at origin
(floating point coordinates) with the current fill style.
Fills the passed glyph_run
by using the given font
at origin
(floating point coordinates) with an explicit fill style
.
Fills a source mask
image at coordinates specified by origin
(int coordinates) with the current fill style.
Fills a source mask
image at coordinates specified by origin
(int coordinates) with an explicit fill style
.
Fills a source mask
image specified by mask_area
at coordinates specified by origin
(int coordinates) with the current fill style.
Fills a source mask
image specified by mask_area
at coordinates specified by origin
(int coordinates) with an explicit fill style
.
Fills a source mask
image at coordinates specified by origin
(floating point coordinates) with the current fill style.
Fills a source mask
image at coordinates specified by origin
(floating point coordinates) with an explicit fill style
.
Fills a source mask
image specified by mask_area
at coordinates specified by origin
(floating point coordinates) with the current fill style.
Fills a source mask
image specified by mask_area
at coordinates specified by origin
(floating point coordinates) with an explicit fill style.
Strokes a box
(floating point coordinates) with the current stroke style.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use stroke_rect() instead.
Strokes a box
(floating point coordinates) with an explicit stroke style
.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use stroke_rect() instead.
Strokes a box
(integer coordinates) with the current stroke style.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use stroke_rect() instead.
Strokes a box
(integer coordinates) with an explicit stroke style
.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use stroke_rect() instead.
Strokes a box [x0, y0, x1, y1]
(floating point coordinates) with the current stroke style.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use stroke_rect() instead.
Strokes a box [x0, y0, x1, y1]
(floating point coordinates) with an explicit stroke style
.
Box is defined as [x0, y0, x1, y1]
, if you need [x, y, w, h]
, use stroke_rect() instead.
Strokes a rectangle rect
(integer coordinates) with the current stroke style.
Strokes a rectangle rect
(integer coordinates) with an explicit stroke style
.
Strokes a rectangle rect
(floating point coordinates) with the current stroke style.
Strokes a rectangle rect
(floating point coordinates) with an explicit stroke style
.
Strokes a rectangle [x, y, w, h]
(floating point coordinates) with the current stroke style.
Strokes a rectangle [x, y, w, h]
(floating point coordinates) with an explicit stroke style
.
Strokes a line specified as line
(floating point coordinates) with the default stroke style.
Strokes a line specified as line
(floating point coordinates) with an explicit stroke style
.
Strokes a line starting at p0
and ending at p1
(floating point coordinates) with the default stroke style.
Strokes a line starting at p0
and ending at p1
(floating point coordinates) with an explicit stroke style
.
Strokes a line starting at [x0, y0]
and ending at [x1, y1]
(floating point coordinates) with the default stroke style.
Strokes a line starting at [x0, y0]
and ending at [x1, y1]
(floating point coordinates) with an explicit stroke style
.
Strokes a circle
(floating point coordinates) with the current stroke style.
Strokes a circle
(floating point coordinates) with an explicit stroke style
.
Strokes a circle at [cx, cy]
and radius r
(floating point coordinates) with the current stroke style.
Strokes a circle at [cx, cy]
and radius r
(floating point coordinates) with an explicit stroke style
.
Strokes an ellipse
(floating point coordinates) with the current stroke style.
Strokes an ellipse
(floating point coordinates) with an explicit stroke style
.
Strokes an ellipse at [cx, cy]
with radius [rx, ry]
(floating point coordinates) with the current stroke style.
Strokes an ellipse at [cx, cy]
with radius [rx, ry]
(floating point coordinates) with en explicit stroke style
.
Strokes a rounded rectangle rr
(floating point coordinates) with the current stroke style.
Strokes a rounded rectangle rr
(floating point coordinates) with en explicit stroke style
.
Strokes a rounded rectangle bounded by rect
with radius r
with the current stroke style.
Strokes a rounded rectangle bounded by rect
with radius [rx, ry]
with the current stroke style.
Strokes a rounded rectangle bounded by rect
with radius [rx, ry]
with en explicit stroke style
.
Strokes a rounded rectangle bounded by [x, y, w, h]
with radius r
with the current stroke style.
Strokes a rounded rectangle bounded as [x, y, w, h]
with radius [rx, ry]
with the current stroke style.
Strokes a rounded rectangle bounded as [x, y, w, h]
with radius [rx, ry]
with an explicit stroke style
.
Strokes an arc
with an explicit stroke `style.
Strokes a chord at [cx, cy]
with radius r
at start
of sweep
(floating point coordinates) with the current stroke style.
Strokes a chord at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with the current stroke style.
Strokes a chord at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with an explicit stroke style
.
Strokes a chord
(floating point coordinates) with the current stroke style.
Strokes a chord
(floating point coordinates) with an explicit stroke style
.
Strokes a chord at [cx, cy]
with radius r
at start
of sweep
(floating point coordinates) with the current stroke style.
Strokes a chord at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with the current stroke style.
Strokes a chord at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with an explicit stroke style
.
Strokes a pie
(floating point coordinates) with the current stroke style.
Strokes a pie
(floating point coordinates) with an explicit stroke style
.
Strokes a pie at [cx, cy]
with radius r
at start
of sweep
(floating point coordinates) with the current stroke style.
Strokes a pie at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with the current stroke style.
Strokes a pie at [cx, cy]
with radius [rx, ry]
at start
of sweep
(floating point coordinates) with an explicit stroke style
.
Strokes a triangle
(floating point coordinates) with the current stroke style.
Strokes a triangle
(floating point coordinates) with an explicit stroke style
.
Strokes a triangle defined by [x0, y0]
, [x1, y1]
, [x2, y2]
(floating point coordinates) with the current stroke style.
Strokes a triangle defined by [x0, y0]
, [x1, y1]
, [x2, y2]
(floating point coordinates) with an explicit stroke style
.
Strokes a polyline poly
(floating point coordinates) with the current stroke style.
Strokes a polyline poly
(floating point coordinates) with an explicit stroke style
.
Strokes a polyline poly
having n
vertices (floating point coordinates) with the current stroke style.
Strokes a polyline poly
having n
vertices (floating point coordinates) with an explicit stroke style
.
Strokes a polyline poly
(integer coordinates) with the current stroke style.
Strokes a polyline poly
(integer coordinates) with an explicit stroke style
.
Strokes a polyline poly
having n
vertices (integer coordinates) with the current stroke style.
Strokes a polyline poly
having n
vertices (integer coordinates) with an explicit stroke style
.
Strokes a polygon poly
(floating point coordinates) with the current stroke style.
Strokes a polygon poly
(floating point coordinates) with an explicit stroke style
.
Strokes a polygon poly
having n
vertices (floating point coordinates) with the current stroke style.
Strokes a polygon poly
having n
vertices (floating point coordinates) with an explicit stroke style
.
Strokes a polygon poly
(integer coordinates) with the current stroke style.
Strokes a polygon poly
(integer coordinates) with an explicit stroke style
.
Strokes a polygon poly
having n
vertices (integer coordinates) with the current stroke style.
Strokes a polygon poly
having n
vertices (integer coordinates) with an explicit stroke style
.
Strokes an array
of boxes (floating point coordinates) with the default stroke style.
Strokes an array
of boxes (floating point coordinates) with an explicit stroke style
.
Strokes an array
of boxes of size n
(floating point coordinates) with the default stroke style.
Strokes an array
of boxes of size n
(floating point coordinates) with an explicit stroke style
.
Strokes an array
of boxes (integer coordinates) with the default stroke style.
Strokes an array
of boxes (integer coordinates) with an explicit stroke style
.
Strokes an array
of boxes of size n
(integer coordinates) with the default stroke style.
Strokes an array of boxes of size n
(integer coordinates) with an explicit stroke style
.
Strokes an array
of rectangles (floating point coordinates) with the default stroke style.
Strokes an array
of rectangles (floating point coordinates) with an explicit stroke style
.
Strokes an array
of rectangles of size n
(floating point coordinates) with the default stroke style.
Strokes an array
of rectangles of size n
(floating point coordinates) with an explicit stroke style
.
Strokes an array of rectangles (integer coordinates) with the default stroke style.
Strokes an array of rectangles (integer coordinates) with an explicit stroke style
.
Strokes an array
of rectangles of size n
(integer coordinates) with the default stroke style.
Strokes an array
of rectangles of size n
(integer coordinates) with an explicit stroke style
.
Strokes the given path
with the default stroke style.
Strokes the given path
with an explicit stroke style
.
Strokes the given path
translated by origin
with the default stroke style.
Strokes the given path
translated by origin
with an explicit stroke style
.
Strokes the passed geometry specified by geometry type
and data
with the default stroke style.
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.
Strokes the passed geometry specified by geometry type
and data
with an explicit stroke style
.
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.
Strokes UTF-8 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with the default stroke style.
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
.
Strokes UTF-8 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with an explicit stroke style
.
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
.
Strokes UTF-8 encoded string passed as string view
by using the given font
at origin
(floating point coordinates) with the default stroke style.
Strokes UTF-8 encoded string passed as string view
by using the given font
at origin
(floating point coordinates) with an explicit stroke style
.
Strokes UTF-8 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with the default stroke style.
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
.
Strokes UTF-8 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with an explicit stroke style
.
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
.
Strokes UTF-8 encoded string passed as string view
by using the given font
at origin
(floating point coordinates).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Strokes UTF-16 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with the default stroke style.
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).
Strokes UTF-16 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with an explicit stroke style
.
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).
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.
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).
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
.
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).
Strokes UTF-32 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with the default stroke style.
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).
Strokes UTF-32 encoded string passed as text
and size
by using the given font
at origin
(integer coordinates) with an explicit stroke style
.
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).
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.
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).
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
.
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).
Strokes a glyph_run
by using the given font
at origin
(integer coordinates) with the current stroke style.
Strokes a glyph_run
by using the given font
at origin
(integer coordinates) with an explicit stroke style
.
Strokes the passed glyph_run
by using the given font
at origin
(floating point coordinates) with the current stroke style.
Strokes the passed glyph_run
by using the given font
at origin
(floating point coordinates) with an explicit stroke style
.
Blits source image src
at coordinates specified by origin
(int coordinates).
Blits an area in source image src
specified by src_area
at coordinates specified by origin
(int coordinates).
Blits source image src
at coordinates specified by origin
(floating point coordinates).
Blits an area of source image src
specified by src_area
at coordinates specified by origin
(floating point coordinates).
Blits a source image src
scaled to fit into rect
rectangle (int coordinates).
Blits an area of source image src
specified by src_area
scaled to fit into rect
rectangle (int coordinates).
Blits a source image src
scaled to fit into rect
rectangle (floating point coordinates).