projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated NanoSVG to latest version (22 April 2019)
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
third-party
/
nanosvg
/
nanosvg.h
diff --git
a/dali-toolkit/third-party/nanosvg/nanosvg.h
b/dali-toolkit/third-party/nanosvg/nanosvg.h
index
0e2bad8
..
27f8ac0
100644
(file)
--- a/
dali-toolkit/third-party/nanosvg/nanosvg.h
+++ b/
dali-toolkit/third-party/nanosvg/nanosvg.h
@@
-41,21
+41,21
@@
// NanoSVG can return the paths in few different units. For example if you want to render an image, you may choose
// to get the paths in pixels, or if you are feeding the data into a CNC-cutter, you may want to use millimeters.
//
// NanoSVG can return the paths in few different units. For example if you want to render an image, you may choose
// to get the paths in pixels, or if you are feeding the data into a CNC-cutter, you may want to use millimeters.
//
-// The units passed to NanoVG should be one of: 'px', 'pt', 'pc' 'mm', 'cm', or 'in'.
+// The units passed to Nano
S
VG should be one of: 'px', 'pt', 'pc' 'mm', 'cm', or 'in'.
// DPI (dots-per-inch) controls how the unit conversion is done.
//
// If you don't know or care about the units stuff, "px" and 96 should get you going.
/* Example Usage:
// DPI (dots-per-inch) controls how the unit conversion is done.
//
// If you don't know or care about the units stuff, "px" and 96 should get you going.
/* Example Usage:
- // Load
-
SNVGI
mage* image;
+ // Load
SVG
+
NSVGi
mage* image;
image = nsvgParseFromFile("test.svg", "px", 96);
printf("size: %f x %f\n", image->width, image->height);
// Use...
image = nsvgParseFromFile("test.svg", "px", 96);
printf("size: %f x %f\n", image->width, image->height);
// Use...
- for (shape = image->shapes; shape != NULL; shape = shape->next) {
- for (path = shape->paths; path != NULL; path = path->next) {
- for (i = 0; i < path->npts-1; i += 3) {
+ for (
NSVGshape *
shape = image->shapes; shape != NULL; shape = shape->next) {
+ for (
NSVGpath *
path = shape->paths; path != NULL; path = path->next) {
+ for (i
nt i
= 0; i < path->npts-1; i += 3) {
float* p = &path->pts[i*2];
drawCubicBez(p[0],p[1], p[2],p[3], p[4],p[5], p[6],p[7]);
}
float* p = &path->pts[i*2];
drawCubicBez(p[0],p[1], p[2],p[3], p[4],p[5], p[6],p[7]);
}
@@
-69,30
+69,30
@@
enum NSVGpaintType {
NSVG_PAINT_NONE = 0,
NSVG_PAINT_COLOR = 1,
NSVG_PAINT_LINEAR_GRADIENT = 2,
NSVG_PAINT_NONE = 0,
NSVG_PAINT_COLOR = 1,
NSVG_PAINT_LINEAR_GRADIENT = 2,
- NSVG_PAINT_RADIAL_GRADIENT = 3
,
+ NSVG_PAINT_RADIAL_GRADIENT = 3
};
enum NSVGspreadType {
NSVG_SPREAD_PAD = 0,
NSVG_SPREAD_REFLECT = 1,
};
enum NSVGspreadType {
NSVG_SPREAD_PAD = 0,
NSVG_SPREAD_REFLECT = 1,
- NSVG_SPREAD_REPEAT = 2
,
+ NSVG_SPREAD_REPEAT = 2
};
enum NSVGlineJoin {
NSVG_JOIN_MITER = 0,
NSVG_JOIN_ROUND = 1,
};
enum NSVGlineJoin {
NSVG_JOIN_MITER = 0,
NSVG_JOIN_ROUND = 1,
- NSVG_JOIN_BEVEL = 2
,
+ NSVG_JOIN_BEVEL = 2
};
enum NSVGlineCap {
NSVG_CAP_BUTT = 0,
NSVG_CAP_ROUND = 1,
};
enum NSVGlineCap {
NSVG_CAP_BUTT = 0,
NSVG_CAP_ROUND = 1,
- NSVG_CAP_SQUARE = 2
,
+ NSVG_CAP_SQUARE = 2
};
enum NSVGfillRule {
NSVG_FILLRULE_NONZERO = 0,
};
enum NSVGfillRule {
NSVG_FILLRULE_NONZERO = 0,
- NSVG_FILLRULE_EVENODD = 1
,
+ NSVG_FILLRULE_EVENODD = 1
};
enum NSVGflags {
};
enum NSVGflags {
@@
-168,7
+168,10
@@
NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
// Important note: changes the string.
NSVGimage* nsvgParse(char* input, const char* units, float dpi);
// Important note: changes the string.
NSVGimage* nsvgParse(char* input, const char* units, float dpi);
-// Deletes list of paths.
+// Duplicates a path.
+NSVGpath* nsvgDuplicatePath(NSVGpath* p);
+
+// Deletes an image.
void nsvgDelete(NSVGimage* image);
#endif // NANOSVG_H
void nsvgDelete(NSVGimage* image);
#endif // NANOSVG_H