Public Member Functions | Protected Member Functions | Protected Attributes

pav::lib::visualizer::VisualizerAbstract Class Reference

List of all members.

Public Member Functions

 VisualizerAbstract ()
void setArea (float x1, float y1, float x2, float y2, boolean relative)
void setColor (int color)
void setColor (int a, int b, int mode)
void setColor (float[] thresholds, int[] colors, int mode)
void drawTo (PApplet applet) throws PAVException

Protected Member Functions

float[] getArea ()

Protected Attributes

transient PApplet p
final ColorMapper cm

Detailed Description

A audio visualizer.

Author:
christopher

Constructor & Destructor Documentation

pav::lib::visualizer::VisualizerAbstract::VisualizerAbstract (  )  [inline]

Ctor.


Member Function Documentation

void pav::lib::visualizer::VisualizerAbstract::drawTo ( PApplet  applet  )  throws PAVException [inline]

Sets the PApplet to draw to. Must be called before process().

Parameters:
applet Where to draw to. Must not be null
Exceptions:
PAVException If the visualizer does not work with this applet

Implements pav::lib::visualizer::Visualizer.

Reimplemented in pav::lib::visualizer::Boxes, and pav::lib::visualizer::Bubbles.

float [] pav::lib::visualizer::VisualizerAbstract::getArea (  )  [inline, protected]

Returns the area this visualizer may use. The area is specified by and array containing 4 values:

[0] - Low x-coordinate [1] - Low y-coordinate [2] - High x-coordinate [3] - High y-coordinate

If the area is specified relative (see setArea()) but no PApplet object is available, all values will be 0.

Returns:
The erea
void pav::lib::visualizer::VisualizerAbstract::setArea ( float  x1,
float  y1,
float  x2,
float  y2,
boolean  relative 
) [inline]

Sets the area that can be used by this visualizer. If relative is set to false the visualizer will use the given values as its boundary, independent of the size of the PApplet. If relative is true, the values must be in the range [0,1] and represent an area relative to the size of the PApplet. Processings coordinate system is used, so (0,0) is the top left pixel.

Parameters:
x1 Must be >= 0 and <= 1 if relative is true
y1 Must be >= 0 and <= 1 if relative is true
x2 Must be > x1 and <= 1 if relative is true
y2 Must be > y1 and <= 1 if relative is true
relative Whether or not the values are relative

Implements pav::lib::visualizer::Visualizer.

void pav::lib::visualizer::VisualizerAbstract::setColor ( float[]  thresholds,
int[]  colors,
int  mode 
) [inline]

Sets the colors to interpolate between when drawing this visualizer. How a visualizer uses the colors specified is not defined. They might not be used at all.

Parameters:
thresholds The relative thresholds to use. Values must be between 0 and 1 and sorted. The first element must be 0, the last 1. Must be of same length as colors
colors The The colors to use. Must be of same length as thresholds
mode The color mode to use. Must be either PApplet.RGB or PApplet.HSB

Implements pav::lib::visualizer::Visualizer.

Reimplemented in pav::lib::visualizer::Boxes.

void pav::lib::visualizer::VisualizerAbstract::setColor ( int  a,
int  b,
int  mode 
) [inline]

Sets two colors to interpolate between when drawing this visualizer. How a visualizer uses the colors specified is not defined. They might not be used at all.

Parameters:
a The color to start from
b The color to interpolate to
mode The color mode to use. Must bei either PApplet.RGB or PApplet.HSB

Implements pav::lib::visualizer::Visualizer.

Reimplemented in pav::lib::visualizer::Boxes.

void pav::lib::visualizer::VisualizerAbstract::setColor ( int  color  )  [inline]

Sets the color to use when drawing this visualizer. How a visualizer uses the color specified is not defined. It might not be used at all.

Parameters:
color The color to use

Implements pav::lib::visualizer::Visualizer.

Reimplemented in pav::lib::visualizer::Boxes.


Member Data Documentation

The (primary) color mapper of this visualizer.

transient PApplet pav::lib::visualizer::VisualizerAbstract::p [protected]

The PApplet to draw to.


The documentation for this class was generated from the following file:
 All Classes Functions Variables