Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::BlockedImageProcess Class Reference

#include <mitsuba/render/imageproc.h>

+ Inheritance diagram for mitsuba::BlockedImageProcess:

Public Member Functions

virtual const ClassgetClass () const
 Retrieve this object's class. More...
Implementation of the ParallelProcess interface
virtual EStatus generateWork (WorkUnit *unit, int worker)
 Generate a piece of work. More...
- Public Member Functions inherited from mitsuba::ParallelProcess
virtual void processResult (const WorkResult *result, bool cancelled)=0
 Called whenever a work unit has been completed. More...
virtual void handleCancellation ()
 Called when the parallel process is canceled by Scheduler::cancel(). More...
EStatus getReturnStatus () const
 Query the return status of a process after its execution has finished. More...
virtual ref< WorkProcessorcreateWorkProcessor () const =0
 Create an instance of the algorithm responsible for executing the work units of this parallel process. More...
virtual void bindResource (const std::string &name, int id)
 Bind a resource to this parallel process. More...
virtual bool isLocal () const
 Is this process strictly local? More...
ELogLevel getLogLevel () const
 Return the log level for events associated with this process. More...
const ResourceBindingsgetResourceBindings () const
 Return a list of all bound resources. More...
virtual std::vector< std::string > getRequiredPlugins ()
 Return a list of plugins required by this parallel process. More...
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
int getRefCount () const
 Return the current reference count. More...
void incRef () const
 Increase the reference count of the object by one. More...
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
virtual std::string toString () const
 Return a human-readable string representation of the object's contents. More...

Static Public Attributes

static Classm_theClass
- Static Public Attributes inherited from mitsuba::ParallelProcess
static Classm_theClass
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...

Protected Types

enum  EDirection { ERight = 0, EDown, ELeft, EUp }

Protected Member Functions

void init (const Point2i &offset, const Vector2i &size, uint32_t blockSize)
 BlockedImageProcess ()
 Protected constructor. More...
virtual ~BlockedImageProcess ()
 Virtual destructor. More...
- Protected Member Functions inherited from mitsuba::ParallelProcess
 ParallelProcess ()
 Protected constructor. More...
virtual ~ParallelProcess ()
 Virtual destructor. More...
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...

Protected Attributes

Point2i m_offset
Vector2i m_size
Vector2i m_numBlocks
Point2i m_curBlock
int m_direction
int m_numSteps
int m_stepsLeft
int m_numBlocksTotal
int m_numBlocksGenerated
int m_blockSize
- Protected Attributes inherited from mitsuba::ParallelProcess
ResourceBindings m_bindings
EStatus m_returnStatus
ELogLevel m_logLevel

Additional Inherited Members

- Public Types inherited from mitsuba::ParallelProcess
enum  EStatus { EUnknown, EPause, ESuccess, EFailure }
 Return codes used by generateWork() and getReturnStatus() More...
typedef std::map< std::string,
int > 
 Binding from local resource names to global resource IDs. More...
- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...

Detailed Description

Abstract parallel process, which performs a certain task (to be defined by the subclass) on the pixels of an image where work on adjacent pixels is independent. For preview purposes, a spiraling pattern of square pixel blocks is generated.

Member Enumeration Documentation


Constructor & Destructor Documentation

mitsuba::BlockedImageProcess::BlockedImageProcess ( )

Protected constructor.

virtual mitsuba::BlockedImageProcess::~BlockedImageProcess ( )

Virtual destructor.

Member Function Documentation

virtual EStatus mitsuba::BlockedImageProcess::generateWork ( WorkUnit unit,
int  worker 

Generate a piece of work.

Takes a pre-allocated WorkUnit instance of the appropriate sub-type and size (as specified by ParallelProcess::getWorkUnitName()) and fills it with the appropriate content. Returns ESuccess on success and EFailure or EPause when no more work is left – in that case, the work unit will be ignored and the process completed (EFailure) or temporarily paused (EPause). When EPause was used, resubmission via Scheduler::schedule() will be required once more work is available. In some cases, it is useful to distribute 'nearby' pieces of work to the same processor – the worker parameter can be used to implement this. This function should run as quickly as possible, since it will be executed while the scheduler mutex is held. A thrown exception will lead to the termination of the parallel process.

unitWork unit data structure to be filled
workerID of the worker executing this function

Implements mitsuba::ParallelProcess.

Reimplemented in mitsuba::BlockedRenderProcess.

virtual const Class* mitsuba::BlockedImageProcess::getClass ( ) const

Retrieve this object's class.

Reimplemented from mitsuba::ParallelProcess.

Reimplemented in mitsuba::BlockedRenderProcess.

void mitsuba::BlockedImageProcess::init ( const Point2i offset,
const Vector2i size,
uint32_t  blockSize 

Initialize the image process

offsetInteger offset of the image region to be processed
sizeSize of the image region to be processed
blockSizeSize of the generated square pixel blocks

Member Data Documentation

int mitsuba::BlockedImageProcess::m_blockSize
Point2i mitsuba::BlockedImageProcess::m_curBlock
int mitsuba::BlockedImageProcess::m_direction
Vector2i mitsuba::BlockedImageProcess::m_numBlocks
int mitsuba::BlockedImageProcess::m_numBlocksGenerated
int mitsuba::BlockedImageProcess::m_numBlocksTotal
int mitsuba::BlockedImageProcess::m_numSteps
Point2i mitsuba::BlockedImageProcess::m_offset
Vector2i mitsuba::BlockedImageProcess::m_size
int mitsuba::BlockedImageProcess::m_stepsLeft
Class* mitsuba::BlockedImageProcess::m_theClass

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