VVFFGL
Framework for working with FreeFrame and FreeFrame GL filters
Public Member Functions | Properties
FFGLRenderer Class Reference

Object which renders and lets you communicate with an FFGLPlugin instance. More...

#import <FFGLRenderer.h>

Inherited by FFGLCPURenderer, and FFGLGPURenderer.

Public Member Functions

(id) - initWithPlugin:context:pixelFormat:outputHint:size:
(BOOL) - willUseParameterKey:
(void) - setValue:forParameterKey:
(FFGLImage *) - createOutputAtTime:

Properties

id parameters

Detailed Description

Object which renders and lets you communicate with an FFGLPlugin instance.

FFGLRenderer is conceptually and behaviorally similar to QCRenderer. The general workflow is that you create a FFGLPlugin instance, then create an FFGLRenderer from that plugin instance and an OpenGL context. The FFGLRenderer is what you send/receive values to/from, and is what actually does the rendering (it outputs FFGLImage instances). In addition to FFGLImage, this is another high-level and important class that you will probably use a lot.

There are some FFGLRenderer-related constants listed in the FFGLRendererConstants section.


Member Function Documentation

- (FFGLImage *) createOutputAtTime: (NSTimeInterval)  NS_RETURNS_RETAINED

Attempts to perform rendering using the currently set parameters at the specified time. Returns an FFGLImage if rendering succeeded, nil otherwise. You are responsible for releasing this image when you no longer need it.
Rendering may fail if insufficient image parameters are set, if image parameters are set but they couldn't be used by the renderer, or for other reasons.
FreeFrame GL plugins require OpenGL be in its default state before rendering. If the CGLContext used by the FFGLRenderer is the same as is used by your drawing code, take care to restore the GL state after you make OpenGL calls. Alternatively, create a seperate CGLContext shared with your drawing context to use with your FFGLRenderers. FFGL takes care to restore OpenGL state and multiple FFGLRenderers and FFGLImages can share a single CGLContext.
Note that if you are rendering a long chain of FFGLRenderers which share a CGLContext, making that context current (using CGLSetCurrentContext()) before rendering them will save the FFGLRenderers from having to switch and restore the current context for every render pass. This step is not necessary, but may improve performance.

- (id) initWithPlugin: (FFGLPlugin *)  plugin
context: (CGLContextObj)  context
pixelFormat: (NSString *)  format
outputHint: (FFGLRendererHint hint
size: (NSSize)  size 

Initializes a new renderer.

Parameters:
pluginshould be the FFGLPlugin to use for rendering.
contextshould be the CGLContext to use for rendering. See renderAtTime: below for guidance on using CGLContexts.
pixelFormatmust be one of the pixel-formats supported by plugin. If plugin is a GPU plugin, pixelFormat may be nil.
hintshould indicate your intentions for the output, and may be used to provide an FFGLImage optimized to suit. If you are passing the output of one FFGLRenderer into another FFGLRenderer as input for an image parameter, use FFGLRendererHintNone.
sizedetermines the dimensions of output frames. For CPU plugins, input frames must also match these dimensions.
- (void) setValue: (id)  value
forParameterKey: (NSString *)  key 

Sets the value of the named parameter.
For boolean parameters, value should be a NSNumber with a boolean value.
For number parameters, value should be a NSNumber with a float value between 0.0 and 1.0.
For string parameters, value should be a NSString.
For image parameters, value should be a FFGLImage. For CPU-mode plugins, the image's dimensions must match the renderer's dimensions.

Parameters:
keyshould be one of the keys obtained by a call to the FFGLRenderer's plugin's parameterKeys method.
- (BOOL) willUseParameterKey: (NSString *)  key

A plugin may ignore some of its image parameters under certain conditions. Use this method to discover if an input will be used with the parameters in their current state.


Property Documentation

- (id) parameters [read, assign]

Returns an object interested parties can bind to to get/set parameter values. Bind to aRenderer.parameters.aKey Note that although the parameters object itself is readonly, the values for the keys are read-write.


The documentation for this class was generated from the following files:
 All Data Structures Functions Properties