HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BRAY_ImageFilter Class Referenceabstract

#include <BRAY_ImageFilter.h>

+ Inheritance diagram for BRAY_ImageFilter:

Classes

class  Factory
 

Public Types

using FactoryPtr = UT_UniquePtr< Factory >
 

Public Member Functions

 BRAY_ImageFilter (const UT_Options *o)
 
 ~BRAY_ImageFilter () override
 
virtual bool isInteractive () const =0
 
virtual bool isPerBucket () const
 
virtual bool processImage (const UT_Array< BRAY_Raster * > &write, const UT_Array< const BRAY_Raster * > &read)=0
 
virtual bool processBucket (const UT_Array< BRAY_Raster * > &write, const UT_Array< const BRAY_Raster * > &read, const UT_DimRect &bucket)
 
virtual BRAY_PixelOraclePtr pixelOracle ()
 
virtual bool update (const UT_Options &options)
 
- Public Member Functions inherited from BRAY_FilterBase
 BRAY_FilterBase (const UT_Options *o)
 
virtual ~BRAY_FilterBase ()
 
virtual const char * className () const =0
 Return an identifier for this plugin. More...
 
void initialize (BRAY_FilterInit &init, const UT_StringArray &all_aovs)
 
SYS_HashType optionsHash () const
 Hash of the options passed to the constructor. More...
 
virtual bool getAOVs (BRAY_FilterInit &init, const UT_StringArray &available, UT_StringArray &write, UT_StringArray &read)=0
 
virtual const UT_StringHoldererrorMessage () const
 
UT_StringHolder makeError (const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
 Convenience method to add an error using printf style formatting. More...
 
const UT_StringArraywritePlanes () const
 
const UT_StringArrayreadPlanes () const
 

Static Public Member Functions

static void listFactories (UT_StringArray &result)
 
static void registerPlugin (const UT_StringHolder &name, FactoryPtr factory)
 
static UT_UniquePtr
< BRAY_ImageFilter
instancePlugin (const UT_StringRef &style, const UT_Options *options=nullptr)
 
static void releasePlugin (UT_UniquePtr< BRAY_ImageFilter > p)
 
static void freePluginCache ()
 

Protected Member Functions

int addAOV (BRAY_FilterInit &init, const UT_StringHolder &name, const UT_StringHolder &var, int tuple_size, const BRAY::OptionSet &options)
 
BRAY::OptionSet planeProperties (BRAY_FilterInit &init) const
 Create an option set before adding creating an extra AOV. More...
 

Detailed Description

Image filter plugins are run after pixel filtering, but before the rasters are written to the display device.

Definition at line 30 of file BRAY_ImageFilter.h.

Member Typedef Documentation

Constructor & Destructor Documentation

BRAY_ImageFilter::BRAY_ImageFilter ( const UT_Options o)
inline

Definition at line 58 of file BRAY_ImageFilter.h.

BRAY_ImageFilter::~BRAY_ImageFilter ( )
override

Member Function Documentation

int BRAY_ImageFilter::addAOV ( BRAY_FilterInit &  init,
const UT_StringHolder name,
const UT_StringHolder var,
int  tuple_size,
const BRAY::OptionSet options 
)
protected

If the filter needs an additional AOV, you can call this method during getAOVs(). The function returns the index of the new AOV (or -1 on failure). If there are errors, the messages will be printed out to UT_ErrorLog.

If options are required, they can be initialized by planeProperties() Passing in an empty OptionSet is legal.

static void BRAY_ImageFilter::freePluginCache ( )
static

Access to factory

static UT_UniquePtr<BRAY_ImageFilter> BRAY_ImageFilter::instancePlugin ( const UT_StringRef style,
const UT_Options options = nullptr 
)
static

Access to factory

virtual bool BRAY_ImageFilter::isInteractive ( ) const
pure virtual

Return whether the filter can be run interactively (for intermediate IPR updates for example). If this method returns false, when rendering interactively, the filter will only be run when the rendering has completed. If the method returns true, the filter may be run 100s or 1000s of times during an interactive render.

When rendering non-interactively, image filters are run at the end of the render.

virtual bool BRAY_ImageFilter::isPerBucket ( ) const
inlinevirtual

If the filter does not need to read or write to neighbouring pixels, then allow it to run per-bucket. When this is true, processBucket() is invoked instead of processImage(), and it is invoked each time a bucket is finished (by its own worker thread).

Definition at line 87 of file BRAY_ImageFilter.h.

static void BRAY_ImageFilter::listFactories ( UT_StringArray result)
static

Access to factory

virtual BRAY_PixelOraclePtr BRAY_ImageFilter::pixelOracle ( )
inlinevirtual

An image filter can, optionally, provide a pixel oracle to help steer rendering. The filter should provide an option to the user to disable creation of this oracle. It should also be able to run without the oracle. The default method returns a nullptr.

This method is called after initialize() is called on the image filter.

Definition at line 114 of file BRAY_ImageFilter.h.

BRAY::OptionSet BRAY_ImageFilter::planeProperties ( BRAY_FilterInit &  init) const
protected

Create an option set before adding creating an extra AOV.

virtual bool BRAY_ImageFilter::processBucket ( const UT_Array< BRAY_Raster * > &  write,
const UT_Array< const BRAY_Raster * > &  read,
const UT_DimRect bucket 
)
inlinevirtual

Process the rasters (per-bucket version). Note that per-bucket image filters are processed before whole-image filters.

Definition at line 102 of file BRAY_ImageFilter.h.

virtual bool BRAY_ImageFilter::processImage ( const UT_Array< BRAY_Raster * > &  write,
const UT_Array< const BRAY_Raster * > &  read 
)
pure virtual

Process the rasters. The plugin should write to the write rasters passed in, using the read rasters as source data. The order of the rasters in the arrays matches the order in writePlanes() and readPlanes(). So, it follows the size of the arrays should match the size of the writePlanes() and readPlanes.

This order is immutable after initialization is called.

static void BRAY_ImageFilter::registerPlugin ( const UT_StringHolder name,
FactoryPtr  factory 
)
static

Access to factory

static void BRAY_ImageFilter::releasePlugin ( UT_UniquePtr< BRAY_ImageFilter p)
static

Access to factory

virtual bool BRAY_ImageFilter::update ( const UT_Options options)
inlinevirtual

Updates the image filter for the given options. If supported an image filter can update itself by calling update method with new parameters. This avoids the need to recreate the filter everytime an option changes.

Returns true on success or false if fails to update.

Definition at line 123 of file BRAY_ImageFilter.h.


The documentation for this class was generated from the following file: