Vuo  1.0.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
VuoImageRenderer.cc File Reference

Description

VuoImageRenderer implementation.

Classes

struct  VuoImageRendererInternal
 Internal state data for a VuoImageRenderer instance. More...
 

Macros

#define glGenVertexArrays   glGenVertexArraysAPPLE
 
#define glBindVertexArray   glBindVertexArrayAPPLE
 
#define glDeleteVertexArrays   glDeleteVertexArraysAPPLE
 

Functions

void VuoImageRenderer_destroy (VuoImageRenderer ir)
 Destroys and deallocates the image renderer.
 
VuoImageRenderer VuoImageRenderer_make (VuoGlContext glContext)
 Creates a reference-counted object for rendering a VuoImage.
 
VuoImage VuoImageRenderer_draw (VuoImageRenderer ir, VuoShader shader, unsigned int pixelsWide, unsigned int pixelsHigh, VuoImageColorDepth imageColorDepth)
 Produces a new VuoImage by rendering shader.
 
unsigned long int VuoImageRenderer_draw_internal (VuoImageRenderer ir, VuoShader shader, unsigned int pixelsWide, unsigned int pixelsHigh, VuoImageColorDepth imageColorDepth, bool outputToIOSurface, bool outputToGlTextureRectangle)
 Helper for VuoImageRenderer_draw().
 

Variables

static const GLfloat quadData []
 Positions and texture coordinates for a quad.
 
static const GLushort quadElements [] = { 0, 1, 2, 3 }
 The order of quadData's elements.
 
static const GLfloat unityMatrix [16]
 An identity matrix.
 

Class Documentation

struct VuoImageRendererInternal
Class Members
VuoGlContext glContext
GLuint outputFramebuffer
GLuint quadDataBuffer
GLuint quadElementBuffer
GLuint vertexArray

Function Documentation

void VuoImageRenderer_destroy ( VuoImageRenderer  ir)

Destroys and deallocates the image renderer.

This function may be called from any thread.

VuoImage VuoImageRenderer_draw ( VuoImageRenderer  ir,
VuoShader  shader,
unsigned int  pixelsWide,
unsigned int  pixelsHigh,
VuoImageColorDepth  imageColorDepth 
)

Produces a new VuoImage by rendering shader.

This function may be called from any thread. (However, the caller is responsible for ensuring that the GL context is not used simultaneously on multiple threads.) (Additionally, the caller is responsible for ensuring that the same VuoImageRenderer is not used simultaneously on multiple threads.)

unsigned long int VuoImageRenderer_draw_internal ( VuoImageRenderer  ir,
VuoShader  shader,
unsigned int  pixelsWide,
unsigned int  pixelsHigh,
VuoImageColorDepth  imageColorDepth,
bool  outputToIOSurface,
bool  outputToGlTextureRectangle 
)

Helper for VuoImageRenderer_draw().

If outputToGlTextureRectangle is true, the caller is responsible for deleting the texture (it should not be thrown into the GL texture pool).

VuoImageRenderer VuoImageRenderer_make ( VuoGlContext  glContext)

Creates a reference-counted object for rendering a VuoImage.

This function may be called from any thread.

Todo:
https://b33p.net/kosada/node/6901
Todo:
https://b33p.net/kosada/node/6901

Variable Documentation

const GLfloat quadData[]
static
Initial value:
= {
-1, -1, 0, 1,
1, -1, 0, 1,
-1, 1, 0, 1,
1, 1, 0, 1,
0, 0, 0, 0,
1, 0, 0, 0,
0, 1, 0, 0,
1, 1, 0, 0
}

Positions and texture coordinates for a quad.

const GLushort quadElements[] = { 0, 1, 2, 3 }
static

The order of quadData's elements.

const GLfloat unityMatrix[16]
static
Initial value:
= {
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1
}

An identity matrix.