Vuo  1.0.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Instance Methods | Class Methods | List of all members
VuoRunnerCocoa Class Reference

Description

Compiles, runs, and controls a Vuo composition.

This is an abstract base class which provides common methods for VuoImageFilter and VuoImageGenerator.

See Also
VuoRunner (a similar API, in C++)

Instance Methods

(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

(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).
 
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.
 
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

+ (id) cocoaObjectWithVuoValue: (json_object *)  vuoValue
ofType: (string)  type 

Given the specified vuoValue (serialized as JSON), returns a Cocoa object.

See Also
valueForOututPort:

Provided by category VuoRunnerCocoa(Conversion).

- (NSDictionary *) detailsForPort: (NSString *)  portName

Returns a dictionary with information about the specified portName.

Keys include:

  • title — value is an NSString with the port's display name
  • type — value is an NSString with the port's type (e.g., VuoText)
  • default — value is a Cocoa object (see valueForOutputPort:) with the port's default value
  • menuItems — value is an NSArray where each element is an NSDictionary with 2 keys: value (NSString) and name (NSString)
  • suggestedMin — value is a Cocoa object (see valueForOutputPort:) with the port's suggested minimum value
  • suggestedMax — value is a Cocoa object (see valueForOutputPort:) with the port's suggested maximum value
  • suggestedStep — value is a Cocoa object (see valueForOutputPort:) with the port's suggested step (the amount the value changes with each click of a spinbox)

If menuItems contains any values, the host application should display a select widget. Otherwise, the host application should use type to determine the kind of widget to display. Host applications are encouraged to provide widgets for the following specific types:

- (GLuint) glTextureWithTarget: (GLuint)  target
forOutputPort: (NSString *)  portName
outputPixelsWide: (NSUInteger *)  outputPixelsWide
pixelsHigh: (NSUInteger *)  outputPixelsHigh 

Returns the image in the specified published output port, keeping it in GPU VRAM as an OpenGL texture.

target must be either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB.

Returns 0 if no port with that name exists, or if the port does not have type VuoImage.

The caller is responsible for deleting the texture when it is finished using it.

- (NSArray *) inputPorts

Returns an array listing the names of the composition's published input ports, excluding those used by protocols.

+ (NSArray *) menuItemsForType: (string)  type

Returns an NSArray where each element is an NSDictionary with 2 keys: value (NSString) and name (NSString).

Provided by category VuoRunnerCocoa(Conversion).

+ (NSImage *) nsImageWithVuoImage: (VuoImage vi

Converts the provided VuoImage to an NSImage.

Provided by category VuoRunnerCocoa(Conversion).

- (NSArray *) outputPorts

Returns an array listing the names of the composition's published output ports, excluding those used by protocols.

- (id) propertyListFromInputValues

Returns a property list with the current values of the composition's (non-protocol) published input ports.

+ (void) setGlobalRootContext: (CGLContextObj)  context

Specifies an OpenGL context to be used as the base for all of Vuo's shared GL contexts.

The CGLContext must be unlocked when calling this function, but after that you may lock it at any time (Vuo doesn't require it to be locked or unlocked).

Must be called before any Vuo composition is loaded.

This function may be called from any thread.

- (BOOL) setInputValuesWithPropertyList: (id)  propertyList

Sets the values of the composition's published input ports using a property list.

Returns NO if restoration of any of the port values failed. (However, in the event of failure, it will try to keep going and set other port values.)

- (BOOL) setValue: (id)  value
forInputPort: (NSString *)  portName 

Sets the value of the specified published input port.

Returns NO if no port with that name exists, or if the value could not be converted.

This method accepts the following object types for value:

  • NSNumber, CFNumberRef
  • NSString, CFStringRef
  • NSColor, CIColor
  • NSImage, NSBitmapImageRep, CGImageRef, CVPixelBufferRef, CVOpenGLTextureRef
  • NSPoint or CGPoint wrapped in NSValue (VuoPoint2d)
  • SCNVector3 or double[3] wrapped in NSData or CFDataRef (VuoPoint3d)
  • NSArray or CFArrayRef containing a list of one of the above types
- (id) valueForOutputPort: (NSString *)  portName

Returns the value of the specified published output port.

Returns nil if no port with that name exists, or if the value could not be converted.

This method may return any of the following object types:

  • NSNumber (VuoBoolean, VuoInteger, VuoReal)
  • NSString (VuoText and keyed types such as VuoCurve)
  • NSColor
  • NSImage
  • NSPoint wrapped in NSValue (VuoPoint2d)
  • double[3] wrapped in NSData (VuoPoint3d)
  • NSArray containing any of the above types
See Also
- glTextureWithTarget:forOutputPort:outputPixelsWide:pixelsHigh: for a more efficient way to retrieve image values.
+ (json_object *) vuoValueWithCocoaObject: (id)  value

Given the specified Cocoa object, returns a Vuo value (serialized as JSON).

See Also
- setValue:forInputPort:

Provided by category VuoRunnerCocoa(Conversion).

Member Data Documentation

- (VuoCompiler*) compiler
protected

The composition's user-defined title.

This is the @brief line of the composition's Doxygen header.

- (VuoComposition*) composition
protected

The composition's user-defined title.

This is the @brief line of the composition's Doxygen header.

- (NSString*) compositionString
protected

The composition's user-defined title.

This is the @brief line of the composition's Doxygen header.

- (NSURL*) compositionURL
protected

The composition's user-defined title.

This is the @brief line of the composition's Doxygen header.

- (VuoProtocol*) protocol
protected

The composition's user-defined title.

This is the @brief line of the composition's Doxygen header.

- (VuoRunner*) runner
protected

The composition's user-defined title.

This is the @brief line of the composition's Doxygen header.

- (dispatch_queue_t) runnerQueue
protected

The composition's user-defined title.

This is the @brief line of the composition's Doxygen header.

Property Documentation

- (NSString *) compositionCopyright
readatomicassign

The composition's user-defined copyright text.

This is the @copyright line of the composition's Doxygen header.

- (NSString *) compositionDescription
readatomicassign

The composition's user-defined description.

The composition description consists of the lines after the first line of the composition's Doxygen header.

- (NSString *) compositionName
readatomicassign

The composition's user-defined title.

This is the @brief line of the composition's Doxygen header.


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