]> O.S.I.I.S - jp/vkvg.git/commitdiff
svg sizing and comment
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 9 Mar 2022 12:17:03 +0000 (13:17 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 9 Mar 2022 12:17:03 +0000 (13:17 +0100)
external/vkvg-svg
include/vkvg-svg.h

index a949b6ba735ce888126dc0fa0f9fd01f08acb211..441009b65b2e1e18b403463e9ebba17302fbefa6 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a949b6ba735ce888126dc0fa0f9fd01f08acb211
+Subproject commit 441009b65b2e1e18b403463e9ebba17302fbefa6
index 4f16cc823adc75a3e528bd95deb6852e9c663626..1c4f4ded10784d4a4e52a8fafe8b99682d70cfa6 100644 (file)
@@ -36,7 +36,7 @@ typedef struct NSVGimage* VkvgSvg;
  *
  * Create a new vkvg surface by loading a SVG file.
  * @param dev The vkvg @ref device used for creating the surface.
- * @param filePath The path of the SVG file to load.
+ * @param svgFilePath The path of the SVG file to load.
  * @param width force the rendering width, if 0 autosize from svg.
  * @param height force the rendering height, if 0 autosize from svg.
  * @return The new vkvg surface with the loaded SVG drawing as content, or null if an error occured.
@@ -50,24 +50,53 @@ VkvgSurface vkvg_surface_create_from_svg(VkvgDevice dev, uint32_t width, uint32_
  * @param dev The vkvg device used for creating the surface.
  * @param width force the rendering width, if 0 autosize from svg.
  * @param height force the rendering height, if 0 autosize from svg.
- * @param fragment The SVG fragment to parse.
+ * @param svgFragment The SVG fragment to parse.
  * @return The new vkvg surface with the parsed SVG fragment as content, or null if an error occured.
  */
 vkvg_public
 VkvgSurface vkvg_surface_create_from_svg_fragment(VkvgDevice dev, uint32_t width, uint32_t height, char* svgFragment);
-
+/**
+ * @brief get svg dimensions.
+ *
+ * retrieve dimensions from svg parsing.
+ * @param svg a valid VkvgSvg handle.
+ * @param width pointer to a valid integer to receive the svg width.
+ * @param height pointer to a valid integer to receive the svg height.
+ */
 vkvg_public
 void vkvg_svg_get_dimensions (VkvgSvg svg, uint32_t* width, uint32_t* height);
 
+/**
+ * @brief Load svg file in memory.
+ *
+ * Open a svg file and store source in memory, head is parsed to query the svg dimensions.
+ * @param svgFilePath a valid file path to the svg to load.
+ * @return a VkvgSvg pointer.
+ */
 vkvg_public
 VkvgSvg vkvg_svg_load (const char* svgFilePath);
 
+/**
+ * @brief Load svg from an svg source fragment.
+ * @param svgFragment A valid svg code fragment.
+ * @return a VkvgSvg pointer.
+ */
 vkvg_public
 VkvgSvg vkvg_svg_load_fragment (char* svgFragment);
 
+/**
+ * @brief render svg on a context.
+ * @param svg a valid VkvgSvg pointer.
+ * @param ctx a valid vkvg context.
+ * @param id an optional id to limit rendering to specific <g> elemnt.
+ */
 vkvg_public
 void vkvg_svg_render (VkvgSvg svg, VkvgContext ctx, const char* id);
 
+/**
+ * @brief release VkvgSvg pointer resources.
+ * @param svg a valid VkvgSvg pointer to free.
+ */
 vkvg_public
 void vkvg_svg_destroy (VkvgSvg svg);