22 #define TVG_EXPORT __declspec(dllexport) 23 #define TVG_DEPRECATED __declspec(deprecated) 25 #define TVG_EXPORT __attribute__ ((visibility ("default"))) 26 #define TVG_DEPRECATED __attribute__ ((__deprecated__)) 30 #define TVG_DEPRECATED 37 #define _TVG_DECLARE_PRIVATE(A) \ 41 A(const A&) = delete; \ 42 const A& operator=(const A&) = delete; \ 45 #define _TVG_DISABLE_CTOR(A) \ 49 #define _TVG_DECLARE_ACCESSOR() \ 56 #define _TVG_DECALRE_IDENTIFIER() \ 57 auto id() const { return _id; } \ 213 Result rotate(
float degree) noexcept;
222 Result scale(
float factor) noexcept;
235 Result translate(
float x,
float y) noexcept;
258 Matrix transform() noexcept;
269 Result opacity(uint8_t o) noexcept;
293 Result bounds(
float* x,
float* y,
float* w,
float* h)
const noexcept;
302 Paint* duplicate()
const noexcept;
309 uint8_t opacity()
const noexcept;
322 _TVG_DECLARE_ACCESSOR();
323 _TVG_DECALRE_IDENTIFIER();
324 _TVG_DECLARE_PRIVATE(
Paint);
382 uint32_t colorStops(
const ColorStop** colorStops)
const noexcept;
398 Fill* duplicate() const noexcept;
400 _TVG_DECALRE_IDENTIFIER();
401 _TVG_DECLARE_PRIVATE(
Fill);
418 Canvas(RenderMethod*);
431 Result reserve(uint32_t n) noexcept;
450 virtual Result push(std::unique_ptr<Paint> paint) noexcept;
462 virtual Result clear(
bool free =
true) noexcept;
486 virtual Result draw() noexcept;
497 virtual Result sync() noexcept;
499 _TVG_DECLARE_PRIVATE(Canvas);
530 Result linear(
float x1,
float y1,
float x2,
float y2) noexcept;
546 Result linear(
float* x1,
float* y1,
float* x2,
float* y2)
const noexcept;
553 static std::unique_ptr<LinearGradient> gen() noexcept;
581 Result radial(
float cx,
float cy,
float radius) noexcept;
594 Result radial(
float* cx,
float* cy,
float* radius)
const noexcept;
601 static std::unique_ptr<RadialGradient> gen() noexcept;
645 Result moveTo(
float x,
float y) noexcept;
659 Result lineTo(
float x,
float y) noexcept;
678 Result cubicTo(
float cx1,
float cy1,
float cx2,
float cy2,
float x,
float y) noexcept;
715 Result appendRect(
float x,
float y,
float w,
float h,
float rx,
float ry) noexcept;
733 Result appendCircle(
float cx,
float cy,
float rx,
float ry) noexcept;
752 Result appendArc(
float cx,
float cy,
float radius,
float startAngle,
float sweep,
bool pie) noexcept;
778 Result stroke(
float width) noexcept;
790 Result stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept;
801 Result stroke(std::unique_ptr<Fill> f) noexcept;
817 Result stroke(
const float* dashPattern, uint32_t cnt) noexcept;
853 Result fill(uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept;
866 Result fill(std::unique_ptr<Fill> f) noexcept;
884 uint32_t pathCommands(
const PathCommand** cmds)
const noexcept;
893 uint32_t pathCoords(
const Point** pts)
const noexcept;
900 const Fill* fill()
const noexcept;
912 Result fillColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a)
const noexcept;
926 float strokeWidth()
const noexcept;
938 Result strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a)
const noexcept;
945 const Fill* strokeFill()
const noexcept;
954 uint32_t strokeDash(
const float** dashPattern)
const noexcept;
975 static std::unique_ptr<Shape> gen() noexcept;
977 _TVG_DECLARE_PRIVATE(
Shape);
1007 Result load(
const std::string& path) noexcept;
1025 TVG_DEPRECATED
Result load(
const char* data, uint32_t size,
bool copy =
false) noexcept;
1044 Result load(
const char* data, uint32_t size,
const std::string& mimeType,
bool copy =
false) noexcept;
1057 Result size(
float w,
float h) noexcept;
1067 Result size(
float* w,
float* h)
const noexcept;
1076 const uint32_t* data(uint32_t* w, uint32_t* h)
const noexcept;
1082 Result paint(std::unique_ptr<Paint> paint) noexcept;
1091 Result load(uint32_t* data, uint32_t w, uint32_t h,
bool copy) noexcept;
1100 Result viewbox(
float* x,
float* y,
float* w,
float* h)
const noexcept;
1107 static std::unique_ptr<Picture> gen() noexcept;
1109 _TVG_DECLARE_PRIVATE(
Picture);
1143 Result push(std::unique_ptr<Paint> paint) noexcept;
1155 Result reserve(uint32_t size) noexcept;
1170 Result clear(
bool free =
true) noexcept;
1177 static std::unique_ptr<Scene> gen() noexcept;
1179 _TVG_DECLARE_PRIVATE(
Scene);
1231 Result target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h,
Colorspace cs) noexcept;
1262 static std::unique_ptr<SwCanvas> gen() noexcept;
1289 Result target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h) noexcept;
1298 static std::unique_ptr<GlCanvas> gen() noexcept;
1391 Result save(std::unique_ptr<Paint> paint,
const std::string& path) noexcept;
1417 static std::unique_ptr<Saver> gen() noexcept;
1419 _TVG_DECLARE_PRIVATE(
Saver);
The pixels of the source and the target are alpha blended. As a result, only the part of the source...
Draws a line from the current point to the given point and sets a new value of the current point...
The stroke is extended in both end-points of a sub-path by a half circle, with a radius equal to the ...
The value returned in all other cases.
The value returned in case of unsuccessful memory allocation.
MempoolPolicy
Enumeration specifying the methods of Memory Pool behavior policy.
Definition: thorvg.h:1206
Ends the current sub-path and connects it with its initial point. This command doesn't expect any poi...
A class for exporting a paint object into a specified file, from which to recover the paint data late...
Definition: thorvg.h:1371
An abstract class representing the gradient fill of the Shape object.
Definition: thorvg.h:339
uint8_t r
Definition: thorvg.h:348
Sets a new initial point of the sub-path and a new current point. This command expects 1 point: the s...
The value returned in case the request cannot be processed - e.g. asking for properties of an object...
StrokeCap
Enumeration determining the ending type of a stroke in the open sub-paths.
Definition: thorvg.h:108
The intersection of the source and the target is determined and only the resulting pixels from the so...
A class representing the radial gradient fill of the Shape object.
Definition: thorvg.h:565
FillRule
Enumeration specifying the algorithm used to establish which parts of the shape are treated as the in...
Definition: thorvg.h:138
A class to composite children paints.
Definition: thorvg.h:1124
The value returned in the event of bad memory handling - e.g. failing in pointer releasing or casting...
The gradient pattern is reflected outside the gradient area until the expected region is filled...
FillSpread
Enumeration specifying how to fill the area outside the gradient bounds.
Definition: thorvg.h:128
uint8_t a
Definition: thorvg.h:351
A data structure representing a point in two-dimensional space.
Definition: thorvg.h:168
A class representing two-dimensional figures and their properties.
Definition: thorvg.h:619
Memory Pool is shared among the SwCanvases.
Definition: thorvg.h:1209
No composition is applied.
A line from the point to a location outside the shape is drawn. The intersections of the line with th...
The pixels of the source and the complement to the target's pixels are alpha blended. As a result, only the part of the source which is not covered by the target is visible.
StrokeJoin
Enumeration determining the style used at the corners of joined stroked path segments.
Definition: thorvg.h:118
A class representing an image read in one of the supported formats: raw, svg, png and etc...
Definition: thorvg.h:989
The remaining area is filled with the closest stop color.
PathCommand
Enumeration specifying the values of the path commands accepted by TVG.
Definition: thorvg.h:97
The value returned in the event of a problem with the arguments given to the API - e...
The value returned in case of a correct request execution.
A class for the rendering graphical elements with a software raster engine.
Definition: thorvg.h:1188
Draws a cubic Bezier curve from the current point to the given point using two given control points a...
The stroke ends exactly at each of the two end-points of a sub-path. For zero length sub-paths no str...
The gradient pattern is repeated continuously beyond the gradient area until the expected region is f...
Colorspace
Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color...
Definition: thorvg.h:1196
A class for the rendering graphic elements with a GL raster engine.
Definition: thorvg.h:1277
The outer corner of the joined path segments is bevelled at the join point. The triangular region of ...
The stroke is extended in both end-points of a sub-path by a rectangle, with the width equal to the s...
A data structure storing the information about the color and its relative position inside the gradien...
Definition: thorvg.h:345
uint8_t b
Definition: thorvg.h:350
Result
Enumeration specifying the result from the APIs.
Definition: thorvg.h:80
CompositeMethod
Enumeration indicating the method used in the composition of two objects - the target and the source...
Definition: thorvg.h:147
An abstract class for managing graphical elements.
Definition: thorvg.h:198
The value returned in case of choosing unsupported options.
An abstract class for drawing graphical elements.
Definition: thorvg.h:415
float offset
Definition: thorvg.h:347
uint8_t g
Definition: thorvg.h:349
A line from the point to a location outside the shape is drawn and its intersections with the path se...
A data structure representing a three-dimensional matrix.
Definition: thorvg.h:181
CanvasEngine
Enumeration specifying the engine type used for the graphics backend. For multiple backeneds bitwise ...
Definition: thorvg.h:158
The outer corner of the joined path segments is spiked. The spike is created by extension beyond the ...
A class representing the linear gradient fill of the Shape object.
Definition: thorvg.h:511
A class that enables initialization and termination of the TVG engines.
Definition: thorvg.h:1309