QCPlugInInputImageSource
The QCPlugInInputImageSource protocol eliminates the need to use explicit image types for the image input ports on your custom patch. Not only does using the protocol avoid restrictions of a specific image type, but it avoids impedance mismatches, and provides better performance by deferring pixel computation until it is needed. When you need to access the pixels in an image, you simply convert the image to a representation (texture or buffer) using one of the methods defined by the QCPlugInInputImageSource protocol. Use a texture representation when you want to use input images on the GPU. Use a buffer representation when you want to use input images on the CPU.
Declaration
protocol QCPlugInInputImageSourceOverview
Input images are opaque source objects that comply to this protocol. To create an image input port as an Objective-C 2.0 property, declare it as follows:
@property(dynamic) id<QCPlugInInputImageSource> inputImage;To create an image input port dynamically. use the type QCPortTypeImage:
[self addInputPortWithType:QCPortTypeImage
forKey:@"inputImage"
withAttributes:nil];Topics
Converting an Image to a Representation
lockTextureRepresentation(with:forBounds:)unlockTextureRepresentation()lockBufferRepresentation(withPixelFormat:colorSpace:forBounds:)bindTextureRepresentation(toCGLContext:textureUnit:normalizeCoordinates:)unbindTextureRepresentation(fromCGLContext:textureUnit:)unlockBufferRepresentation()
Getting Color Space Information
Getting Texture Information
texturePixelsWide()texturePixelsHigh()textureTarget()textureName()textureColorSpace()textureFlipped()textureMatrix()