Vuo  2.3.2
Functions | Variables
VuoImage.c File Reference

Description

VuoImage implementation.

Definition in file VuoImage.c.

Go to the source code of this file.

Functions

void VuoImage_free (void *texture)
 Decrements the retain count of the OpenGL Texture Object associated with the specified VuoImage, and frees the texture VuoImage struct. More...
 
static VuoImage VuoImage_make_internal (unsigned int glTextureName, unsigned int glInternalFormat, unsigned long int pixelsWide, unsigned long int pixelsHigh, VuoImage_freeCallback freeCallback, void *freeCallbackContext)
 Helper for VuoImage_make and VuoImage_makeClientOwned. More...
 
VuoImage VuoImage_make (unsigned int glTextureName, unsigned int glInternalFormat, unsigned long int pixelsWide, unsigned long int pixelsHigh)
 Returns a new VuoImage structure representing the specified glTextureName. More...
 
VuoImage VuoImage_makeClientOwned (unsigned int glTextureName, unsigned int glInternalFormat, unsigned long int pixelsWide, unsigned long int pixelsHigh, VuoImage_freeCallback freeCallback, void *freeCallbackContext)
 Returns a new VuoImage structure representing the specified glTextureName. More...
 
VuoImage VuoImage_makeClientOwnedGlTextureRectangle (unsigned int glTextureName, unsigned int glInternalFormat, unsigned long int pixelsWide, unsigned long int pixelsHigh, VuoImage_freeCallback freeCallback, void *freeCallbackContext)
 Returns a new VuoImage structure representing the specified glTextureName. More...
 
VuoImage VuoImage_makeFromBuffer (const void *pixels, unsigned int format, unsigned int pixelsWide, unsigned int pixelsHigh, VuoImageColorDepth colorDepth, void(^freeCallback)(void *pixels))
 Uploads the specified pixel data to the GPU and returns a new VuoImage referencing it. More...
 
VuoImage VuoImage_makeFromBufferWithStride (const void *pixels, unsigned int format, unsigned int pixelsWide, unsigned int pixelsHigh, unsigned int bytesPerRow, VuoImageColorDepth colorDepth, void(^freeCallback)(void *pixels))
 Same as VuoImage_makeFromBuffer, but accepts a nonstandard stride (bytesPerRow). More...
 
const unsigned char * VuoImage_getBuffer (VuoImage image, unsigned int requestedFormat)
 Downloads the specified image's pixel data from the GPU to the CPU (or returns it from a cache), and returns the CPU memory buffer. More...
 
VuoImageWrapMode VuoImage_getWrapMode (VuoImage image)
 Returns the image's wrap mode. More...
 
void VuoImage_setWrapMode (VuoImage image, VuoImageWrapMode wrapMode)
 Changes the image's wrap mode. More...
 
VuoImage VuoImage_makeColorImage (VuoColor color, unsigned int pixelsWide, unsigned int pixelsHigh)
 Makes a solid-color image. More...
 
VuoImage VuoImage_makeCopy (VuoImage image, bool flip, unsigned int forcePixelsWide, unsigned int forcePixelsHigh, bool forceAlpha)
 Returns a new texture copy of the passed image. More...
 
VuoImage VuoImage_makeGlTextureRectangleCopy (VuoImage image)
 Copies image to a new GL_TEXTURE_RECTANGLE_ARB texture. More...
 
bool VuoImage_areEqualWithinTolerance (const VuoImage a, const VuoImage b, const unsigned char tolerance)
 Like VuoImage_areEqual(), but permits color channel values to differ by up to tolerance. More...
 
bool VuoImage_areEqual (const VuoImage a, const VuoImage b)
 Returns true if both images have the same dimensions and the same RGBA pixel data. More...
 
bool VuoImage_isLessThan (const VuoImage a, const VuoImage b)
 Returns true if the size of a is less than the size of b. More...
 
bool VuoImage_isEmpty (const VuoImage image)
 
bool VuoImage_isBlackOrTransparent (const VuoImage image, const unsigned char tolerance)
 
bool VuoImage_isPopulated (const VuoImage image)
 
VuoRectangle VuoImage_getRectangle (const VuoImage image)
 Returns a rectangle (in Vuo Coordinates) at the origin, with width 2 and height matching the image's aspect ratio. More...
 
VuoImageColorDepth VuoImage_getColorDepth (const VuoImage image)
 Returns the color depth of the image. More...
 
VuoImage VuoImage_makeFromJson (json_object *js)
 Decodes the JSON object js to create a new value. More...
 
static void VuoImage_IOSurfaceTextureFree (VuoImage i)
 Deletes the image's texture. More...
 
VuoImage VuoImage_makeFromJsonWithDimensions (struct json_object *js, unsigned int requestedPixelsWide, unsigned int requestedPixelsHigh)
 Decodes the JSON object js to create a new VuoImage. More...
 
GLuint VuoImage_resolveInterprocessJsonUsingTextureProvider (struct json_object *js, GLuint(^provider)(unsigned int pixelsWide, unsigned int pixelsHigh), unsigned int *outputPixelsWide, unsigned int *outputPixelsHigh, void *outputIOSurface)
 Decodes the JSON object js onto a host-provided OpenGL texture's GL_TEXTURE_RECTANGLE_ARB target. More...
 
static bool VuoImage_resolveInterprocessJsonOntoFramebufferInternal (IOSurfaceRef surf, VuoGlContext context, GLsizei pixelsWide, GLsizei pixelsHigh, bool flip, bool stretch)
 Helper for VuoImage_resolveInterprocessJsonOntoFramebuffer. More...
 
bool VuoImage_resolveInterprocessJsonUsingClientTexture (struct json_object *js, GLuint clientTextureName, unsigned int pixelsWide, unsigned int pixelsHigh, void *outputIOSurface)
 Decodes the JSON object js onto a host-provided OpenGL texture's GL_TEXTURE_RECTANGLE_ARB target. More...
 
bool VuoImage_resolveInterprocessJsonOntoFramebuffer (json_object *js, VuoGlContext context, bool flip, bool stretch)
 Decodes the JSON object js onto the framebuffer of a host-provided OpenGL context. More...
 
static GLuint CompileShader (CGLContextObj cgl_ctx, GLenum type, const char *source)
 Helper for VuoImage_resolveInterprocessJsonOntoFramebufferInternal. More...
 
json_objectVuoImage_getJson (const VuoImage value)
 Encodes value as a JSON object. More...
 
json_objectVuoImage_getInterprocessJson (const VuoImage value)
 Returns a JSON object containing an interprocess handle for the specified texture. More...
 
char * VuoImage_getSummary (const VuoImage value)
 A brief summary of the contents of this texture. More...
 
void glBindVertexArray (GLuint array)
 Stub. More...
 
void glDeleteVertexArrays (GLsizei n, const GLuint *arrays)
 Stub. More...
 
void glGenVertexArrays (GLsizei n, GLuint *arrays)
 Stub. More...
 

Variables

dispatch_once_t VuoImage_resolveInterprocessJsonOntoFramebufferInternal_init = 0
 Allows tests to reinitialize the context. More...
 

Function Documentation

◆ CompileShader()

static GLuint CompileShader ( CGLContextObj  cgl_ctx,
GLenum  type,
const char *  source 
)
static

Helper for VuoImage_resolveInterprocessJsonOntoFramebufferInternal.

Definition at line 1257 of file VuoImage.c.

◆ glBindVertexArray()

void glBindVertexArray ( GLuint  array)

Stub.

◆ glDeleteVertexArrays()

void glDeleteVertexArrays ( GLsizei  n,
const GLuint *  arrays 
)

Stub.

◆ glGenVertexArrays()

void glGenVertexArrays ( GLsizei  n,
GLuint *  arrays 
)

Stub.

◆ VuoImage_IOSurfaceTextureFree()

static void VuoImage_IOSurfaceTextureFree ( VuoImage  i)
static

Deletes the image's texture.

Definition at line 918 of file VuoImage.c.

◆ VuoImage_make_internal()

static VuoImage VuoImage_make_internal ( unsigned int  glTextureName,
unsigned int  glInternalFormat,
unsigned long int  pixelsWide,
unsigned long int  pixelsHigh,
VuoImage_freeCallback  freeCallback,
void *  freeCallbackContext 
)
static

Helper for VuoImage_make and VuoImage_makeClientOwned.

Definition at line 116 of file VuoImage.c.

◆ VuoImage_resolveInterprocessJsonOntoFramebufferInternal()

static bool VuoImage_resolveInterprocessJsonOntoFramebufferInternal ( IOSurfaceRef  surf,
VuoGlContext  context,
GLsizei  pixelsWide,
GLsizei  pixelsHigh,
bool  flip,
bool  stretch 
)
static

Helper for VuoImage_resolveInterprocessJsonOntoFramebuffer.

Definition at line 1283 of file VuoImage.c.

Variable Documentation

◆ VuoImage_resolveInterprocessJsonOntoFramebufferInternal_init

dispatch_once_t VuoImage_resolveInterprocessJsonOntoFramebufferInternal_init = 0

Allows tests to reinitialize the context.

Definition at line 1278 of file VuoImage.c.