Spiraling block generator. More...
#include <block.h>
Public Member Functions | |
BlockGenerator (const Vector2i &size, int blockSize) | |
Create a block generator with. More... | |
bool | next (ImageBlock &block) |
Return the next block to be rendered. More... | |
void | reset () |
Reset to the first block. More... | |
int | getBlockCount () const |
Return the total number of blocks. | |
Protected Types | |
enum | EDirection { ERight = 0 , EDown , ELeft , EUp } |
Protected Attributes | |
Point2i | m_block |
Vector2i | m_numBlocks |
Vector2i | m_size |
int | m_blockSize |
int | m_numSteps |
int | m_blocksLeft |
int | m_stepsLeft |
int | m_direction |
tbb::mutex | m_mutex |
Spiraling block generator.
This class can be used to chop up an image into many small rectangular blocks suitable for parallel rendering. The blocks are ordered in spiraling pattern so that the center is rendered first.
BlockGenerator::BlockGenerator | ( | const Vector2i & | size, |
int | blockSize | ||
) |
bool BlockGenerator::next | ( | ImageBlock & | block | ) |
void BlockGenerator::reset | ( | ) |