Loading...
Logo
Processing Forum
fiveagon's Profile
1 Posts
78 Responses
0 Followers

Activity Trend

Last 30 days

Loading Chart...

Show:
Private Message
     
    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:
    1. // Load all images
    2. Loader<PImage> imageLoader = new PImageLoader(this);
    3. List<PImage> imageList = imageLoader.load();

    4. // Load all SVGs that contain a search
    5. Loader<RShape> shapeLoader = new RShapeLoader(this);
    6. 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
     
    1. import processing.pdf.*;
    2. import fiveagon.io.*;
    3. Saver saver = new Saver2D(this, "new_name_here");
    4. void setup()
    5. {
    6. }
    7. void draw()
    8. {
    9.     saver.beginRecord();
    10.     saver.endRecord();
    11. }
    12. void keyTyped() {
    13.     switch(key) {
    14.     case 'o':
    15.         saver.save();
    16.         break;
    17.     case 'p':
    18.         saver.save();
    19.         saver.saveRecord();
    20.         break;
    21.     }
    22. }
    Let me know what you guys think!