Vuo
1.2.5
|
Compiles, runs, and controls a Vuo composition.
This is an abstract base class which provides common methods for VuoImageFilter and VuoImageGenerator.
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. | |
(BOOL) | - setJSONValue:forInputPort: |
Sets the value of the specified published input port using a JSON-serialized value. | |
(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. | |
(GLuint) | - glTextureFromProvider:forOutputPort:outputPixelsWide:pixelsHigh:ioSurface: |
Retrieves 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. | |
(void) | + prepareForFastBuild |
Prepares the cache that enables compositions to build faster. | |
(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. | |
dispatch_queue_t | runnerQueue |
The composition's user-defined title. | |
VuoRunner * | runner |
The composition's user-defined title. | |
VuoCompiler * | compiler |
The composition's user-defined title. | |
VuoComposition * | composition |
The composition's user-defined title. | |
NSURL * | compositionURL |
The composition's user-defined title. | |
NSString * | compositionString |
The composition's user-defined title. | |
NSString * | compositionSourcePath |
The composition's user-defined title. | |
NSString * | compositionProcessName |
The composition's user-defined title. | |
VuoProtocol * | protocol |
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. | |
+ (id) cocoaObjectWithVuoValue: | (json_object *) | vuoValue | |
ofType: | (string) | type | |
Given the specified vuoValue
(serialized as JSON), returns a Cocoa object.
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 nametype
— 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 valuemenuItems
— 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 valuesuggestedMax
— value is a Cocoa object (see valueForOutputPort:) with the port's suggested maximum valuesuggestedStep
— 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 type
s:
- (GLuint) glTextureFromProvider: | (NSUInteger pixelsWide, NSUInteger pixelsHigh) | provider | |
forOutputPort: | (NSString *) | portName | |
outputPixelsWide: | (NSUInteger *) | outputPixelsWide | |
pixelsHigh: | (NSUInteger *) | outputPixelsHigh | |
ioSurface: | (IOSurfaceRef *) | outputIOSurface | |
Retrieves the image in the specified published output port, keeping it in GPU VRAM as an OpenGL texture.
Returns 0
if the composition is stopped, if no port with that name exists, if the port does not have type VuoImage
, or if the image could not be converted. Otherwise, returns the host-owned OpenGL texture name whose GL_TEXTURE_RECTANGLE_ARB
target has been populated.
provider | A 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. | |
portName | The name of an output port. | |
[out] | outputPixelsWide | Upon return, this contains the width of the output texture. |
[out] | outputPixelsHigh | Upon return, this contains the height of the output texture. |
[out] | outputIOSurface | Upon 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); |
- (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.
+ (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.
+ (void) prepareForFastBuild |
Prepares the cache that enables compositions to build faster.
The cache is prepared automatically when the first VuoRunnerCocoa is created. Optionally, this method can be called beforehand to avoid any delays when creating the first VuoRunnerCocoa.
- (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) setJSONValue: | (json_object *) | value | |
forInputPort: | (NSString *) | portName | |
Sets the value of the specified published input port using a JSON-serialized value.
Returns NO
if no port with that name exists.
The json_object
remains owned by the caller (this method doesn't change its reference count).
- (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+ (json_object *) vuoValueWithCocoaObject: | (id) | value |
Given the specified Cocoa object, returns a Vuo value (serialized as JSON).
Provided by category VuoRunnerCocoa(Conversion).
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
protected |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.
|
readatomicassign |
The composition's user-defined copyright text.
This is the @copyright
line of the composition's Doxygen header.
|
readatomicassign |
The composition's user-defined description.
The composition description consists of the lines after the first line of the composition's Doxygen header.
|
readatomicassign |
The composition's user-defined title.
This is the @brief
line of the composition's Doxygen header.