Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TinyVG Support #71

Open
jserv opened this issue Nov 7, 2024 · 7 comments
Open

Add TinyVG Support #71

jserv opened this issue Nov 7, 2024 · 7 comments
Assignees

Comments

@jserv
Copy link
Contributor

jserv commented Nov 7, 2024

With the introduction of the GIF image decoder and animation support (#40) contributed by @ndsl7109256, it is now time to move forward with implementing TinyVG -- a compact vector graphics format designed as a lightweight alternative to SVG. The TinyVG specification is only 14 pages long, in stark contrast to the SVG 1.1 spec, which spans 260 pages (not including dependencies like CSS, XML, and ECMAScript). TinyVG achieves simplicity without sacrificing core vector graphics capabilities, making it ideal for embedded systems with limited resources.

Integrating TinyVG support into Mado could offer efficient vector graphics rendering with lower memory and computational overhead than SVG. Here are key areas to address:

  1. File Parsing: Implement a TinyVG file parser to read the binary format efficiently, ensuring the parsing adheres to TinyVG’s specification.
  2. Rendering Engine: Adapt Mado’s rendering pipeline to handle TinyVG graphics primitives (paths, lines, polygons, etc.) and basic fills.
  3. Performance Considerations: Ensure smooth performance on resource-constrained devices.
  4. Testing: Prepare sample TinyVG files and conduct visual tests to verify rendering accuracy and performance benefits.

The article An Introduction to TinyVG in C uses PlutoVG to render TinyVG, and since the vector graphics operations in PlutoVG closely align with those in Mado, it should be feasible to port the sample C-based TinyVG decoder to Mado as a new image loader.

Supporting TinyVG in Mado aligns well with the project’s goals by delivering essential vector graphics with minimal overhead.

Reference:

@ndsl7109256

This comment was marked as duplicate.

@jserv

This comment was marked as duplicate.

@jserv
Copy link
Contributor Author

jserv commented Nov 9, 2024

Action items:

  1. Implement standalone TinyVG viewer which can render the existing TVG images.
  2. Once the standalone TinyVG viewer is ready for use, refine the image loader APIs by checking gdk-pixbuf-loader.

@ndsl7109256
Copy link
Collaborator

It seems that TinyVG provides an SDK that includes the ability to convert a TinyVG file into a bitmap giving a specified size. In that case, do we still need to implement rendering ourselves using Mado’s rendering pipeline? If so, perhaps we could start by implementing functions to render polygons and fill them with gradient colors?

@jserv
Copy link
Contributor Author

jserv commented Nov 9, 2024

It seems that TinyVG provides an SDK that includes the ability to convert a TinyVG file into a bitmap giving a specified size. In that case, do we still need to implement rendering ourselves using Mado’s rendering pipeline? If so, perhaps we could start by implementing functions to render polygons and fill them with gradient colors?

TinyVG SDK focuses on conversion at the moment, but we do need the proper renderer for TinyVG, making use of the vector graphics operation.

@jserv
Copy link
Contributor Author

jserv commented Nov 25, 2024

GFX implements TinyVG renderer: src/gfx_tvg.cpp

@jserv
Copy link
Contributor Author

jserv commented Nov 25, 2024

ctx implements TinyVG renderer: src/tinyvg.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants