VKVG  
Vulkan Vector Graphics
Loading...
Searching...
No Matches
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
26extern "C" {
27#endif
28
29#ifdef VKVG_SVG
30typedef struct _vkvg_svg_t* VkvgSvg;
31#else
32typedef struct NSVGimage* VkvgSvg;
33#endif
44vkvg_public VkvgSurface vkvg_surface_create_from_svg(VkvgDevice dev, uint32_t width, uint32_t height,
45 const char* svgFilePath);
56vkvg_public VkvgSurface vkvg_surface_create_from_svg_fragment(VkvgDevice dev, uint32_t width, uint32_t height,
57 char* svgFragment);
66vkvg_public void vkvg_svg_get_dimensions(VkvgSvg svg, uint32_t* width, uint32_t* height);
67
75vkvg_public VkvgSvg vkvg_svg_load(const char* svgFilePath);
76
82vkvg_public VkvgSvg vkvg_svg_load_fragment(char* svgFragment);
83
90vkvg_public void vkvg_svg_render(VkvgSvg svg, VkvgContext ctx, const char* id);
91
96vkvg_public void vkvg_svg_destroy(VkvgSvg svg);
97
98#ifdef __cplusplus
99}
100#endif
101#endif
struct _vkvg_context_t * VkvgContext
The Vkvg drawing Context.
Definition vkvg.h:306
struct _vkvg_device_t * VkvgDevice
Opaque pointer on a Vkvg device structure.
Definition vkvg.h:325
struct _vkvg_surface_t * VkvgSurface
Opaque pointer on a Vkvg Surface structure.
Definition vkvg.h:318
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