Initializer

init(glTexture:target:width:height:)

Creates a render destination based on an OpenGL texture.

Declaration

init(glTexture texture: UInt32, target: UInt32, width: Int, height: Int)

Parameters

texture

GLTexture-backed texture data.

target

A value denoting the type of destination. Use GL_TEXTURE_2D if your texture dimensions are a power of two, or GL_TEXTURE_RECTANGLE_EXT otherwise.

width

Width of the texture in texels.

height

Height of the texture in texels.

Return Value

A CIRenderDestination object for rendering to a GLTexture supported by GLContext-backed CIContext.

Discussion

Rendering to a GLTexture-backed CIRenderDestination is supported by only GLContext-backed CIContext.

The destination's colorSpace property will default to a CGColorSpace created with sRGB, extendedSRGB, or genericGrayGamma2_2.

See Also

Creating a Render Destination

init(pixelBuffer: CVPixelBuffer)

Creates a render destination based on a Core Video pixel buffer.

init(ioSurface: IOSurface)

Creates a render destination based on an IOSurface object.

init(mtlTexture: MTLTexture, commandBuffer: MTLCommandBuffer?)

Creates a render destination based on a Metal texture.