Giter Club home page Giter Club logo

sdk's Introduction

TinyVG Software Development Kit

This SDK enables you to work with the TinyVG vector graphics format.

Contents

  • Native Library (C ABI)
  • Zig Package
  • Command Line Tooling
    • Offline Rendering (TVG -> TGA)
    • Format Conversion (SVG <-> TVG <-> TVGT)

Building

The SDK is implemented with Zig 0.11.0 and dotnet 6.

To build the SDK (except svg2tvgt), do this:

[user@host sdk]$ zig build
[user@host sdk]$

This will then produce the folders zig-cache (for temporary files) and zig-out, which contains the SDK files for your current platform.

To build svg2tvgt, go into the folder src/tools/svg2tvgt and do this:

[user@host sdk]$ cd src/tools/svg2tvgt/
[user@host svg2tvgt]$ dotnet build
MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  svg2tvgt -> /mnt/src/tools/svg2tvgt/bin/Debug/net6.0/svg2tvgt.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.69
[user@host svg2tvgt]$

This will then produce src/tools/svg2tvgt/bin/Debug/net5.0/svg2tvgt (or .exe if you are on windows).

sdk's People

Contributors

david-vanderson avatar deecellar avatar dweiller avatar lukewilliamboswell avatar vancluever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdk's Issues

svg2tvgt does not handle exponent notation

Error Context: 'm 29.999999,966.99995 c 2.165728,0.62971 2,2.92139 2,4 v 6 l 5.500488,2.93602 v -0.94881 h 1.999512 v 1.87166 l 5.500488,2.53858 v 3 l -0.242802,-1.07127 -5.461299,-0.96633 c -0.142213,0.55588 0,0.96633 -0.830021,1.8397 -0.834042,-0.87337 -0.706803,-1.52334 -0.834042,-2.14146 l -3.632812,-0.66064 h -1.999512 c _0,2.46655 -10e-7,4.60254 -0.798688,9.063.'
Unhandled exception:
System.Exception: Unexpected char 'e', expected one of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ., +, -
   at SvgPathParser.AcceptChar(Char[] list)
   at SvgPathParser.ParseNumberGeneric(Boolean allow_sign)
   at SvgPathParser.ParseCoordinate()
   at SvgPathParser.ParseCoordinatePair()
   at SvgPathParser.ParseCoordinatePairTuple(Int32 tuple_size)
   at SvgPathParser.ParseCoordinatePairTupleSequence(Int32 tuple_size)+MoveNext()
   at SvgPathParser.ParseCurveTo()
   at SvgPathParser.ParseDrawToCommand()
   at SvgPathParser.ParsePath()
   at SvgPathParser.Parse(String str, IPathRenderer renderer)
   at SvgConverter.TranslateNodes(AnalyzeResult data, TvgStream stream, SvgNode node)
   at SvgConverter.TranslateNodes(AnalyzeResult data, TvgStream stream, SvgNode node)
   at SvgConverter.TranslateNodes(AnalyzeResult data, TvgStream stream, SvgNode node)
   at SvgConverter.ConvertToTvgText(SvgDocument document)
   at Application.Main(String[] args)

Proposed solution: add "e" and "E" to the AcceptChar() check in svg2tvgt.cs, as float.Parse() seems to handle the exponent notation already.

Version: In lieu of a semantic version (why no version numbers?), the Windows executable's SHA1 is f2068828d9ccead7bfdeb0cd950ec23a07e78ec8, downloaded from your site 4/30/2024.

Support for embedded system

Would it be possible to add a partial rendering function to TinyVG?
Typically, on embedded system, we don't have enough memory to store complete picture buffer in memory. So most system simply call the drawing loop multiple time, each time with a different drawing window.

Applied to a vector format, it means adding a "top/bottom/left/right" clipping to the rendering function so the rendering only happen within the same buffer, but a different output area of the image. That buffer is then transferred to the screen, and the rendering is called again with the next window.

Add gpu rendering helper

Currently, only a software renderer is provided. This should be changed in a way that the SDK supports exporting GPU usable data (export set of triangles).

This feature should provide:

  • Exporting a set of triangle data
  • Export a set of material definitions/draw calls
  • Allow configurable precision for triangulation of round shapes
  • Agnostic to rendering api (support Vulkan, OpenGL, DirectX, โ€ฆ)

Covnerter: Handle "currentColor"

Observed this being used in some SVGs saved in Inkscape, might not be something that's actually coming from there specifically but possibly some other conversion (e.g. FontForge). Currently, it's unhandled, which sets the image to use magenta, which can hide some other things like alpha issues when checking against images.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.