1 #ifndef OPERATIONHELPERRASTER_H
2 #define OPERATIONHELPERRASTER_H
6 typedef std::function<bool(const BoundingBox&)> BoxedAsyncFunc;
17 std::vector<BoundingBox> boxes;
19 int cores = OperationHelperRaster::subdivideTasks(ctx,outputRaster,bounds, boxes);
24 std::vector<std::future<bool>> futures(cores);
27 for(
int i =0; i < cores; ++i) {
28 futures[i] = std::async(std::launch::async, func, boxes[i]);
31 for(
int i =0; i < cores; ++i) {
32 res &= futures[i].get();
35 if ( res && outputRaster.
isValid()) {
36 if ( outputRaster->datadef().
domain()->valueType() & itNUMERIC) {
39 stats.calculate(iter, iter.
end());
40 NumericRange *rng =
new NumericRange(stats[NumericStatistics::pMIN], stats[NumericStatistics::pMAX], std::pow(10,-stats.significantDigits()));
41 outputRaster->datadef().
range(rng);
50 #endif // OPERATIONHELPER_H