Classes | Public Member Functions

pav::lib::StreamingBuffer Class Reference

List of all members.

Classes

class  StreamingBufferGLGraphics
class  StreamingBufferImpl
class  StreamingBufferPImage

Public Member Functions

 StreamingBuffer (PApplet p, int width, int height)
int getWidth ()
int getHeight ()
void add (int[] data) throws PAVException
void add (int[] data, boolean startOnTop) throws PAVException
void draw (int xStart, int yStart, int width, int height)
void dispose ()

Detailed Description

A streaming image buffer, useful in some visualizations such as spectogram.

This Uses GLGraphics if available. The Processing version supports alpha channel transparency but is rather slow. The GLGraphics version is optimized for speed. It does not support transparency. Also, the GLGraphics implementation currently ignores the width argument of the draw method for implementation reasons. This does however not affect the result if the buffer is drawn to occupy the full area of the host PApplet.

Author:
christopher

Constructor & Destructor Documentation

pav::lib::StreamingBuffer::StreamingBuffer ( PApplet  p,
int  width,
int  height 
) [inline]

Ctor.

Parameters:
p The PApplet this buffer should draw itself to. Must not be null
width The width of the buffer. Must be positive
height The height of the buffer. Must be positive

Member Function Documentation

void pav::lib::StreamingBuffer::add ( int[]  data  )  throws PAVException [inline]

Adds a new data sample to the buffer. This is equal to add(data, true).

Parameters:
data The data sample to add. The array length must be equal to the buffer height
Exceptions:
PAVException If the array length is not equal to the buffer height
void pav::lib::StreamingBuffer::add ( int[]  data,
boolean  startOnTop 
) throws PAVException [inline]

Adds a new data sample to the buffer.

Parameters:
data The data sample to add. The array length must be equal to the buffer height
startOnTop Whether to fill the buffer column from top to bottom or vice versa
Exceptions:
PAVException If the array length is not equal to the buffer height
void pav::lib::StreamingBuffer::dispose (  )  [inline]

Disposes this buffer.

Subsequent calls to other methods of this class might throw an exception.

void pav::lib::StreamingBuffer::draw ( int  xStart,
int  yStart,
int  width,
int  height 
) [inline]

Draws this buffer to a given area of the host PApplet.

Parameters:
xStart The first x-coordinate of the display area
yStart The first y-coordinate of the display area
width The width of the display area. Must be > 0. Ignored under GLGraphics
height The height of the display area. Must be > 0
int pav::lib::StreamingBuffer::getHeight (  )  [inline]

Gets the buffer height

Returns:
Buffer height
int pav::lib::StreamingBuffer::getWidth (  )  [inline]

Gets the buffer width

Returns:
Buffer width

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