G4P (GUI for Processing)  4.3.8
A set of GUI controls for your Processing sketch.
 All Classes Functions Variables Pages
g4p_controls.ImageManager Class Reference

Static Public Member Functions

static PImage loadImage (PApplet app, String filename)
 
static PImage[] loadImage (PApplet app, String[] filename)
 
static PImage[] makeTiles1D (PApplet app, PImage img, int nCols, int nRows)
 
static PImage[][] makeTiles2D (PApplet app, PImage img, int nCols, int nRows)
 

Detailed Description

This class is used to load bitmap files and create images.

Although there maybe multiple requests for a particular bitmap file only one PImage is created for each file.

Author
Peter Lager

Member Function Documentation

static PImage g4p_controls.ImageManager.loadImage ( PApplet  app,
String  filename 
)
static

Load a single bitmap file return a reference to the PImage created.

Parameters
appthe main sketch applet
filenamethe file holding the image
Returns
null if the file does not exist else the PImage object
static PImage [] g4p_controls.ImageManager.loadImage ( PApplet  app,
String[]  filename 
)
static

Load images from multiple files

Parameters
appthe main sketch applet
filenamean array of filenames
Returns
an array of images
static PImage [] g4p_controls.ImageManager.makeTiles1D ( PApplet  app,
PImage  img,
int  nCols,
int  nRows 
)
static

Make multiple images from a given image. This method creates a 1D array of PImage objects. The order is left-right and top-down.

Parameters
appthe main sketch applet
imgthe tiled image
nColsnumber of tiles across
nRowsnumber of tiles down
Returns
a 1D array of images (tiles)
static PImage [][] g4p_controls.ImageManager.makeTiles2D ( PApplet  app,
PImage  img,
int  nCols,
int  nRows 
)
static

Make multiple images from a given image. This method creates a 2D array (size [nCols, nRows] ) of PImage objects.

Parameters
appthe main sketch applet
imgthe tiled image
nColsnumber of tiles across
nRowsnumber of tiles down
Returns
a 2D array of images (tiles)