VizKit
3.3.7
|
The graphics related static functions for the Visual Actors. More...
#include <VisualActorGraphics.h>
Static Public Member Functions | |
static uint8 | getError (char *errorString) |
Returns an error string (if there was an error). | |
static void | setBackgroundColor (const RGBAColor &aColorVal) |
Sets the value of the background color. | |
static RGBAColor | getBackgroundColor (void) |
Returns the value of the background color. | |
static uint32 * | createARGBCheckPixels (uint32 width, uint32 height) |
Creates an image buffer with 8-bit per channel ARGB pixel data. | |
static uint32 * | createBGRACheckPixels (uint32 width, uint32 height) |
Creates an image buffer with 8-bit per channel BGRA pixel data. | |
static uint32 * | createRGBACheckPixels (uint32 width, uint32 height) |
Creates an image buffer with 8-bit per channel RGBA pixel data. | |
static uint32 * | createABGRCheckPixels (uint32 width, uint32 height) |
Creates an image buffer with 8-bit per channel ABGR pixel data. | |
static uint32 | getNextFreeTextureName (void) |
Returns a free texture name/index/number/id. | |
static void | deleteTextures (const uint16 numberOfTextures, const uint32 *const textureNames) |
Frees memory bound by OpenGL textures. | |
static void | resetModelViewMatrix (void) |
Resets the model view matrix. | |
static void | enableAlphaBlending (void) |
Enables alpha blending. | |
static void | disableBlending (void) |
Disables blending. | |
static bool | getCoordsOfPixelPosition (double xPixelPos, double yPixelPos, double zAxisPos, double *xCoordPos, double *yCoordPos, double *zCoordPos) |
Maps window coordinates to object coordinates. | |
static bool | getPixelsOfCoordPosition (double xCoordPos, double yCoordPos, double zCoordPos, double *xPixelPos, double *yPixelPos, double *zAxisPos) |
Maps object coordinates to window coordinates. | |
static size_t | getCanvasPixelWidth (void) |
Returns the width of the canvas in pixels. | |
static size_t | getCanvasPixelHeight (void) |
Returns the height of the canvas in pixels. | |
static RelationalRect | getViewportOrientationAndAspectRatio (void) |
Returns the current orientation and aspect ratio of the viewport. | |
static uint16 | xCoordToPixel (double coordPos, const VisualCamera &aCamera) |
Converts a horizontal coordinate to a horizontal pixel position. | |
static uint16 | yCoordToPixel (double coordPos, const VisualCamera &aCamera) |
Converts a vertical coordinate to a horizontal pixel position. | |
static double | xPixelToCoord (const uint16 pixelPos, const VisualCamera &aCamera) |
Converts a horizontal pixel position to a horizontal coordinate. | |
static double | yPixelToCoord (const uint16 pixelPos, const VisualCamera &aCamera) |
Converts a vertical pixel position to a vertical coordinate. | |
static Coord | getCirclePoint (uint32 sliceIdx, uint32 slicesCount, double radius=1.0, Coord circleCenter=zeroCoord) |
Returns a point on the outline of a circle. | |
static void | spotGL (double zPlane=0.0) |
Draws a spot (for testing purpose). | |
static void | drawSpot (const double xNum, const double yNum, const double r, const double g, const double b, uint16 waveformIntensityVal, double intensity, const uint8 tailSize) |
Draws a single spot. | |
static void | drawProjectionMetrics (const VisualCamera &aCamera) |
Draws some metrics in the current scene. | |
static void | loadModelViewIdentityMatrix (void) |
Loads the identity matrix of the model view. | |
static void | prepareProcessMonitorShow (RGBAColor &theColor) |
Prepares the show of the Process Monitor. | |
static void | showProcessInfoRow (Coord coord, const char *const textRowStr) |
Shows a row of Process Monitor Info. | |
static void | showProcessInfoNote (void) |
Shows a note about Process Monitor. | |
static void | drawVertexChain (const VertexChain &vertexChain, int drawMode=kGL_LINE_LOOP, BlendMode aBlendMode=kReplace) |
Draws a vertex chain. | |
static void | drawWaveform (const sint16 historyNum, const uint16 maxNumberOfHistories, const uint32 numberOfWaveformEntries, const sint16 **const waveformDataMonoArray, const VisualCamera &aCamera) |
Draws the waveform data. | |
static void | drawSpectrumAnalyzer (const sint16 currHistoryNum, const uint16 numberOfHistories, const uint32 numberOfSpectrumEntries, const uint16 numberOfAudioChannels, const uint8 ***const spectrumDataArray, const VisualCamera &aCamera) |
Draws a graphical representation of the spectral data with subband bar graphs. | |
static void | drawSpectrogram (const sint16 currHistoryNum, const uint16 numberOfHistories, const uint32 numberOfSpectrumEntries, const uint16 numberOfAudioChannels, const uint8 ***const spectrumDataArray, const VisualCamera &aCamera) |
Draws a graphical representation of the spectral data as spectrogram. | |
static void | drawBeatHistogram (const uint32 *const beatHistogram, const VisualCamera &aCamera) |
Draws a histogram of the beat values. | |
static void | drawTrackProgressMeter (ConstVertexChainRef const progressMeterBackgroundVertices, ConstVertexChainRef const progressMeterVertices, ConstVertexChainRef const progressMeterOutlineVertices) |
Draws a progress bar that advances with the progress of the currently playing audio track. | |
static void | doFallbackActorShow (const char *const visualActorName) |
The default implementation of the show() method of the VisualActor interface class. | |
static void | translateMatrix (double xNum, double yNum, double zNum) |
Call of glTranslate(). | |
static void | rotateMatrix (double angle, double xAmount, double yAmount, double zAmount) |
Call of glRotate(). | |
static void | scaleMatrix (double xFactor, double yFactor, double zFactor) |
Call of glScale(). | |
static void | enableDepthTest (void) |
Enables GL_DEPTH_TEST. | |
static void | disableDepthTest (void) |
Disables GL_DEPTH_TEST. | |
static void | enableCullFace (void) |
Enables GL_CULL_FACE. | |
static void | disableCullFace (void) |
Disables GL_CULL_FACE. | |
static void | cullFaceFront (void) |
Specifies that front-facing facets can be culled. | |
static void | cullFaceBack (void) |
Specifies that back-facing facets can be culled. | |
Private Member Functions | |
VisualActorGraphics () | |
The constructor. | |
~VisualActorGraphics () | |
The destructor. |
The graphics related static functions for the Visual Actors.
By gathering the graphics related calls of the Visual Actors, it is easier to track and isolate possible problems. All functions of VisualActorGraphics are static. Most of the time, functions of VisualActorGraphics are executed by VisualGraphics. The static functions of VisualActorGraphics are expected to change more often than the methods of the VisualGraphics class. The static functions of VisualActorGraphics are aggregates of graphical operations.
VisualActorGraphics::VisualActorGraphics | ( | ) | [private] |
The constructor.
VisualActorGraphics::~VisualActorGraphics | ( | ) | [private] |
The destructor.
static uint32* VizKit::VisualActorGraphics::createABGRCheckPixels | ( | uint32 | width, |
uint32 | height | ||
) | [static] |
Creates an image buffer with 8-bit per channel ABGR pixel data.
width | The width of the bitmap data. |
height | The height of the bitmap data. |
static uint32* VizKit::VisualActorGraphics::createARGBCheckPixels | ( | uint32 | width, |
uint32 | height | ||
) | [static] |
Creates an image buffer with 8-bit per channel ARGB pixel data.
width | The width of the bitmap data. |
height | The height of the bitmap data. |
static uint32* VizKit::VisualActorGraphics::createBGRACheckPixels | ( | uint32 | width, |
uint32 | height | ||
) | [static] |
Creates an image buffer with 8-bit per channel BGRA pixel data.
width | The width of the bitmap data. |
height | The height of the bitmap data. |
static uint32* VizKit::VisualActorGraphics::createRGBACheckPixels | ( | uint32 | width, |
uint32 | height | ||
) | [static] |
Creates an image buffer with 8-bit per channel RGBA pixel data.
width | The width of the bitmap data. |
height | The height of the bitmap data. |
void VisualActorGraphics::cullFaceBack | ( | void | ) | [static] |
Specifies that back-facing facets can be culled.
void VisualActorGraphics::cullFaceFront | ( | void | ) | [static] |
Specifies that front-facing facets can be culled.
void VisualActorGraphics::deleteTextures | ( | const uint16 | numberOfTextures, |
const uint32 *const | textureNames | ||
) | [static] |
Frees memory bound by OpenGL textures.
numberOfTextures | The number of textures to free. |
textureNames | Pointer to texture names (texture numbers) to free. |
void VisualActorGraphics::disableBlending | ( | void | ) | [static] |
Disables blending.
void VisualActorGraphics::disableCullFace | ( | void | ) | [static] |
Disables GL_CULL_FACE.
void VisualActorGraphics::disableDepthTest | ( | void | ) | [static] |
Disables GL_DEPTH_TEST.
void VisualActorGraphics::doFallbackActorShow | ( | const char *const | visualActorName | ) | [static] |
The default implementation of the show() method of the VisualActor interface class.
visualActorName | The name of the VisualActor. |
void VisualActorGraphics::drawBeatHistogram | ( | const uint32 *const | beatHistogram, |
const VisualCamera & | aCamera | ||
) | [static] |
Draws a histogram of the beat values.
beatHistogram | The beat histogram. |
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |
void VisualActorGraphics::drawProjectionMetrics | ( | const VisualCamera & | aCamera | ) | [static] |
Draws some metrics in the current scene.
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |
void VisualActorGraphics::drawSpectrogram | ( | const sint16 | currHistoryNum, |
const uint16 | numberOfHistories, | ||
const uint32 | numberOfSpectrumEntries, | ||
const uint16 | numberOfAudioChannels, | ||
const uint8 ***const | spectrumDataArray, | ||
const VisualCamera & | aCamera | ||
) | [static] |
Draws a graphical representation of the spectral data as spectrogram.
currHistoryNum | The index of the history the spectrum data is taken from. |
numberOfHistories | The maximum number of histories. |
numberOfSpectrumEntries | The number of spectrum data values. |
numberOfAudioChannels | The number of audio channels. |
spectrumDataArray | Pointer to spectrum data of all histories. |
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |
void VisualActorGraphics::drawSpectrumAnalyzer | ( | const sint16 | currHistoryNum, |
const uint16 | numberOfHistories, | ||
const uint32 | numberOfSpectrumEntries, | ||
const uint16 | numberOfAudioChannels, | ||
const uint8 ***const | spectrumDataArray, | ||
const VisualCamera & | aCamera | ||
) | [static] |
Draws a graphical representation of the spectral data with subband bar graphs.
currHistoryNum | The index of the history the spectrum data is taken from. |
numberOfHistories | The maximum number of histories. |
numberOfSpectrumEntries | The number of spectrum data values. |
numberOfAudioChannels | The number of audio channels. |
spectrumDataArray | Pointer to spectrum data of all histories. |
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |
void VisualActorGraphics::drawSpot | ( | const double | xNum, |
const double | yNum, | ||
const double | r, | ||
const double | g, | ||
const double | b, | ||
uint16 | waveformIntensityVal, | ||
double | intensity, | ||
const uint8 | tailSize | ||
) | [static] |
Draws a single spot.
xNum | The horizontal position of the spot. |
yNum | The vertical position of the spot. |
r | The red component of the RGB-Color. |
g | The green component of the RGB-Color. |
b | The blue component of the RGB-Color. |
waveformIntensityVal | The current radius of the spot. |
intensity | The current intensity of the spot. |
tailSize | The current tailSize of the spot. |
void VisualActorGraphics::drawTrackProgressMeter | ( | ConstVertexChainRef const | progressMeterBackgroundVertices, |
ConstVertexChainRef const | progressMeterVertices, | ||
ConstVertexChainRef const | progressMeterOutlineVertices | ||
) | [static] |
Draws a progress bar that advances with the progress of the currently playing audio track.
progressMeterBackgroundVertices | The vertices of the background of the progress meter. |
progressMeterVertices | The vertices of the actual progress meter. |
progressMeterOutlineVertices | The vertices of the outline of the progress meter. |
void VisualActorGraphics::drawVertexChain | ( | const VertexChain & | vertexChain, |
int | drawMode = kGL_LINE_LOOP , |
||
BlendMode | aBlendMode = kReplace |
||
) | [static] |
Draws a vertex chain.
Useful for debugging, monitoring or diagnistic purposes.
vertexChain | A vector of vertices. |
drawMode | The requested draw mode (kGL_POINTS, kGL_LINES, kGL_LINE_STRIP, kGL_LINE_LOOP, kGL_TRIANGLES, kGL_TRIANGLE_STRIP, kGL_TRIANGLE_FAN, kGL_QUADS, kGL_QUAD_STRIP, kGL_POLYGON). |
aBlendMode | How to blend vertex chain drawing with the framebuffer data. Default kReplace. |
void VisualActorGraphics::drawWaveform | ( | const sint16 | historyNum, |
const uint16 | maxNumberOfHistories, | ||
const uint32 | numberOfWaveformEntries, | ||
const sint16 **const | waveformDataMonoArray, | ||
const VisualCamera & | aCamera | ||
) | [static] |
Draws the waveform data.
historyNum | The index of the history the waveform data is taken from. |
maxNumberOfHistories | Maximum number of histories stored in waveformDataMonoArray. |
numberOfWaveformEntries | The number of waveform values. |
waveformDataMonoArray | Pointer to waveform data of all histories. The array has two dimensions: history and index. |
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |
void VisualActorGraphics::enableAlphaBlending | ( | void | ) | [static] |
Enables alpha blending.
void VisualActorGraphics::enableCullFace | ( | void | ) | [static] |
Enables GL_CULL_FACE.
void VisualActorGraphics::enableDepthTest | ( | void | ) | [static] |
Enables GL_DEPTH_TEST.
RGBAColor VisualActorGraphics::getBackgroundColor | ( | void | ) | [static] |
Returns the value of the background color.
size_t VisualActorGraphics::getCanvasPixelHeight | ( | void | ) | [static] |
Returns the height of the canvas in pixels.
size_t VisualActorGraphics::getCanvasPixelWidth | ( | void | ) | [static] |
Returns the width of the canvas in pixels.
Coord VisualActorGraphics::getCirclePoint | ( | uint32 | sliceIdx, |
uint32 | slicesCount, | ||
double | radius = 1.0 , |
||
Coord | circleCenter = zeroCoord |
||
) | [static] |
Returns a point on the outline of a circle.
sliceIdx | The index of the requested slice. |
slicesCount | The number of slices. |
radius | The length of the radius. Default = 1.0. |
circleCenter | The center of the circle. Default is x = 0.0 and y = 0.0. |
bool VisualActorGraphics::getCoordsOfPixelPosition | ( | double | xPixelPos, |
double | yPixelPos, | ||
double | zAxisPos, | ||
double * | xCoordPos, | ||
double * | yCoordPos, | ||
double * | zCoordPos | ||
) | [static] |
Maps window coordinates to object coordinates.
xPixelPos | The horizontal pixel position. |
yPixelPos | The vertical pixel position. |
zAxisPos | The position on the z-axis. |
xCoordPos | Returns: The x-CoordPosition. |
yCoordPos | Returns: The y-CoordPosition. |
zCoordPos | Returns: The z-CoordPosition. |
uint8 VisualActorGraphics::getError | ( | char * | errorString | ) | [static] |
Returns an error string (if there was an error).
[out] | errorString | Pointer to character buffer to receive the error string. |
uint32 VisualActorGraphics::getNextFreeTextureName | ( | void | ) | [static] |
Returns a free texture name/index/number/id.
bool VisualActorGraphics::getPixelsOfCoordPosition | ( | double | xCoordPos, |
double | yCoordPos, | ||
double | zCoordPos, | ||
double * | xPixelPos, | ||
double * | yPixelPos, | ||
double * | zAxisPos | ||
) | [static] |
Maps object coordinates to window coordinates.
xCoordPos | The x-CoordPosition. |
yCoordPos | The y-CoordPosition. |
zCoordPos | The z-CoordPosition. |
xPixelPos | Returns: The horizontal pixel position. |
yPixelPos | Returns: The vertical pixel position. |
zAxisPos | Returns: The position on the z-axis. |
RelationalRect VisualActorGraphics::getViewportOrientationAndAspectRatio | ( | void | ) | [static] |
Returns the current orientation and aspect ratio of the viewport.
void VisualActorGraphics::loadModelViewIdentityMatrix | ( | void | ) | [static] |
Loads the identity matrix of the model view.
The model view transformation are reset
void VisualActorGraphics::prepareProcessMonitorShow | ( | RGBAColor & | theColor | ) | [static] |
Prepares the show of the Process Monitor.
theColor | The requested color. |
void VisualActorGraphics::resetModelViewMatrix | ( | void | ) | [static] |
Resets the model view matrix.
void VisualActorGraphics::rotateMatrix | ( | double | angle, |
double | xAmount, | ||
double | yAmount, | ||
double | zAmount | ||
) | [static] |
Call of glRotate().
angle | The angle of the rotation. |
xAmount | The amount of the rotation around the horizontal axis. |
yAmount | The amount of the rotation around the vertical axis. |
zAmount | The amount of the rotation around the z-axis. |
void VisualActorGraphics::scaleMatrix | ( | double | xFactor, |
double | yFactor, | ||
double | zFactor | ||
) | [static] |
Call of glScale().
xFactor | The scale factor in the horizontal dimension. |
yFactor | The scale factor in the vertical dimension. |
zFactor | The scale factor in the z-dimension. |
void VisualActorGraphics::setBackgroundColor | ( | const RGBAColor & | aColorVal | ) | [static] |
Sets the value of the background color.
aColorVal | The RGBA values. |
void VisualActorGraphics::showProcessInfoNote | ( | void | ) | [static] |
Shows a note about Process Monitor.
void VisualActorGraphics::showProcessInfoRow | ( | Coord | coord, |
const char *const | textRowStr | ||
) | [static] |
Shows a row of Process Monitor Info.
The graphical operations involved in putting a row of textual process info on screen is encapsulated within this function.
coord | The coord where to place the text (left start position). |
textRowStr | Pointer to character buffer with process info string (label and value). |
void VisualActorGraphics::spotGL | ( | double | zPlane = 0.0 | ) | [static] |
Draws a spot (for testing purpose).
zPlane | The z-Coord (optional parameter, default = 0.0). |
void VisualActorGraphics::translateMatrix | ( | double | xNum, |
double | yNum, | ||
double | zNum | ||
) | [static] |
Call of glTranslate().
xNum | Horizontal coord value. |
yNum | Vertical coord value. |
zNum | Z-coord value. |
uint16 VisualActorGraphics::xCoordToPixel | ( | double | coordPos, |
const VisualCamera & | aCamera | ||
) | [static] |
Converts a horizontal coordinate to a horizontal pixel position.
coordPos | The canvas coord position. |
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |
double VisualActorGraphics::xPixelToCoord | ( | const uint16 | pixelPos, |
const VisualCamera & | aCamera | ||
) | [static] |
Converts a horizontal pixel position to a horizontal coordinate.
pixelPos | The canvas pixel position. |
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |
uint16 VisualActorGraphics::yCoordToPixel | ( | double | coordPos, |
const VisualCamera & | aCamera | ||
) | [static] |
Converts a vertical coordinate to a horizontal pixel position.
coordPos | The canvas coord position. |
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |
double VisualActorGraphics::yPixelToCoord | ( | const uint16 | pixelPos, |
const VisualCamera & | aCamera | ||
) | [static] |
Converts a vertical pixel position to a vertical coordinate.
pixelPos | The canvas pixel position. |
aCamera | Camera with dimensions, position, perspective projection, and orientation of stage view. |