![]() |
ThorVG v1.0
|
ThorVG classes and enumerations providing C++ APIs. More...
Classes | |
| struct | Point |
| A data structure representing a point in two-dimensional space. More... | |
| struct | Matrix |
| A data structure representing a three-dimensional matrix. More... | |
| class | Paint |
| An abstract class for managing graphical elements. More... | |
| class | Fill |
| An abstract class representing the gradient fill of the Shape object. More... | |
| class | Canvas |
| An abstract class for drawing graphical elements. More... | |
| class | LinearGradient |
| A class representing the linear gradient fill of the Shape object. More... | |
| class | RadialGradient |
| A class representing the radial gradient fill of the Shape object. More... | |
| class | Shape |
| A class representing two-dimensional figures and their properties. More... | |
| class | Picture |
| A class representing an image read in one of the supported formats: raw, svg, png, jpg, lot and etc. Besides the methods inherited from the Paint, it provides methods to load & draw images on the canvas. More... | |
| class | Scene |
| A class to composite children paints. More... | |
| class | Text |
| A class to represent text objects in a graphical context, allowing for rendering and manipulation of unicode text. More... | |
| class | SwCanvas |
| A class for the rendering graphical elements with a software raster engine. More... | |
| class | GlCanvas |
| A class for the rendering graphic elements with a GL raster engine. More... | |
| class | WgCanvas |
| A class for the rendering graphic elements with a WebGPU raster engine. More... | |
| class | Initializer |
| A class that enables initialization and termination of the TVG engines. More... | |
| class | Animation |
| The Animation class enables manipulation of animatable images. More... | |
| class | Saver |
| A class for exporting a paint object into a specified file, from which to recover the paint data later. More... | |
| class | Accessor |
| The Accessor is a utility class to debug the Scene structure by traversing the scene-tree. More... | |
Enumerations | |
| enum struct | Result { Success = 0 , InvalidArguments , InsufficientCondition , FailedAllocation , MemoryCorruption , NonSupport , Unknown = 255 } |
| Enumeration specifying the result from the APIs. More... | |
| enum struct | ColorSpace : uint8_t { ABGR8888 = 0 , ARGB8888 , ABGR8888S , ARGB8888S , Grayscale8 , Unknown = 255 } |
| Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color. More... | |
| enum struct | EngineOption : uint8_t { None = 0 , Default = 1 << 0 , SmartRender = 1 << 1 } |
| Enumeration to specify rendering engine behavior. More... | |
| enum struct | PathCommand : uint8_t { Close = 0 , MoveTo , LineTo , CubicTo } |
| Enumeration specifying the values of the path commands accepted by ThorVG. More... | |
| enum struct | StrokeCap : uint8_t { Butt = 0 , Round , Square } |
| Enumeration determining the ending type of a stroke in the open sub-paths. More... | |
| enum struct | StrokeJoin : uint8_t { Miter = 0 , Round , Bevel } |
| Enumeration determining the style used at the corners of joined stroked path segments. More... | |
| enum struct | FillSpread : uint8_t { Pad = 0 , Reflect , Repeat } |
| Enumeration specifying how to fill the area outside the gradient bounds. More... | |
| enum struct | FillRule : uint8_t { NonZero = 0 , EvenOdd } |
| Enumeration specifying the algorithm used to establish which parts of the shape are treated as the inside of the shape. More... | |
| enum struct | MaskMethod : uint8_t { None = 0 , Alpha , InvAlpha , Luma , InvLuma , Add , Subtract , Intersect , Difference , Lighten , Darken } |
| Enumeration indicating the method used in the mask of two objects - the target and the source. More... | |
| enum struct | BlendMethod : uint8_t { Normal = 0 , Multiply , Screen , Overlay , Darken , Lighten , ColorDodge , ColorBurn , HardLight , SoftLight , Difference , Exclusion , Hue , Saturation , Color , Luminosity , Add , Composition = 255 } |
| Enumeration indicates the method used for blending paint. Please refer to the respective formulas for each method. More... | |
| enum struct | SceneEffect : uint8_t { ClearAll = 0 , GaussianBlur , DropShadow , Fill , Tint , Tritone } |
| Enumeration that defines methods used for Scene Effects. More... | |
| enum struct | TextWrap : uint8_t { None = 0 , Character , Word , Smart , Ellipsis } |
| Enumeration that defines methods used for wrapping text. More... | |
| enum struct | Type : uint8_t { Undefined = 0 , Shape , Scene , Picture , Text , LinearGradient = 10 , RadialGradient } |
| Enumeration specifying the ThorVG class type value. More... | |
ThorVG classes and enumerations providing C++ APIs.
|
strong |
Enumeration indicates the method used for blending paint. Please refer to the respective formulas for each method.
Notation: S(source paint as the top layer), D(destination as the bottom layer), Sa(source paint alpha), Da(destination alpha)
| Enumerator | |
|---|---|
| Normal | Perform the alpha blending(default). S if (Sa == 255), otherwise (Sa * S) + (255 - Sa) * D. |
| Multiply | Takes the RGB channel values from 0 to 255 of each pixel in the top layer and multiples them with the values for the corresponding pixel from the bottom layer. (S * D) |
| Screen | The values of the pixels in the two layers are inverted, multiplied, and then inverted again. (S + D) - (S * D) |
| Overlay | Combines Multiply and Screen blend modes. (2 * S * D) if (D < 128), otherwise 255 - 2 * (255 - S) * (255 - D) |
| Darken | Creates a pixel that retains the smallest components of the top and bottom layer pixels. min(S, D) |
| Lighten | Only has the opposite action of Darken Only. max(S, D) |
| ColorDodge | Divides the bottom layer by the inverted top layer. D / (255 - S) |
| ColorBurn | Divides the inverted bottom layer by the top layer, and then inverts the result. 255 - (255 - D) / S. |
| HardLight | The same as Overlay but with the color roles reversed. (2 * S * D) if (S < 128), otherwise 255 - 2 * (255 - S) * (255 - D) |
| SoftLight | The same as Overlay but with applying pure black or white does not result in pure black or white. (255 - 2 * S) * (D * D) + (2 * S * D) |
| Difference | Subtracts the bottom layer from the top layer or the other way around, to always get a non-negative value. (S - D) if (S > D), otherwise (D - S) |
| Exclusion | The result is twice the product of the top and bottom layers, subtracted from their sum. S + D - (2 * S * D) |
| Hue | Combine with HSL(Sh + Ds + Dl) then convert it to RGB.
|
| Saturation | Combine with HSL(Dh + Ss + Dl) then convert it to RGB.
|
| Color | Combine with HSL(Sh + Ss + Dl) then convert it to RGB.
|
| Luminosity | Combine with HSL(Dh + Ds + Sl) then convert it to RGB.
|
| Add | Simply adds pixel values of one layer with the other. (S + D) |
| Composition | For intermediate composition layers; suitable for use with Scene or Picture.
|
|
strong |
Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color.
|
strong |
Enumeration to specify rendering engine behavior.
SmartRender may vary depending on platform or backend support. It attempts to optimize rendering performance by updating only the regions of the canvas that have changed between frames (partial redraw). This can be highly effective in scenarios where most of the canvas remains static and only small portions are updated—such as simple animations or GUI interactions. However, in complex scenes where a large portion of the canvas changes frequently (e.g., full-screen animations or heavy object movements), the overhead of tracking changes and managing update regions may outweigh the benefits, resulting in decreased performance compared to the default rendering mode. Thus, it is recommended to benchmark both modes in your specific use case to determine the optimal setting.
|
strong |
Enumeration specifying the algorithm used to establish which parts of the shape are treated as the inside of the shape.
|
strong |
Enumeration specifying how to fill the area outside the gradient bounds.
|
strong |
Enumeration indicating the method used in the mask of two objects - the target and the source.
Notation: S(Source), T(Target), SA(Source Alpha), TA(Target Alpha)
|
strong |
Enumeration specifying the values of the path commands accepted by ThorVG.
|
strong |
Enumeration specifying the result from the APIs.
All ThorVG APIs could potentially return one of the values in the list. Please note that some APIs may additionally specify the reasons that trigger their return values.
|
strong |
Enumeration that defines methods used for Scene Effects.
This enum provides options to apply various post-processing effects to a scene. Scene effects are typically applied to modify the final appearance of a rendered scene, such as blurring.
|
strong |
Enumeration determining the ending type of a stroke in the open sub-paths.
|
strong |
Enumeration determining the style used at the corners of joined stroked path segments.
|
strong |
Enumeration that defines methods used for wrapping text.
This enum provides options to control how text is wrapped when it exceeds the available space. Wrapping affects the layout and flow of text in the rendering area.
| Enumerator | |
|---|---|
| None | Do not wrap text. Text is rendered on a single line and may overflow the bounding area. |
| Character | Wrap at the character level. If a word cannot fit, it is broken into individual characters to fit the line. |
| Word | Wrap at the word level. Words that do not fit are moved to the next line. |
| Smart | Smart choose wrapping method: word wrap first, falling back to character wrap if a word does not fit. |
| Ellipsis | Truncate overflowing text and append an ellipsis ("...") at the end. Typically used for single-line labels. |
|
strong |
Enumeration specifying the ThorVG class type value.
ThorVG's drawing objects can return class type values, allowing you to identify the specific class of each object.
| Enumerator | |
|---|---|
| Undefined | Unknown class. |
| Shape | Shape class. |
| Scene | Scene class. |
| Picture | Picture class. |
| Text | Text class. |
| LinearGradient | LinearGradient class. |
| RadialGradient | RadialGradient class. |