Vuo  0.8.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.

Instance Methods

(id) - initWithComposition:
 Opens the specified compositionURL, compiles it, and starts it running.
 
(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.
 
(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).
 
- 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.
 
(NSArray *) - outputPorts
 Returns an array listing the names of the composition's published output ports, excluding those used by protocols.
 
(NSDictionary *) - detailsForPort:
 Returns a dictionary with information about the specified portName.
 
(id) - propertyListFromInputValues
 Returns a property list with the current values of the composition's (non-protocol) published input ports.
 
(BOOL) - setInputValuesWithPropertyList:
 Sets the values of the composition's published input ports using a property list.
 
(BOOL) - setValue:forInputPort:
 Sets the value of the specified published input port.
 
(id) - valueForOutputPort:
 Returns the value of the specified published output port.
 
(GLuint) - glTextureWithTarget:forOutputPort:outputPixelsWide:pixelsHigh:
 Returns the image in the specified published output port, keeping it in GPU VRAM as an OpenGL texture.
 

Class Methods

(BOOL) + canOpenComposition:
 Returns YES if the specified compositionURL can be opened and adheres to the Image Filter protocol.
 
- 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.
 
(id) + cocoaObjectWithVuoValue:ofType:
 Given the specified vuoValue (serialized as JSON), returns a Cocoa object.
 
(json_object *) + vuoValueWithCocoaObject:
 Given the specified Cocoa object, returns a Vuo value (serialized as JSON).
 
(NSImage *) + nsImageWithVuoImage:
 Converts the provided VuoImage to an NSImage.
 
(NSArray *) + menuItemsForType:
 Returns an NSArray where each element is an NSDictionary with 2 keys: value (NSString) and name (NSString).
 

Additional Inherited Members

- Protected Attributes inherited from VuoRunnerCocoa
dispatch_queue_t runnerQueue
 The composition's user-defined title.
 
VuoRunnerrunner
 The composition's user-defined title.
 
VuoCompilercompiler
 The composition's user-defined title.
 
VuoCompositioncomposition
 The composition's user-defined title.
 
NSURL * compositionURL
 The composition's user-defined title.
 
NSString * compositionString
 The composition's user-defined title.
 
VuoProtocolprotocol
 The composition's user-defined title.
 
- Properties inherited from VuoRunnerCocoa
NSString * compositionName
 The composition's user-defined title.
 
NSString * compositionDescription
 The composition's user-defined description.
 
NSString * compositionCopyright
 The composition's user-defined copyright text.
 

Method Documentation

+ (BOOL) canOpenComposition: (NSURL *)  compositionURL

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

- (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).
- (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).
- (id) initWithComposition: (NSURL *)  aCompositionURL

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

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

This function opens, parses, and verifies protocol compliance, then returns. Compilation and execution are performed asynchronously.


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