alexandruica / verg Goto Github PK
View Code? Open in Web Editor NEWLightweight vector graphics library
License: MIT License
Lightweight vector graphics library
License: MIT License
An enum that would probably contain options for:
RGBA
RGB
CMYK
Gamma(value)
Currently a Shape
is a Vec<Primitive>
, and it's not ideal. We should make an API that kind of looks like turtle
:
Shape {
start: (0, 0),
data: vec![
LineTo{ 120, 350 },
QuadraticTo { ... },
],
}
Path drawing operations and gradients should take an additional matrix that describes affine transformations (like rotation, scaling and translation).
It would be a good idea to refactor some stuff, mainly:
color.rs
(for a start, the ones used in the integration tests should be enough)geometry.rs
. Since I've changed the drawing algorithm for rendering lines, a lot of stuff in geometry.rs
is left there unused, all of that should be removedcanvas.rs
there are a lot of functions that are unused: remove them. Also, draw_shape
is a bit of a mess, it would probably a good idea to separate the code for rendering lines and the code for fillingWhat we should do instead is just store the maximum number of channels (4) and let the user decide what he wants. That means offering conversions.
Start by describing the line rendering algorithm, and how the library functions as a whole.
Implement the algorithm behind AGG. At first it doesn't have to be fancy, just render lines. For correct rendering, I should probably consider color spaces and alpha compositing right from the start
Blocked by:
This could be added as a simple post-processing effect callback that takes pixels as input. That would allow a custom processing effect really easily. All calculations of colors (for example: gradients) will be done in linear space, only when saving the image will this callback be applied.
Currently the tests are only run, they are not "checked" for validity automatically. I'd want to run SHA-1 (or something like it) on the resulting image of every test and save it. After that, every test would check its hash against the saved one, checking if it's the same. This way I can track changes in the library that affect rendering.
Practice writing them in Haskell to have a clearer view. Haskell implementations should be clear enough to borrow from for the Rust version.
Currently the third term in the Cubic Bezier curve expansion is not computed correctly (should be t * t
not t * 2.0
.
At first just focus on getting the title page right, setting up language-specific stuff, setting up code showing for rust, setting up the bibliography etc.
Currently the alpha blending method is hardcoded to 1 - src.alpha
, it would be great if the library would provide a few blending functions (like the Porter-Duff ones), and allow for a custom blending function as well.
See if it's even possible considering the line drawing API that we have.
We should test more thoroughly. We should probably add tests with more complex polygons:
It should be pretty easy to port what I've done here, since the algorithm powering it is identical to the one used in verg
. I could also borrow the glyph renderer and write some tests that use glyphs.
Pay a bit less attention to details like integer overflow and not allocating at all. It's not that they aren't useful, but it would take a lot more time than I would want to if I want to take everything into consideration.
main
branch which will be the branch where all changes will be progressively merged intoCurrently, in intersect_line_with_grid()
we create new Vec
s on_horizontals
and on_verticals
each time we call the function. That's not needed, we could just reuse a Vec
in canvas
that grows as it's needed (or, of course, we could give it a big capacity from the beginning and we could avoid reallocating at all!).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.