Nori

BlockGenerator Class Reference

Spiraling block generator. More...

#include <block.h>

List of all members.

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

Detailed Description

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.

Definition at line 128 of file block.h.


Member Enumeration Documentation

enum BlockGenerator::EDirection [protected]
Enumerator:
ERight 
EDown 
ELeft 
EUp 

Definition at line 148 of file block.h.


Constructor & Destructor Documentation

BlockGenerator::BlockGenerator ( const Vector2i size,
int  blockSize 
)

Create a block generator with.

Parameters:
sizeSize of the image that should be split into blocks
blockSizeMaximum size of the individual blocks

Member Function Documentation

bool BlockGenerator::next ( ImageBlock block)

Return the next block to be rendered.

This function is thread-safe

Returns:
false if there were no more blocks

Member Data Documentation

Definition at line 150 of file block.h.

int BlockGenerator::m_blockSize [protected]

Definition at line 153 of file block.h.

Definition at line 155 of file block.h.

int BlockGenerator::m_direction [protected]

Definition at line 157 of file block.h.

QMutex BlockGenerator::m_mutex [protected]

Definition at line 158 of file block.h.

Definition at line 151 of file block.h.

int BlockGenerator::m_numSteps [protected]

Definition at line 154 of file block.h.

Definition at line 152 of file block.h.

int BlockGenerator::m_stepsLeft [protected]

Definition at line 156 of file block.h.

QElapsedTimer BlockGenerator::m_timer [protected]

Definition at line 159 of file block.h.


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