fiveagon.io - Mass Loading, Easy Saving
in
Library and Tool Development
•
2 years ago
Hey guys, just finished up two interfaces for loading files and saving visual output. The google code page above contains:
Download,
JavaDoc,
Source, and Examples.
I don't know about you guys, but I hate worrying about how my data files' names are formatted. I don't care. I just want to load them. Usually images into a PImage and SVGs into a PShape or a Geomerative RShape
Loader<E> - Mass Loading:
- // Load all images
- Loader<PImage> imageLoader = new PImageLoader(this);
- List<PImage> imageList = imageLoader.load();
- // Load all SVGs that contain a search
- Loader<RShape> shapeLoader = new RShapeLoader(this);
- List<RShape> turtleList = shapeLoader.load("turtle");
I also wanted a bare minimum template for getting started with a sketch that would be ready to save images and PDFs.
Saver - Easy Saving
- import processing.pdf.*;
- import fiveagon.io.*;
- Saver saver = new Saver2D(this, "new_name_here");
- void setup()
- {
- }
- void draw()
- {
- saver.beginRecord();
- saver.endRecord();
- }
- void keyTyped() {
- switch(key) {
- case 'o':
- saver.save();
- break;
- case 'p':
- saver.save();
- saver.saveRecord();
- break;
- }
- }
Let me know what you guys think!