-
Notifications
You must be signed in to change notification settings - Fork 5
From RubyPlot GR to Rubyplot
The following Ideas can be implemented after November 2018 after Pranav Garg (@pgtgrly) finishes the second phase of the project as per the above diagram.
The scripting layer needs to be rewritten to make the API more Rubylike as suggested by Dr. John Woods (@mowhawkjohn). This will require reworking the API while making sure that it correctly interfaces with the artist layer and retains the functionality of the existing API.
Thought: We can perhaps have multiple Scripting APIs, one for Rubyists and other for those just using Ruby as a tool for visualization?
Matplotlib uses (AGG)[http://antigrain.com/], A raster-based graphics library as the backend renderer. The library is written in C++ and is unfortunately largely undocumented and contains a few bugs because of the sad demise of its brilliant creator. The project would require the following:
- Understanding AGG (and possibly documenting it)
- Creating a ruby wrapper around AGG (Matplotlib's python wrapper can be referred here)
- Creating a backend renderer sublayer for AGG based on the existing Rmagick (Ruby wrapper around ImageMagick) Sublayer
ImageMagick and AGG are Raster based Graphics Library. Cairo is a Vector-based Graphics Library. The difference between Raster and Vector graphics can be read about here. Creating a Backend Renderer from a vector based Graphics Library can be used as an example for more vector Graphics library renderers in future. Cairo already has a Ruby Wrapper. The project would require the following:
- Understanding the Working of Cairo and its Ruby Wrapper.
- Modelling and creating a generalized backend renderer sublayer for vector Graphics Libray
- Implementing it in Cairo
Since the Library creates images. It is tested by testing the RMS loss between the produced image and a reference image for every test. This has been brilliantly implemented in Ruby arrays by @ArafatK here.
However, computation over Ruby Array is painfully slow and does not allow development utilities such as autotest to be utilized fully. One idea is to load images into Nmatrix Arrays or XND Arrays and performing computation on the very same. This can later be used to create an image processing library for Ruby.