Class ImageFilterInfo

3DS Max Plug-In SDK

Class ImageFilterInfo

See Also: Class ImageFilter, Class BitmapInfo, Class FrameRange, Class ITrackViewNode, Class Class_ID.

class ImageFilterInfo

Description:

This class provides information to an image filter plug-in. This is information such as state of any masks used, and the various frame ranges for the video post queue. It is analogous to the BitmapInfo class in the Bitmap Manager.

Data Members:

public:

BOOL maskenabled;

TRUE if the filter has a mask; otherwise FALSE.

BOOL evCopy;

This is used internally as a flag indicating this object is a temporary copy, and not the real thing. It is only an issue when filters have Track View Nodes. This is only used internally.

BOOL invertedmask;

TRUE if the mask is inverted; otherwise FALSE.

BitmapInfo mask;

The image used as the mask.

WORD maskflag;

This is used internally. It indicates what part of the mask image is used to create the grayscale mask. It may be one of the following values: MASK_R, MASK_G, MASK_B, MASK_A, MASK_L, MASK_Z, MASK_MTL_ID, MASK_NODE_ID.

BitmapInfo imgQueue;

This is a BitmapInfo that holds information about the current Video Post main queue image buffer. This can be used to get Video Post's (or the target image's) resolution, etc.

FrameRange QueueRange;

This defines the entire Video Post Queue range. This is the range defined between VP Start Time and VP End Time in the video post user interface.

FrameRange ExecutionRange;

When the queue is executed, this is the range of frames being rendered.

FrameRange FilterRange;

The FilterRange is where this filter starts and ends.

Methods:

Prototype:

virtual void SetResource(const TCHAR *n);

Remarks:

Filters may want to identify themselves by something more specific than their names when they appear in the video post queue. By default, the name of a filter is used to identify it in the video post queue, ie the Negative filter appears as Negative. Some filters may want a more descriptive name to appear. For instance a gradient filter that allows the user to save named settings may want the name of the set to appear rather than simply the name of the filter itself. Thus, "Flowing gradient - Red to Blue" may appear rather than "Gradient". This method is available for filters that that give such names to parameter sets. If not empty, the resource name will be used to identify the filter in the Video Post Queue. This is saved along with everything else by the system (3ds max).

Parameters:

const TCHAR *n

The name to appear, instead of the filter name, in the video post queue.

Prototype:

virtual const TCHAR *Resource();

Remarks:

Returns the resource name.

Prototype:

virtual const TCHAR *Name();

Remarks:

Returns the name of the filter.

Operators:

Prototype:

virtual ImageFilterInfo &operator= ( ImageFilterInfo &from );

Remarks:

Assignment operator.

Parameters:

ImageFilterInfo &from

The source ImageFilterInfo.

Prototype:

ITrackViewNode *Node();

Remarks:

This method is available in release 2.0 and later only.

This method is used to return the Track View node for this filter. Because Video Post Filter plug-ins have a short life, in other words, they are only loaded when they are actually needed and deleted right after, the Track View node information is kept in the ImageFilterInfo class kept by Video Post for each filter event.

Prototype:

void SetNode(ITrackViewNode *n);

Remarks:

This method is available in release 2.0 and later only.

This method sets the Track View node associated with this ImageFilter.

Parameters:

ITrackViewNode *n

The Track View node to set.

Prototype:

Class_ID NodeID();

Remarks:

This method is available in release 2.0 and later only.

Returns the Class_ID of the Track View node (if any).

Prototype:

void SetNodeID(Class_ID id);

Remarks:

This method is available in release 2.0 and later only.

Sets the stored Class_ID of the Track View node (if any).

Parameters:

Class_ID id

The id to set.

Prototype:

TCHAR *UserLabel();

Remarks:

This method is available in release 2.0 and later only.

Returns the optional label entered by the user while adding or editing a filter. This label replaces the filter's name in Video Post's tracks in Track View for easier identification. This is the name that is entered in the 'Edit Filter Event' dialog Filter Plug-In Label field. The label defaults to Unnamed in which case the Filter's name appears (for example 'Negative').

Prototype:

int FilterType();

Remarks:

This method is available in release 2.0 and later only.

This method is used so dual mode filters can detect what mode they are running in (as a filter or as a compositor). In the 3ds max 1.x SDK, filters that ran both as filters and layers had no way to determine what mode they were running while in "Setup" mode (in ShowControl()). At run time they would check for a foreground bitmap. If it was NULL, they were to assume they were running as simple filters. Now this method may be used to determine what mode they are running in.

Return Value:

One of the following values:

FLT_FILTER

FLT_LAYER

Prototype:

void SetFilterType(int type);

Remarks:

This method is available in release 2.0 and later only.

This method is used internally.