Mac Developer Library

Developer

System Framework Reference CVOpenGLTexture Reference

Options
Deployment Target:

On This Page
Language:

CVOpenGLTexture Reference

In Core Video, you manipulate OpenGL textures using the CVOpenGLTexture opaque type. This type serves as a wrapper around the standard OpenGL texture type. An OpenGL texture is stored in video memory. You output OpenGL textures to the screen in response to the display link callback. For more information on the display link callback, see CVDisplayLinkOutputCallback.

Functions

  • Returns the texture coordinates for the part of the image that should be displayed.

    Declaration

    Swift

    func CVOpenGLTextureGetCleanTexCoords(_ image: CVOpenGLTexture!, _ lowerLeft: UnsafeMutablePointer<GLfloat>, _ lowerRight: UnsafeMutablePointer<GLfloat>, _ upperRight: UnsafeMutablePointer<GLfloat>, _ upperLeft: UnsafeMutablePointer<GLfloat>)

    Objective-C

    void CVOpenGLTextureGetCleanTexCoords ( CVOpenGLTextureRef image, GLfloat lowerLeft[2], GLfloat lowerRight[2], GLfloat upperRight[2], GLfloat upperLeft[2] );

    Parameters

    image

    The Core Video OpenGL texture whose clean tex coordinates you want to obtain.

    lowerLeft

    On output, the GLFloat array holds the s and t texture coordinates of the lower-left corner of the image.

    lowerRight

    On output, the GLFloat array holds the s and t texture coordinates of the lower-right corner of the image.

    upperRight

    On output, the GLFloat array holds the s and t texture coordinates of the upper-right corner of the image.

    upperLeft

    On output, the GLFloat array holds the s and t texture coordinates of the upper-left corner of the image.

    Discussion

    This function automatically takes into account whether or not the texture is flipped.

    Import Statement

    Objective-C

    @import CoreVideo;

    Swift

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Returns the texture target name of a CoreVideo OpenGL texture.

    Declaration

    Swift

    func CVOpenGLTextureGetName(_ image: CVOpenGLTexture!) -> GLuint

    Objective-C

    GLuint CVOpenGLTextureGetName ( CVOpenGLTextureRef image );

    Parameters

    image

    The Core Video OpenGL texture whose texture target name you want to obtain.

    Return Value

    The target name of the texture.

    Discussion

    See the OpenGL specification for more information about texture targets.

    Import Statement

    Objective-C

    @import CoreVideo;

    Swift

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Returns the texture target (for example, GL_TEXTURE_2D) of an OpenGL texture.

    Declaration

    Swift

    func CVOpenGLTextureGetTarget(_ image: CVOpenGLTexture!) -> GLenum

    Objective-C

    GLenum CVOpenGLTextureGetTarget ( CVOpenGLTextureRef image );

    Parameters

    image

    The Core Video OpenGL texture whose target you want to obtain.

    Return Value

    The OpenGL texture target.

    Discussion

    See the OpenGL specification for more information about texture targets.

    Import Statement

    Objective-C

    @import CoreVideo;

    Swift

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Obtains the Core Foundation ID for the Core Video OpenGL texture type.

    Declaration

    Swift

    func CVOpenGLTextureGetTypeID() -> CFTypeID

    Objective-C

    CFTypeID CVOpenGLTextureGetTypeID ( void );

    Return Value

    The Core Foundation ID for this type.

    Import Statement

    Objective-C

    @import CoreVideo;

    Swift

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Determines whether an OpenGL texture is flipped vertically.

    Declaration

    Swift

    func CVOpenGLTextureIsFlipped(_ image: CVOpenGLTexture!) -> Boolean

    Objective-C

    Boolean CVOpenGLTextureIsFlipped ( CVOpenGLTextureRef image );

    Parameters

    image

    The Core Video OpenGL texture whose vertical orientation you want to determine.

    Return Value

    Returns true if (0,0) in the texture is in the upper-left corner, and false if (0,0) is in the lower-left corner.

    Discussion

    Quartz assumes a lower-left origin.

    Import Statement

    Objective-C

    @import CoreVideo;

    Swift

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Releases a Core Video OpenGL texture.

    Declaration

    Objective-C

    void CVOpenGLTextureRelease ( CVOpenGLTextureRef texture );

    Parameters

    texture

    The Core Video OpenGL texture that you want to release.

    Discussion

    This function is equivalent to CFRelease, but is NULL safe.

    Import Statement

    Objective-C

    @import CoreVideo;

    Availability

    Available in OS X v10.4 and later.

  • Retains a Core Video OpenGL texture.

    Declaration

    Objective-C

    CVOpenGLTextureRef CVOpenGLTextureRetain ( CVOpenGLTextureRef texture );

    Parameters

    texture

    The Core Video OpenGL texture that you want to retain.

    Return Value

    For convenience, the Core Video OpenGL texture you want to retain.

    Discussion

    This function is equivalent to CFRetain, but is NULL safe.

    Import Statement

    Objective-C

    @import CoreVideo;

    Availability

    Available in OS X v10.4 and later.

Data Types

  • A reference to an OpenGL texture-based image buffer object.

    Declaration

    Swift

    typealias CVOpenGLTextureRef = CVOpenGLTexture

    Objective-C

    typedef CVImageBufferRef CVOpenGLTextureRef;

    Discussion

    The Core Video OpenGL texture is a wrapper around the standard OpenGL texture.

    Import Statement

    Objective-C

    @import CoreVideo;

    Swift

    import CoreVideo

    Availability

    Available in OS X v10.3 and later.