MM Developer's Guide
MM Interfaces | MM Methods | MM Types and Misc API

IMoaBitmapFilter

Interface ID: IID_IMoaBitmapFilter
Pointer type: PIMoaBitmapFilter
Inheritance: IMoaUnknown
Header file: bmfilters.h
Filters
IMoaBitmapFilter offers a way to provide custom filter effects for sprites in Director. A filter instance is associated with a score sprite and called when the sprite is imaged. The filter can process the sprite image data, replacing it with a modified version of the image. When Director starts up, it checks for any filter xtras and presents them in a list in the Property Inspector Filters tab. Filter properties get stored with other sprite data in the score. The Property Inspector based user interface for filter properties can be offered by use of a VDL file, and by providing response the the dbgPropList() function call in your filter. See the TileFilter example for some code that shows this in operation. Filters can also assigned to a sprite with the Director scripting language. There is currently no way to programmatically add a filter to the score when doing a score recording session.

Methods

Filter methods
GetProp()
SetProp()
RunFilter()
StreamOutProps()
StreamInProps()
GetStreamOutPropsSize()
InvokePropsEditor()
FinishPropsEditor()
GetOutputRect()
CallFunction()
GetFilterCaps()
SetCallback()
Notify()

CallFunction()

Syntax
CallFunction(MoaMmSymbol methodName, MoaLong nArgs, ConstPMoaMmValue pArgs, PMoaMmValue pResult)
Parameters
methodName
Symbol of the method (function) to call
nArgs
Number of arguments, excluding reserved value in pArgs[0]
pArgs
Array of arguments, with the first valid argument at pArgs[1]
pResult
Pointer to a MoaMmValue to receive a result value, if any
Returns
MoaError
Description
This method provides scripting support for a filter. It is also used by the Director user interface code to determine what properties a filter supports.

FinishPropsEditor()

Syntax
FinishPropsEditor(MoaBoolParam param, PMoaMmModifyFlags pFlags)
Parameters
param
-
pFlags
-
Returns
MoaError
Description
Not used In Director 11

GetFilterCaps()

Syntax
GetFilterCaps(PMoaBMFilterCaps pCaps)
Parameters
pCaps
Place to return the filter capabilities flag values.
Returns
MoaError
Description
Called to find out what specific capabilities a filter provides

GetOutputRect()

Syntax
GetOutputRect(const PMoaFilterInfo pSource, PMoaFilterInfo pDestination)
Parameters
pSource
Pointer to the input rectangle of the image
pDestination
Pointer to store the output size rectangle after the filter
Returns
MoaError
Description
This function is called to determine the size of the image after the filter will be applied. If your filter does not change the image size, then return the same size rectangle as provided in pSource.

GetProp()

Syntax
GetProp(MoaMmSymbol symbol, PMoaMmValue pPropValue)
Parameters
symbol
The MoaMmSymbol for the property of interest
pPropValue
Pointer to a MoaMmValue to receive the value
Returns
kMoaErr_NoErr Property exists and value was returned
kMoaErr_BadParam Invalid pPropValue passed in
kMoaMmErr_PropertyNotFound Property isn't supported by this class
kMoaMmErr_InternalError Property exists but couldn't get due to internal error
kMoaMmErr_NoMemForString Couldn't allocate memory for string value data
kMoaErr_OutOfMem Couldn't allocate memory for other value data
Description
Method to get the value of a property as defined by the MoaMmSymbol parameter

GetStreamOutPropsSize()

Syntax
GetStreamOutPropsSize(MoaLong *pSizeBytes)
Parameters
pSizeBytes
Pointer to a MoaLong to receive the total amount of property data
Returns
MoaError
Description
Implement this method to inform the host application of the total amount of properties data, in bytes, streamed out when the application calls your IMoaMmXAsset::StreamOutProps() method. If the filter has no properties data to stream out, set the value at pSizeBytes to 0. You must supply the actual data size that would be streamed out in a subsequent call to IMoaMmXAsset::StreamOutProps().

InvokePropsEditor()

Syntax
InvokePropsEditor()
Parameters
Returns
MoaError
Description
Not used In Director 11

Notify()

Syntax
Notify(MoaLong msgCode, PMoaVoid refCon)
Parameters
msgCode
message identifier
refCon
reference value
Returns
MoaError
Description
-

RunFilter()

Syntax
RunFilter(PIMoaMmGC pGC, const PMoaFilterInfo pInfo)
Parameters
pGC
Pointer to an IMoaMmGC interface for the graphics context which the filter should process.
pInfo
Defines the rect where to apply the filter. It also specifies the scale factor of stage.
Returns
MoaError
Description
Called when the filter effect should be applied to the sprite image. The pGC reference contains the image pixel data which will get modified by the filter.

SetCallback()

Syntax
SetCallback(PIMoaBitmapFilterCallback pBitmapFilterCallback)
Parameters
pBitmapFilterCallback
Filter call interface
Returns
MoaError
Description
-

SetProp()

Syntax
SetProp(MoaMmSymbol symbol, ConstPMoaMmValue pPropValue)
Parameters
symbol
The MoaMmSymbol for the property of interest
pPropValue
Pointer to a caller-owned ConstPMoaMmValue structure from which to copy the new value
Returns
kMoaErr_NoErr Property exists and value was set
kMoaErr_BadParam Invalid pPropValue passed in
kMoaMmErr_PropertyNotFound Property isn't supported by this class
kMoaMmErr_InternalError Property exists, value ok, couldn't set--internal error
kMoaMmErr_NoMemForString Couldn't allocate memory for setting string value data
kMoaErr_OutOfMem Couldn't allocate memory for setting other value data
kMoaMmErr_IntegerExpected Type mismatch: integer value expected
kMoaMmErr_SymbolExpected Type mismatch: symbol value expected
kMoaMmErr_FloatExpected Type mismatch: float value expected
kMoaMmErr_StringExpected Type mismatch: string value expected
kMoaMmErr_PointExpected Type mismatch: point value expected
kMoaMmErr_RectExpected Type mismatch: rect value expected
kMoaMmErr_ValueTypeMismatch Type mismatch: other value expected (non-specific)
kMoaDrErr_CastMemberExpected Type mismatch: CMRef value expected
Description
Sets the value of the specified property. To get the symbol froma string, use the IMoaMmUtils::StringToSymbol() method. The caller continues to maintain ownership of the value passed in, and should release it using IMoaMmUtils::ValueRelease() when it is no longer needed.

StreamInProps()

Syntax
StreamInProps(PIMoaStream pInStream)
Parameters
pInStream
Pointer to IMoaStream interface to use for streaming in property data
Returns
MoaError
Description
Streams in the filter property data by utilizing the supplied IMoaStream interface. Filter property is stored in the score along with other data about the sprite. The host application owns the stream interface, so you should not release it. Return kMoaErr_NoErr to indicate to the host application that the filter properties (if any) have been loaded successfully

StreamOutProps()

Syntax
StreamOutProps(PIMoaStream pOutStream)
Parameters
pOutStream
Pointer to the IMoaStream interface to use for streaming out property data
Returns
MoaError
Description
Streams out the filter property data by utilizing the supplied IMoaStream interface. Filter properties are stored in the score along with other score data. The host application owns the stream interface, so you should not release it. If your filter instance does not have any property data, it can return from this call (with kMoaErr_NoErr) without utilizing the stream.

Copyright © 1995-2008 Adobe Macromedia Software LLC, Inc.