I’m excited to share that I’ve been accepted as a GSoC contributor this year! I will be working on developing a graphics library in Fortran under the mentorship of @FedericoPerini and @everythingfunctional.
I will use this thread to keep you informed about my weekly progress.
Revised Plan
After some discussions with my mentors, we’ve made a few adjustments to my initial proposal. Here’s the updated plan:
Postpone support for OpenGL for now.
First Half of GSoC Period:
Focus solely on developing the core graphics library.
Ensure support for vector graphics, primarily SVG.
Second Half of GSoC Period:
Start developing a plotting framework utilizing FIG.
Current Progress
Library Primitives: I have already laid the groundwork for most of the primitives.
Refactoring: Currently, I am refactoring the library to support multiple backends more effectively.
Upcoming Tasks:
Implement drawing text and supporting TrueType fonts.
Add support for other raster file formats like PNG.
I hope you find this project interesting. If you have any notes or feedback, please let me know.
This week, I plan to move all the primitives to the new design, including:
Lines
Ellipses
Triangles
Polygons
Polylines
All of these should support attributes such as stroke size, stroke color, fill color, and similar properties. Additionally, I plan to properly handle the alpha channel.
Also, we’re meeting weekly on Thursdays at 10 am US Central Time. If anyone else would like to join the meetings just let me know and I’ll get you an invite.
Implemented primitives for lines, triangles, and ellipses.
The alpha channel is now functioning correctly for the bitmap canvas.
I struggled a bit with implementing thick lines, so I will postpone handling stroke size and polygons for now. Here are some images generated by the library:
I have finished the CI pipeline and improved the testing system.
I have also done some work to allow thick lines, but I realized that due to poor planning (mainly the addition of vectors graphics), I can’t continue with the current design. I will need to change how primitives are currently being drawn, so that will be next week’s plan.
I have mostly spent the week researching and studying how vector graphics are internally rendered, and I was really surprised by the lack of actual resources and books on the subject. So, pretty much my only option was to understand how some libraries like Cairo work internally.
After that, I believe implementing it fully from scratch would be really complicated and time-consuming for now. So, my plan for now is to make bindings for a library to serve as the base of the bitmap backend.
I still want to do it from scratch eventually, but I’m going to leave this for a future project.
I’ve already decided to use plutovg as a base since Cairo seems like overkill, considering it already supports a lot of drivers for other output devices.
Thank you for sharing; it’s going to be really useful.
For those interested, @ezz is making very good progress, essentially completed switching from a full-Fortran implementation to using Cairo as a backend.
Currently he’s hitting a compiler bug with finalization of the polymorphic entities, so we’ll be trying to understand wheteher it’s best to change something in the object-oriented pattern until the issue goes away, or just use an older version of the compiler for now.
I have made small changes to the library. Mostly, this week I focused on researching the plan for the plotting library.
For next week, I won’t be available since I will be participating in a competitive programming competition (the regional level of ACM ICPC). I will continue working on it the following week.