HDK
|
#include <TIL_RasterFilter.h>
Classes | |
struct | Factory |
The factory to define a filter. More... | |
Public Types | |
using | TIL_RasterFilterPtr = UT_UniquePtr< TIL_RasterFilter > |
Public Member Functions | |
virtual const char * | className () const =0 |
For debugging. More... | |
virtual bool | setOptions (const UT_Options &options) |
void | setAuxPlane (const UT_StringHolder &planename, const PXL_Raster *raster) |
virtual bool | apply (PXL_Raster *raster)=0 |
Returns false if fail. More... | |
virtual void | reset () |
const UT_StringArray & | getAuxPlaneNames () const |
Get the list of aux plane names. More... | |
const UT_StringHolder & | getErrorString () const |
virtual bool | isInteractive () const |
TIL_RasterFilter () | |
virtual | ~TIL_RasterFilter () |
Static Public Member Functions | |
static void | registerFactory (UT_UniquePtr< Factory > factory) |
static void | removeFactory (const UT_StringRef &name) |
Remove a factory from the list. More... | |
static void | getFilters (UT_Array< const Factory * > &filters) |
Get a list of all the filters. More... | |
static TIL_RasterFilterPtr | allocFilter (const UT_StringRef &name) |
static const UT_StringHolder & | albedoToken () |
static const UT_StringHolder & | normalToken () |
static const UT_StringHolder & | mvectorToken () |
static const UT_StringHolder & | prevfrToken () |
Protected Attributes | |
UT_StringArray | myAuxPlaneNames |
UT_StringMap< const PXL_Raster * > | myAuxPlanes |
UT_StringHolder | myErrorString |
Apply arbitrary filters to PXL_Raster image(s).
The DSO must implement "newRasterFilter" function which should create new filters by calling TIL_RasterFilter::registerFactory(). Image filters will be searched for in $HOUDINI_DSO_PATH/img_filter.
When the filter is instantiated, the caller will initialize the filter calling setOptions
. This is only called one time, though the filter may be invoked multiple times.
Prior to invoking the filter, the reset()
method will be called. This lets the filter reset any information that changes from run to run.
The caller will then set up any optional read-only auxilliary rasters the filter may need for processing. That is, the caller will call setAuxPlane
zero or more times.
After the filter is reset and auxilliary planes are added, the apply()
method will finally be called. This should modify the raster passed in to create the resulting image. It's possible the apply() method may be called multiple times before reset() is called again.
Definition at line 53 of file TIL_RasterFilter.h.
Definition at line 56 of file TIL_RasterFilter.h.
|
inline |
Constructor/Destructor
Definition at line 71 of file TIL_RasterFilter.h.
|
inlinevirtual |
Constructor/Destructor
Definition at line 72 of file TIL_RasterFilter.h.
|
static |
Get tokens that are used to store auxilliary planes
|
static |
|
pure virtual |
Returns false if fail.
Implemented in TIL_NullFilter.
|
pure virtual |
For debugging.
Implemented in TIL_NullFilter.
|
inline |
Get the list of aux plane names.
Definition at line 134 of file TIL_RasterFilter.h.
|
inline |
Get stored error msg in case apply() fails. Sub-classes can set myErrorString
to something meaningful for the caller.
Definition at line 139 of file TIL_RasterFilter.h.
Get a list of all the filters.
|
inlinevirtual |
If the filter can run in a few milliseconds, you can try returning true.
Reimplemented in TIL_NullFilter.
Definition at line 144 of file TIL_RasterFilter.h.
|
static |
Get tokens that are used to store auxilliary planes
|
static |
Get tokens that are used to store auxilliary planes
|
static |
Get tokens that are used to store auxilliary planes
|
static |
Register a new factory. Set HOUDINI_DSO_ERROR=1 to get information on why the filter might not be installed.
|
static |
Remove a factory from the list.
Reset and get ready for a new filter. If you subclass this method, please make sure to call the base class method.
Reimplemented in TIL_NullFilter.
Definition at line 128 of file TIL_RasterFilter.h.
|
inline |
Set up an auxilliary plane. This is a raster which isn't actually modified, but is used in the filtering (for example a mask). The caller looks at the myAuxPlaneNames
list to see which rasters you might require. If they are available, they will be stashed in this array.
Definition at line 117 of file TIL_RasterFilter.h.
|
inlinevirtual |
Initiaze the filter with user specified options. This method is only called once. If the filter isn't valid, the myErrorString
member should be set to a meaningful error and the function should return false.
Aside from setting any specific options, this is also the time you should build myAuxPlaneNames. This lets the caller know which extra AOVs you can read from. Not all of them may exist, but this lets the caller know which planes you can look at.
Reimplemented in TIL_NullFilter.
Definition at line 110 of file TIL_RasterFilter.h.
|
protected |
Definition at line 147 of file TIL_RasterFilter.h.
|
protected |
Definition at line 148 of file TIL_RasterFilter.h.
|
protected |
Definition at line 149 of file TIL_RasterFilter.h.