Nori

ImageBlock Class Reference

Weighted pixel storage for a rectangular subregion of an image. More...

#include <block.h>

List of all members.

Public Member Functions

 ImageBlock (const Vector2i &size, const ReconstructionFilter *filter)
 ~ImageBlock ()
 Release all memory.
void setOffset (const Point2i &offset)
 Configure the offset of the block within the main image.
const Point2igetOffset () const
 Return the offset of the block within the main image.
void setSize (const Point2i &size)
 Configure the size of the block within the main image.
const Vector2igetSize () const
 Return the size of the block within the main image.
int getBorderSize () const
 Return the border size in pixels.
BitmaptoBitmap () const
 Turn the block into a proper bitmap.
void clear ()
 Clear all contents.
void put (const Point2f &pos, const Color3f &value)
 Record a sample with the given position and radiance value.
void put (ImageBlock &b)
 Merge another image block into this one.
void lock () const
 Lock the image block (using an internal mutex)
void unlock () const
 Unlock the image block.
QString toString () const
 Return a human-readable string summary.

Protected Attributes

Point2i m_offset
Vector2i m_size
int m_borderSize
float * m_filter
float m_filterRadius
float * m_weightsX
float * m_weightsY
float m_lookupFactor
QMutex m_mutex

Detailed Description

Weighted pixel storage for a rectangular subregion of an image.

This class implements storage for a rectangular subregion of a larger image that is being rendered. For each pixel, it records color values along with a weight that specifies the accumulated influence of nearby samples on the pixel (according to the used reconstruction filter).

When rendering with filters, the samples in a rectangular region will generally also contribute to pixels just outside of this region. For that reason, this class also stores information about a small border region around the rectangle, whose size depends on the properties of the reconstruction filter.

Definition at line 50 of file block.h.


Constructor & Destructor Documentation

ImageBlock::ImageBlock ( const Vector2i size,
const ReconstructionFilter filter 
)

Create a new image block of the specified maximum size

Parameters:
sizeDesired maximum size of the block
filterSamples will be convolved with the image reconstruction filter provided here.
ImageBlock::~ImageBlock ( )

Release all memory.


Member Function Documentation

void ImageBlock::clear ( ) [inline]

Clear all contents.

Definition at line 89 of file block.h.

int ImageBlock::getBorderSize ( ) const [inline]

Return the border size in pixels.

Definition at line 78 of file block.h.

const Point2i& ImageBlock::getOffset ( ) const [inline]

Return the offset of the block within the main image.

Definition at line 69 of file block.h.

const Vector2i& ImageBlock::getSize ( ) const [inline]

Return the size of the block within the main image.

Definition at line 75 of file block.h.

void ImageBlock::lock ( ) const [inline]

Lock the image block (using an internal mutex)

Definition at line 103 of file block.h.

void ImageBlock::put ( ImageBlock b)

Merge another image block into this one.

During the merge operation, this function locks the destination block using a mutex.

void ImageBlock::put ( const Point2f pos,
const Color3f value 
)

Record a sample with the given position and radiance value.

void ImageBlock::setOffset ( const Point2i offset) [inline]

Configure the offset of the block within the main image.

Definition at line 66 of file block.h.

void ImageBlock::setSize ( const Point2i size) [inline]

Configure the size of the block within the main image.

Definition at line 72 of file block.h.

Bitmap* ImageBlock::toBitmap ( ) const

Turn the block into a proper bitmap.

This entails normalizing all pixels and discarding the border region.

QString ImageBlock::toString ( ) const

Return a human-readable string summary.

void ImageBlock::unlock ( ) const [inline]

Unlock the image block.

Definition at line 106 of file block.h.


Member Data Documentation

int ImageBlock::m_borderSize [protected]

Definition at line 113 of file block.h.

float* ImageBlock::m_filter [protected]

Definition at line 114 of file block.h.

float ImageBlock::m_filterRadius [protected]

Definition at line 114 of file block.h.

float ImageBlock::m_lookupFactor [protected]

Definition at line 116 of file block.h.

QMutex ImageBlock::m_mutex [mutable, protected]

Definition at line 117 of file block.h.

Definition at line 111 of file block.h.

Definition at line 112 of file block.h.

float* ImageBlock::m_weightsX [protected]

Definition at line 115 of file block.h.

float * ImageBlock::m_weightsY [protected]

Definition at line 115 of file block.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines