23 #if !defined(__NORI_PARALLEL_H)
24 #define __NORI_PARALLEL_H
26 #include <nori/color.h>
27 #include <nori/vector.h>
28 #include <tbb/mutex.h>
30 #define NORI_BLOCK_SIZE 32
48 class ImageBlock :
public Eigen::Array<Color4f, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> {
80 inline uint32_t getBlockId()
const {
return m_blockId; }
81 void setBlockId(uint32_t
id) { m_blockId = id;}
109 inline void lock()
const { m_mutex.lock(); }
112 inline void unlock()
const { m_mutex.unlock(); }
119 int m_borderSize = 0;
120 float *m_filter =
nullptr;
121 float m_filterRadius = 0;
122 float *m_weightsX =
nullptr;
123 float *m_weightsY =
nullptr;
124 float m_lookupFactor = 0;
126 mutable tbb::mutex m_mutex;
167 enum EDirection { ERight = 0, EDown, ELeft, EUp };
Stores a RGB high dynamic-range bitmap.
Spiraling block generator.
int getBlockCount() const
Return the total number of blocks.
BlockGenerator(const Vector2i &size, int blockSize)
Create a block generator with.
void reset()
Reset to the first block.
bool next(ImageBlock &block)
Return the next block to be rendered.
Weighted pixel storage for a rectangular subregion of an image.
void put(const Point2f &pos, const Color3f &value)
Record a sample with the given position and radiance value.
ImageBlock(const Vector2i &size, const ReconstructionFilter *filter)
void unlock() const
Unlock the image block.
const Vector2i & getSize() const
Return the size of the block within the main image.
void clear()
Clear all contents.
void fromBitmap(const Bitmap &bitmap)
Convert a bitmap into an image block.
int getBorderSize() const
Return the border size in pixels.
~ImageBlock()
Release all memory.
void lock() const
Lock the image block (using an internal mutex)
std::string toString() const
Return a human-readable string summary.
void setSize(const Point2i &size)
Configure the size of the block within the main image.
Bitmap * toBitmap() const
Turn the block into a proper bitmap.
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.
Generic radially symmetric image reconstruction filter.
Represents a linear RGB color value.
Represents a linear RGB color and a weight.