VKVG  
Vulkan Vector Graphics
vkvg-svg.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2022 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy of
5  * this software and associated documentation files (the "Software"), to deal in
6  * the Software without restriction, including without limitation the rights to use,
7  * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8  * Software, and to permit persons to whom the Software is furnished to do so, subject
9  * to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all
12  * copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 #ifndef VKVG_SVG_H
23 #define VKVG_SVG_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #ifdef VKVG_SVG
30 typedef struct _vkvg_svg_t* VkvgSvg;
31 #else
32 typedef struct NSVGimage* VkvgSvg;
33 #endif
44 vkvg_public
45 VkvgSurface vkvg_surface_create_from_svg(VkvgDevice dev, uint32_t width, uint32_t height, const char* svgFilePath);
56 vkvg_public
57 VkvgSurface vkvg_surface_create_from_svg_fragment(VkvgDevice dev, uint32_t width, uint32_t height, char* svgFragment);
66 vkvg_public
67 void vkvg_svg_get_dimensions (VkvgSvg svg, uint32_t* width, uint32_t* height);
68 
76 vkvg_public
77 VkvgSvg vkvg_svg_load (const char* svgFilePath);
78 
84 vkvg_public
85 VkvgSvg vkvg_svg_load_fragment (char* svgFragment);
86 
93 vkvg_public
94 void vkvg_svg_render (VkvgSvg svg, VkvgContext ctx, const char* id);
95 
100 vkvg_public
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 #endif
struct _vkvg_context_t * VkvgContext
The Vkvg drawing Context.
Definition: vkvg.h:296
struct _vkvg_device_t * VkvgDevice
Opaque pointer on a Vkvg device structure.
Definition: vkvg.h:315
struct _vkvg_surface_t * VkvgSurface
Opaque pointer on a Vkvg Surface structure.
Definition: vkvg.h:308
struct NSVGimage * VkvgSvg
Definition: vkvg-svg.h:32
void vkvg_svg_destroy(VkvgSvg svg)
release VkvgSvg pointer resources.
VkvgSvg vkvg_svg_load(const char *svgFilePath)
Load svg file in memory.
VkvgSvg vkvg_svg_load_fragment(char *svgFragment)
Load svg from an svg source fragment.
void vkvg_svg_get_dimensions(VkvgSvg svg, uint32_t *width, uint32_t *height)
get svg dimensions.
VkvgSurface vkvg_surface_create_from_svg_fragment(VkvgDevice dev, uint32_t width, uint32_t height, char *svgFragment)
create surface from svg fragment
void vkvg_svg_render(VkvgSvg svg, VkvgContext ctx, const char *id)
render svg on a context.
VkvgSurface vkvg_surface_create_from_svg(VkvgDevice dev, uint32_t width, uint32_t height, const char *svgFilePath)
load svg file into Surface