Vuo  2.2.0
Instance Methods | Class Methods | List of all members
VuoImageFilter Class Reference

Description

Compiles, runs, and controls a Vuo composition that adheres to the Image Filter protocol.

Definition at line 84 of file VuoRunnerCocoa.h.

Instance Methods

(id) - initWithComposition:
 Opens the specified compositionURL, compiles it, and starts it running. More...
 
(id) - initWithCompositionString:name:sourcePath:
 Compiles the specified compositionString and starts it running. More...
 
(NSImage *) - filterNSImage:atTime:
 Sends image to the Vuo composition, instructs the Vuo composition to filter it at the specified logical time (number of seconds since rendering started), and returns the filtered image. More...
 
(GLuint) - filterGLTexture:target:pixelsWide:pixelsHigh:atTime:outputPixelsWide:pixelsHigh:
 Sends textureName to the Vuo composition, instructs the Vuo composition to filter it at the specified logical time (number of seconds since rendering started), and returns the filtered image (attached to target). More...
 
(GLuint) - filterGLTexture:target:pixelsWide:pixelsHigh:atTime:withTextureProvider:outputPixelsWide:pixelsHigh:ioSurface:
 Sends textureName to the Vuo composition, instructs the Vuo composition to filter it at the specified logical time (number of seconds since rendering started), requests that the host provide a texture of the appropriate size, and returns that texture with image data attached to its GL_TEXTURE_RECTANGLE_ARB target. More...
 
- Instance Methods inherited from VuoRunnerCocoa
(NSArray *) - inputPorts
 Returns an array listing the names of the composition's published input ports, excluding those used by protocols. More...
 
(NSArray *) - outputPorts
 Returns an array listing the names of the composition's published output ports, excluding those used by protocols. More...
 
(NSDictionary *) - detailsForPort:
 Returns a dictionary with information about the specified portName. More...
 
(id) - propertyListFromInputValues
 Returns a property list with the current values of the composition's (non-protocol) published input ports. More...
 
(BOOL) - setInputValuesWithPropertyList:
 Sets the values of the composition's published input ports using a property list. More...
 
(BOOL) - setInputValues:
 Sets the value of one or more published input ports. More...
 
(BOOL) - setInputJSON:
 Sets the value of one or more published input ports using json_object * values wrapped in NSValue. More...
 
(id) - valueForOutputPort:
 Returns the value of the specified published output port. More...
 
(GLuint) - glTextureWithTarget:forOutputPort:outputPixelsWide:pixelsHigh:
 Returns the image in the specified published output port, keeping it in GPU VRAM as an OpenGL texture. More...
 
(GLuint) - glTextureFromProvider:forOutputPort:outputPixelsWide:pixelsHigh:ioSurface:
 Retrieves the image in the specified published output port, keeping it in GPU VRAM as an OpenGL texture. More...
 

Class Methods

(BOOL) + canOpenComposition:
 Returns YES if the specified compositionURL can be opened and adheres to the Image Filter protocol. More...
 
(BOOL) + canOpenCompositionString:
 Returns YES if the specified compositionString and adheres to the Image Filter protocol. More...
 
- Class Methods inherited from VuoRunnerCocoa
(void) + setGlobalRootContext:
 Specifies an OpenGL context to be used as the base for all of Vuo's shared GL contexts. More...
 
(void) + prepareForFastBuild
 Prepares the cache that enables compositions to build faster. More...
 
(id) + cocoaObjectWithVuoValue:ofType:
 Given the specified vuoValue (serialized as JSON), returns a Cocoa object. More...
 
(json_object *) + vuoValueWithCocoaObject:
 Given the specified Cocoa object, returns a Vuo value (serialized as JSON). More...
 
(NSImage *) + nsImageWithVuoImage:
 Converts the provided VuoImage to an NSImage. More...
 

Additional Inherited Members

- Properties inherited from VuoRunnerCocoa
NSString * compositionName
 The composition's user-defined title. More...
 
NSString * compositionDescription
 The composition's user-defined description. More...
 
NSString * compositionCopyright
 The composition's user-defined copyright text. More...
 

Method Documentation

◆ canOpenComposition:

+ (BOOL) canOpenComposition: (NSURL *)  compositionURL

Returns YES if the specified compositionURL can be opened and adheres to the Image Filter protocol.

Definition at line 56 of file VuoRunnerCocoa.mm.

◆ canOpenCompositionString:

+ (BOOL) canOpenCompositionString: (NSString *)  compositionString

Returns YES if the specified compositionString and adheres to the Image Filter protocol.

Definition at line 56 of file VuoRunnerCocoa.mm.

◆ filterGLTexture:target:pixelsWide:pixelsHigh:atTime:outputPixelsWide:pixelsHigh:

- (GLuint) filterGLTexture: (GLuint)  textureName
target: (GLuint)  target
pixelsWide: (NSUInteger)  pixelsWide
pixelsHigh: (NSUInteger)  pixelsHigh
atTime: (NSTimeInterval)  time
outputPixelsWide: (NSUInteger *)  outputPixelsWide
pixelsHigh: (NSUInteger *)  outputPixelsHigh 

Sends textureName to the Vuo composition, instructs the Vuo composition to filter it at the specified logical time (number of seconds since rendering started), and returns the filtered image (attached to target).

textureName remains owned by the caller. It may be deleted or recycled after this method returns.

target must be either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB.

Note
The Vuo composition is not required to produce an image with the same dimensions as the input image (it is a hint, not a guarantee).

Definition at line 777 of file VuoRunnerCocoa.mm.

◆ filterGLTexture:target:pixelsWide:pixelsHigh:atTime:withTextureProvider:outputPixelsWide:pixelsHigh:ioSurface:

- (GLuint) filterGLTexture: (GLuint)  textureName
target: (GLuint)  target
pixelsWide: (NSUInteger)  pixelsWide
pixelsHigh: (NSUInteger)  pixelsHigh
atTime: (NSTimeInterval)  time
withTextureProvider: (GLuint(^)(NSUInteger pixelsWide, NSUInteger pixelsHigh))  provider
outputPixelsWide: (NSUInteger *)  outputPixelsWide
pixelsHigh: (NSUInteger *)  outputPixelsHigh
ioSurface: (IOSurfaceRef *)  outputIOSurface 

Sends textureName to the Vuo composition, instructs the Vuo composition to filter it at the specified logical time (number of seconds since rendering started), requests that the host provide a texture of the appropriate size, and returns that texture with image data attached to its GL_TEXTURE_RECTANGLE_ARB target.

Parameters
textureNameThe OpenGL texture name to filter. Remains owned by the caller. The host app may delete or recycle it after this method returns.
targetThe target to which the input image is bound. Must be either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB.
pixelsWideThe input image's width.
pixelsHighThe input image's height.
timeThe logical time at which to filter the image.
providerA block that returns an OpenGL texture name with the requested width and height. The host app must not call glTexImage2D() on the texture, since this makes the texture incompatible with the IOSurface backing.
[out]outputPixelsWideUpon return, this contains the width of the output texture.
[out]outputPixelsHighUpon return, this contains the height of the output texture.
[out]outputIOSurfaceUpon return, this contains the IOSurface backing the output texture. When the host app is finished with the output texture, it must signal and release the IOSurface:
VuoIoSurfacePool_signal(outputIOSurface);
CFRelease(outputIOSurface);
Note
The Vuo composition is not required to produce an image with the same dimensions as the input image (it is a hint, not a guarantee).

Definition at line 777 of file VuoRunnerCocoa.mm.

◆ filterNSImage:atTime:

- (NSImage *) filterNSImage: (NSImage *)  image
atTime: (NSTimeInterval)  time 

Sends image to the Vuo composition, instructs the Vuo composition to filter it at the specified logical time (number of seconds since rendering started), and returns the filtered image.

This method requires a roundtrip between CPU and GPU RAM, which is slow. If possible, use filterGLTexture:target:pixelsWide:pixelsHigh:atTime:outputPixelsWide:pixelsHigh: instead.

Note
The Vuo composition is not required to produce an image with the same dimensions as the input image (it is a hint, not a guarantee).

Definition at line 777 of file VuoRunnerCocoa.mm.

◆ initWithComposition:

- (id) initWithComposition: (NSURL *)  aCompositionURL

Opens the specified compositionURL, compiles it, and starts it running.

Returns nil if the composition cannot be opened, if it does not adhere to the Image Filter protocol, or if it cannot be compiled.

Definition at line 56 of file VuoRunnerCocoa.mm.

◆ initWithCompositionString:name:sourcePath:

- (id) initWithCompositionString: (NSString *)  aCompositionString
name: (NSString *)  name
sourcePath: (NSString *)  sourcePath 

Compiles the specified compositionString and starts it running.

name specifies the running process should have.

Returns nil if the composition does not adhere to the Image Filter protocol, or if it cannot be compiled.

Definition at line 56 of file VuoRunnerCocoa.mm.


The documentation for this class was generated from the following files: