Weighted pixel storage for a rectangular subregion of an image. More...
#include <block.h>
Public Member Functions | |
ImageBlock (const Vector2i &size, const ReconstructionFilter *filter) | |
~ImageBlock () | |
Release all memory. | |
void | init (const Vector2i &size, const ReconstructionFilter *filter) |
void | setOffset (const Point2i &offset) |
Configure the offset of the block within the main image. | |
const Point2i & | getOffset () 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 Vector2i & | getSize () const |
Return the size of the block within the main image. | |
int | getBorderSize () const |
Return the border size in pixels. | |
uint32_t | getBlockId () const |
void | setBlockId (uint32_t id) |
Bitmap * | toBitmap () const |
Turn the block into a proper bitmap. More... | |
void | fromBitmap (const Bitmap &bitmap) |
Convert a bitmap into an image block. | |
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. More... | |
void | lock () const |
Lock the image block (using an internal mutex) | |
void | unlock () const |
Unlock the image block. | |
std::string | toString () const |
Return a human-readable string summary. | |
Protected Attributes | |
Point2i | m_offset |
Vector2i | m_size |
int | m_borderSize = 0 |
float * | m_filter = nullptr |
float | m_filterRadius = 0 |
float * | m_weightsX = nullptr |
float * | m_weightsY = nullptr |
float | m_lookupFactor = 0 |
uint32_t | m_blockId |
tbb::mutex | m_mutex |
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.
NORI_NAMESPACE_BEGIN ImageBlock::ImageBlock | ( | const Vector2i & | size, |
const ReconstructionFilter * | filter | ||
) |
void ImageBlock::put | ( | ImageBlock & | b | ) |
Bitmap * ImageBlock::toBitmap | ( | ) | const |