ParallelImage Class Reference

#include <parallelimage.h>

Detailed Description

This is a utility class for parallel processing of 2d data - usually images. The per pixel computations are distributed to several threads. This is intended for time consuming computations, it makes no sense to call this to clear all pixels of an image.


struct  ImageData
class  LineJob
class  PixelJob
class  TileJob

Static Public Member Functions

template<typename WORKER >
static void Process (Int width, Int height, Int tileSize, const WORKER &worker)

Static Private Member Functions

template<typename WORKER >
static MAXON_ATTRIBUTE_NO_INLINE void Fallback (Int width, Int height, const WORKER &worker)

Member Function Documentation

◆ Fallback()

static MAXON_ATTRIBUTE_NO_INLINE void Fallback ( Int  width,
Int  height,
const WORKER &  worker 

◆ Process()

static void Process ( Int  width,
Int  height,
Int  tileSize,
const WORKER &  worker 

Invokes the worker method for all pixels of the image (uses dynamic distribution).

[in]widthImage width in pixels.
[in]heightImage height in pixels.
[in]tileSizeInitial tile size to be used (a tile will be tileSize pixels wide and tileSize pixels high)
[in]workerLambda or object with operator (), will be called for every pixel (concurrently from different threads)
Template Parameters
WORKERA class containing an operator ()(Int x, Int y) used for the loop.