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

Storage for an image sub-block (a.k.a render bucket) More...

#include <mitsuba/render/imageblock.h>

+ Inheritance diagram for mitsuba::ImageBlock:

Public Member Functions

 ImageBlock (Bitmap::EPixelFormat fmt, const Vector2i &size, const ReconstructionFilter *filter=NULL, int channels=-1, bool warn=true)
 
void setOffset (const Point2i &offset)
 Set the current block offset. More...
 
const Point2igetOffset () const
 Return the current block offset. More...
 
void setSize (const Vector2i &size)
 Set the current block size. More...
 
const Vector2igetSize () const
 Return the current block size. More...
 
int getWidth () const
 Return the bitmap's width in pixels. More...
 
int getHeight () const
 Return the bitmap's height in pixels. More...
 
bool getWarn () const
 Warn when writing bad sample values? More...
 
void setWarn (bool warn)
 Warn when writing bad sample values? More...
 
int getBorderSize () const
 Return the border region used by the reconstruction filter. More...
 
int getChannelCount () const
 Return the number of channels stored by the image block. More...
 
Bitmap::EPixelFormat getPixelFormat () const
 Return the underlying pixel format. More...
 
BitmapgetBitmap ()
 Return a pointer to the underlying bitmap representation. More...
 
const BitmapgetBitmap () const
 Return a pointer to the underlying bitmap representation (const version) More...
 
void clear ()
 Clear everything to zero. More...
 
void put (const ImageBlock *block)
 Accumulate another image block into this one. More...
 
FINLINE bool put (const Point2 &pos, const Spectrum &spec, Float alpha)
 Store a single sample inside the image block. More...
 
FINLINE bool put (const Point2 &_pos, const Float *value)
 Store a single sample inside the block. More...
 
ref< ImageBlockclone () const
 Create a clone of the entire image block. More...
 
void copyTo (ImageBlock *copy) const
 Copy the contents of this image block to another one with the same configuration. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
Implementation of the WorkResult interface
void load (Stream *stream)
 Fill the work result with content acquired from a binary data stream. More...
 
void save (Stream *stream) const
 Serialize a work result to a binary data stream. More...
 
std::string toString () const
 Return a string representation. 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...
 

Static Public Attributes

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

Protected Member Functions

virtual ~ImageBlock ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::WorkResult
virtual ~WorkResult ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Protected Attributes

ref< Bitmapm_bitmap
 
Point2i m_offset
 
Vector2i m_size
 
int m_borderSize
 
const ReconstructionFilterm_filter
 
Floatm_weightsX
 
Floatm_weightsY
 
bool m_warn
 

Additional Inherited Members

- 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

Storage for an image sub-block (a.k.a render bucket)

This class is used by image-based parallel processes and encapsulates computed rectangular regions of an image. This allows for easy and efficient distributed rendering of large images. Image blocks usually also include a border region storing contribuctions that are slightly outside of the block, which is required to support image reconstruction filters.

Constructor & Destructor Documentation

mitsuba::ImageBlock::ImageBlock ( Bitmap::EPixelFormat  fmt,
const Vector2i size,
const ReconstructionFilter filter = NULL,
int  channels = -1,
bool  warn = true 
)

Construct a new image block of the requested properties

Parameters
fmtSpecifies the pixel format – see Bitmap::EPixelFormat for a list of possibilities
sizeSpecifies the block dimensions (not accounting for additional border pixels required to support image reconstruction filters)
channelsSpecifies the number of output channels. This is only necessary when Bitmap::EMultiChannel is chosen as the pixel format
warnWarn when writing bad sample values?
virtual mitsuba::ImageBlock::~ImageBlock ( )
protectedvirtual

Virtual destructor.

Member Function Documentation

void mitsuba::ImageBlock::clear ( )
inline

Clear everything to zero.

ref<ImageBlock> mitsuba::ImageBlock::clone ( ) const
inline

Create a clone of the entire image block.

void mitsuba::ImageBlock::copyTo ( ImageBlock copy) const
inline

Copy the contents of this image block to another one with the same configuration.

Bitmap* mitsuba::ImageBlock::getBitmap ( )
inline

Return a pointer to the underlying bitmap representation.

const Bitmap* mitsuba::ImageBlock::getBitmap ( ) const
inline

Return a pointer to the underlying bitmap representation (const version)

int mitsuba::ImageBlock::getBorderSize ( ) const
inline

Return the border region used by the reconstruction filter.

int mitsuba::ImageBlock::getChannelCount ( ) const
inline

Return the number of channels stored by the image block.

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

Retrieve this object's class.

Reimplemented from mitsuba::WorkResult.

int mitsuba::ImageBlock::getHeight ( ) const
inline

Return the bitmap's height in pixels.

const Point2i& mitsuba::ImageBlock::getOffset ( ) const
inline

Return the current block offset.

Bitmap::EPixelFormat mitsuba::ImageBlock::getPixelFormat ( ) const
inline

Return the underlying pixel format.

const Vector2i& mitsuba::ImageBlock::getSize ( ) const
inline

Return the current block size.

bool mitsuba::ImageBlock::getWarn ( ) const
inline

Warn when writing bad sample values?

int mitsuba::ImageBlock::getWidth ( ) const
inline

Return the bitmap's width in pixels.

void mitsuba::ImageBlock::load ( Stream stream)
virtual

Fill the work result with content acquired from a binary data stream.

Implements mitsuba::WorkResult.

void mitsuba::ImageBlock::put ( const ImageBlock block)
inline

Accumulate another image block into this one.

FINLINE bool mitsuba::ImageBlock::put ( const Point2 pos,
const Spectrum spec,
Float  alpha 
)
inline

Store a single sample inside the image block.

This variant assumes that the image block stores spectrum, alpha, and reconstruction filter weight values.

Parameters
posDenotes the sample position in fractional pixel coordinates
specSpectrum value assocated with the sample
alphaAlpha value assocated with the sample
Returns
false if one of the sample values was invalid, e.g. NaN or negative. A warning is also printed in this case
FINLINE bool mitsuba::ImageBlock::put ( const Point2 _pos,
const Float value 
)
inline

Store a single sample inside the block.

Parameters
_posDenotes the sample position in fractional pixel coordinates
valuePointer to an array containing each channel of the sample values. The array must match the length given by getChannelCount()
Returns
false if one of the sample values was invalid, e.g. NaN or negative. A warning is also printed in this case
void mitsuba::ImageBlock::save ( Stream stream) const
virtual

Serialize a work result to a binary data stream.

Implements mitsuba::WorkResult.

void mitsuba::ImageBlock::setOffset ( const Point2i offset)
inline

Set the current block offset.

void mitsuba::ImageBlock::setSize ( const Vector2i size)
inline

Set the current block size.

void mitsuba::ImageBlock::setWarn ( bool  warn)
inline

Warn when writing bad sample values?

std::string mitsuba::ImageBlock::toString ( ) const
virtual

Return a string representation.

Implements mitsuba::WorkResult.

Member Data Documentation

ref<Bitmap> mitsuba::ImageBlock::m_bitmap
protected
int mitsuba::ImageBlock::m_borderSize
protected
const ReconstructionFilter* mitsuba::ImageBlock::m_filter
protected
Point2i mitsuba::ImageBlock::m_offset
protected
Vector2i mitsuba::ImageBlock::m_size
protected
Class* mitsuba::ImageBlock::m_theClass
static
bool mitsuba::ImageBlock::m_warn
protected
Float* mitsuba::ImageBlock::m_weightsX
protected
Float * mitsuba::ImageBlock::m_weightsY
protected

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