HDK
|
#include <TIL_RasterFilter.h>
Classes | |
struct | Factory |
The factory to define a filter. More... | |
struct | LayerData |
struct | RasterData |
class | VulkanResolver |
Public Types | |
enum | AOVType { AT_NONE = 0, AT_BEAUTY, AT_SPECULAR, AT_REFLECT, AT_REFRACT, AT_DIFFUSE } |
enum | RasterDataTypes { RDT_PXL_RASTER, RDT_VK_BUFFER, RDT_RAW_CUDA } |
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) |
void | setAuxPlane (const UT_StringHolder &planename, const RasterData &aux) |
virtual bool | apply (PXL_Raster *raster)=0 |
Returns false if fail. More... | |
virtual bool | apply (UT_Array< LayerData > &layersdata, bool upscale, bool firstframe)=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 |
virtual bool | matchesDevice (uint8(&uuid)[16]) const |
TIL_RasterFilter () | |
virtual | ~TIL_RasterFilter () |
Static Public Member Functions | |
static void | setVulkanResolver (UT_UniquePtr< VulkanResolver >) |
static VulkanResolver * | getVulkanResolver () |
static AOVType | stringToAOVType (const UT_StringHolder &type) |
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< RasterData > | 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 56 of file TIL_RasterFilter.h.
Definition at line 59 of file TIL_RasterFilter.h.
Enumerator | |
---|---|
AT_NONE | |
AT_BEAUTY | |
AT_SPECULAR | |
AT_REFLECT | |
AT_REFRACT | |
AT_DIFFUSE |
Definition at line 88 of file TIL_RasterFilter.h.
Enumerator | |
---|---|
RDT_PXL_RASTER | |
RDT_VK_BUFFER | |
RDT_RAW_CUDA |
Definition at line 99 of file TIL_RasterFilter.h.
|
inline |
Constructor/Destructor
Definition at line 74 of file TIL_RasterFilter.h.
|
inlinevirtual |
Constructor/Destructor
Definition at line 75 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 |
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 213 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 218 of file TIL_RasterFilter.h.
Get a list of all the filters.
|
static |
|
inlinevirtual |
If the filter can run in a few milliseconds, you can try returning true.
Reimplemented in TIL_NullFilter.
Definition at line 223 of file TIL_RasterFilter.h.
|
inlinevirtual |
Returns true if this filter can use device pointers from the device represented by uuid
a RasterData struct
Definition at line 227 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 207 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 181 of file TIL_RasterFilter.h.
|
inline |
Set up an auxiliary plane using RasterData. If the RasterData provides a Cuda or Vulkan device handle, it will be used directly, avoiding internal device memory allocation. Otherwise, the filter may allocate its own buffer. The caller looks at the myAuxPlaneNames
list to determine which planes are required.
Definition at line 193 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 174 of file TIL_RasterFilter.h.
|
static |
|
static |
|
protected |
Definition at line 230 of file TIL_RasterFilter.h.
|
protected |
Definition at line 231 of file TIL_RasterFilter.h.
|
protected |
Definition at line 232 of file TIL_RasterFilter.h.