Nori
|
Spiraling block generator. More...
#include <block.h>
Public Member Functions | |
BlockGenerator (const Vector2i &size, int blockSize) | |
Create a block generator with. | |
bool | next (ImageBlock &block) |
Return the next block to be rendered. | |
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 |
QMutex | m_mutex |
QElapsedTimer | m_timer |
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.
enum BlockGenerator::EDirection [protected] |
BlockGenerator::BlockGenerator | ( | const Vector2i & | size, |
int | blockSize | ||
) |
Create a block generator with.
size | Size of the image that should be split into blocks |
blockSize | Maximum size of the individual blocks |
bool BlockGenerator::next | ( | ImageBlock & | block | ) |
Return the next block to be rendered.
This function is thread-safe
false
if there were no more blocks Point2i BlockGenerator::m_block [protected] |
int BlockGenerator::m_blockSize [protected] |
int BlockGenerator::m_blocksLeft [protected] |
int BlockGenerator::m_direction [protected] |
QMutex BlockGenerator::m_mutex [protected] |
Vector2i BlockGenerator::m_numBlocks [protected] |
int BlockGenerator::m_numSteps [protected] |
Vector2i BlockGenerator::m_size [protected] |
int BlockGenerator::m_stepsLeft [protected] |
QElapsedTimer BlockGenerator::m_timer [protected] |