-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbimageprocess.h
38 lines (30 loc) · 1.18 KB
/
bimageprocess.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef BIMAGEPROCESS_H
#define BIMAGEPROCESS_H
#include "bimage.h"
#include <functional>
#include "tbb/parallel_for.h"
#include "tbb/parallel_reduce.h"
#include "tbb/blocked_range.h"
#include "tbb/tick_count.h"
struct ImageRow {
ImageRow(RGBA * rowData_, int width_) : rowData(rowData_), width(width_) { }
RGBA * rowData;
int width;
};
class BImageProcess
{
public:
typedef std::function<RGBA (const RGBA &)> Procesor;
typedef std::function<void (int, RGBA &)> EachProcesor;
typedef std::function<void (int, ImageRow &)> RowProcesor;
typedef std::function<void (int, RGBA &)> ColProcesor;
BImageProcess();
static void ForEach(Image *source, Image * destiny, Procesor procesor);
static void ForEachParallel(Image *source, Image * destiny, Procesor procesor);
static void ForEach(Image * source, EachProcesor eachProcesor);
static void ForEachParallel(Image * source, EachProcesor eachProcesor);
static void ForEachInRow(ImageRow & imageRow, ColProcesor colProcesor);
static void ForEachRowSerial(Image * destiny, RowProcesor rowProcesor);
static void ForEachRowParallel(Image * destiny, RowProcesor rowProcesor);
};
#endif // BIMAGEPROCESS_H