20 #ifndef OPENMP_VIGRA_H_INCLUDED_
21 #define OPENMP_VIGRA_H_INCLUDED_
23 #include <vigra/diff2d.hxx>
24 #include <vigra/initimage.hxx>
25 #include <vigra/inspectimage.hxx>
26 #include <vigra/transformimage.hxx>
27 #include <vigra/combineimages.hxx>
28 #include <vigra/convolution.hxx>
39 template <
class SrcImageIterator1,
class SrcAccessor1,
40 class SrcImageIterator2,
class SrcAccessor2,
41 class DestImageIterator,
class DestAccessor,
44 combineTwoImages(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc,
45 SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc,
46 DestImageIterator dest_upperleft, DestAccessor dest_acc,
47 const Functor& functor)
51 const vigra::Size2D size(src1_lowerright - src1_upperleft);
54 #pragma omp for schedule(guided) nowait
55 for (
int y = 0; y < size.y; ++y)
57 const vigra::Diff2D begin(0, y);
58 const vigra::Diff2D end(size.x, y + 1);
61 src2_upperleft + begin, src2_acc,
62 dest_upperleft + begin, dest_acc,
69 template <
class SrcImageIterator1,
class SrcAccessor1,
70 class SrcImageIterator2,
class SrcAccessor2,
71 class MaskImageIterator,
class MaskAccessor,
72 class DestImageIterator,
class DestAccessor,
75 combineTwoImagesIf(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc,
76 SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc,
77 MaskImageIterator mask_upperleft, MaskAccessor mask_acc,
78 DestImageIterator dest_upperleft, DestAccessor dest_acc,
79 const Functor& functor)
83 const vigra::Size2D size(src1_lowerright - src1_upperleft);
86 #pragma omp for schedule(guided) nowait
87 for (
int y = 0; y < size.y; ++y)
89 const vigra::Diff2D begin(0, y);
90 const vigra::Diff2D end(size.x, y + 1);
93 src2_upperleft + begin, src2_acc,
94 mask_upperleft + begin, mask_acc,
95 dest_upperleft + begin, dest_acc,
102 template <
class SrcImageIterator1,
class SrcAccessor1,
103 class SrcImageIterator2,
class SrcAccessor2,
104 class SrcImageIterator3,
class SrcAccessor3,
105 class DestImageIterator,
class DestAccessor,
108 combineThreeImages(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc,
109 SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc,
110 SrcImageIterator3 src3_upperleft, SrcAccessor3 src3_acc,
111 DestImageIterator dest_upperleft, DestAccessor dest_acc,
112 const Functor& functor)
116 const vigra::Size2D size(src1_lowerright - src1_upperleft);
119 #pragma omp for schedule(guided) nowait
120 for (
int y = 0; y < size.y; ++y)
122 const vigra::Diff2D begin(0, y);
123 const vigra::Diff2D end(size.x, y + 1);
126 src2_upperleft + begin, src2_acc,
127 src3_upperleft + begin, src3_acc,
128 dest_upperleft + begin, dest_acc,
135 template <
class SrcImageIterator,
class SrcAccessor,
136 class DestImageIterator,
class DestAccessor>
138 copyImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc,
139 DestImageIterator dest_upperleft, DestAccessor dest_acc)
143 const vigra::Size2D size(src_lowerright - src_upperleft);
145 #pragma omp for schedule(guided) nowait
146 for (
int y = 0; y < size.y; ++y)
148 const vigra::Diff2D begin(0, y);
149 const vigra::Diff2D end(size.x, y + 1);
152 dest_upperleft + begin, dest_acc);
158 template <
class SrcImageIterator,
class SrcAccessor,
159 class MaskImageIterator,
class MaskAccessor,
160 class DestImageIterator,
class DestAccessor>
162 copyImageIf(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc,
163 MaskImageIterator mask_upperleft, MaskAccessor mask_acc,
164 DestImageIterator dest_upperleft, DestAccessor dest_acc)
168 const vigra::Size2D size(src_lowerright - src_upperleft);
170 #pragma omp for schedule(guided) nowait
171 for (
int y = 0; y < size.y; ++y)
173 const vigra::Diff2D begin(0, y);
174 const vigra::Diff2D end(size.x, y + 1);
177 mask_upperleft + begin, mask_acc,
178 dest_upperleft + begin, dest_acc);
184 template <
class SrcImageIterator,
class SrcAccessor,
185 class DestImageIterator,
class DestAccessor,
188 transformImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc,
189 DestImageIterator dest_upperleft, DestAccessor dest_acc,
190 const Functor& functor)
194 const vigra::Size2D size(src_lowerright - src_upperleft);
197 #pragma omp for schedule(guided) nowait
198 for (
int y = 0; y < size.y; ++y)
200 const vigra::Diff2D begin(0, y);
201 const vigra::Diff2D end(size.x, y + 1);
204 dest_upperleft + begin, dest_acc,
211 template <
class SrcImageIterator,
class SrcAccessor,
212 class MaskImageIterator,
class MaskAccessor,
213 class DestImageIterator,
class DestAccessor,
216 transformImageIf(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc,
217 MaskImageIterator mask_upperleft, MaskAccessor mask_acc,
218 DestImageIterator dest_upperleft, DestAccessor dest_acc,
219 const Functor& functor)
223 const vigra::Size2D size(src_lowerright - src_upperleft);
226 #pragma omp for schedule(guided) nowait
227 for (
int y = 0; y < size.y; ++y)
229 const vigra::Diff2D begin(0, y);
230 const vigra::Diff2D end(size.x, y + 1);
233 mask_upperleft + begin, mask_acc,
234 dest_upperleft + begin, dest_acc,
244 template <
class SrcImageIterator1,
class SrcAccessor1,
245 class SrcImageIterator2,
class SrcAccessor2,
246 class DestImageIterator,
class DestAccessor,
250 SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc,
251 SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc,
252 DestImageIterator dest_upperleft, DestAccessor dest_acc,
256 src2_upperleft, src2_acc,
257 dest_upperleft, dest_acc,
262 template <
class SrcImageIterator1,
class SrcAccessor1,
263 class SrcImageIterator2,
class SrcAccessor2,
264 class MaskImageIterator,
class MaskAccessor,
265 class DestImageIterator,
class DestAccessor,
268 combineTwoImagesIf(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc,
269 SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc,
270 MaskImageIterator mask_upperleft, MaskAccessor mask_acc,
271 DestImageIterator dest_upperleft, DestAccessor dest_acc,
275 src2_upperleft, src2_acc,
276 mask_upperleft, mask_acc,
277 dest_upperleft, dest_acc,
282 template <
class SrcImageIterator1,
class SrcAccessor1,
283 class SrcImageIterator2,
class SrcAccessor2,
284 class SrcImageIterator3,
class SrcAccessor3,
285 class DestImageIterator,
class DestAccessor,
288 combineThreeImages(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc,
289 SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc,
290 SrcImageIterator3 src3_upperleft, SrcAccessor3 src3_acc,
291 DestImageIterator dest_upperleft, DestAccessor dest_acc,
295 src2_upperleft, src2_acc,
296 src3_upperleft, src3_acc,
297 dest_upperleft, dest_acc,
302 template <
class SrcImageIterator,
class SrcAccessor,
303 class DestImageIterator,
class DestAccessor>
305 copyImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc,
306 DestImageIterator dest_upperleft, DestAccessor dest_acc)
308 vigra::copyImage(src_upperleft, src_lowerright, src_acc, dest_upperleft, dest_acc);
312 template <
class SrcImageIterator,
class SrcAccessor,
313 class MaskImageIterator,
class MaskAccessor,
314 class DestImageIterator,
class DestAccessor>
316 copyImageIf(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc,
317 MaskImageIterator mask_upperleft, MaskAccessor mask_acc,
318 DestImageIterator dest_upperleft, DestAccessor dest_acc)
321 mask_upperleft, mask_acc,
322 dest_upperleft, dest_acc);
326 template <
class SrcImageIterator,
class SrcAccessor,
327 class DestImageIterator,
class DestAccessor,
330 transformImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc,
331 DestImageIterator dest_upperleft, DestAccessor dest_acc,
335 dest_upperleft, dest_acc,
340 template <
class SrcImageIterator,
class SrcAccessor,
341 class MaskImageIterator,
class MaskAccessor,
342 class DestImageIterator,
class DestAccessor,
345 transformImageIf(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc,
346 MaskImageIterator mask_upperleft, MaskAccessor mask_acc,
347 DestImageIterator dest_upperleft, DestAccessor dest_acc,
351 mask_upperleft, mask_acc,
352 dest_upperleft, dest_acc,
363 template <
class SrcImageIterator1,
class SrcAccessor1,
364 class SrcImageIterator2,
class SrcAccessor2,
365 class DestImageIterator,
class DestAccessor,
369 vigra::pair<SrcImageIterator2, SrcAccessor2> src2,
370 vigra::pair<DestImageIterator, DestAccessor> dest,
371 const Functor& functor)
374 src2.first, src2.second,
375 dest.first, dest.second,
380 template <
class SrcImageIterator1,
class SrcAccessor1,
381 class SrcImageIterator2,
class SrcAccessor2,
382 class MaskImageIterator,
class MaskAccessor,
383 class DestImageIterator,
class DestAccessor,
387 vigra::pair<SrcImageIterator2, SrcAccessor2> src2,
388 vigra::pair<MaskImageIterator, MaskAccessor> mask,
389 vigra::pair<DestImageIterator, DestAccessor> dest,
390 const Functor& functor)
393 src2.first, src2.second,
394 mask.first, mask.second,
395 dest.first, dest.second,
400 template <
class SrcImageIterator1,
class SrcAccessor1,
401 class SrcImageIterator2,
class SrcAccessor2,
402 class SrcImageIterator3,
class SrcAccessor3,
403 class DestImageIterator,
class DestAccessor,
407 vigra::pair<SrcImageIterator2, SrcAccessor2> src2,
408 vigra::pair<SrcImageIterator3, SrcAccessor3> src3,
409 vigra::pair<DestImageIterator, DestAccessor> dest,
410 const Functor& functor)
413 src2.first, src2.second,
414 src3.first, src3.second,
415 dest.first, dest.second,
420 template <
class SrcImageIterator,
class SrcAccessor,
421 class DestImageIterator,
class DestAccessor,
424 transformImage(vigra::triple<SrcImageIterator, SrcImageIterator, SrcAccessor> src,
425 vigra::pair<DestImageIterator, DestAccessor> dest,
426 const Functor& functor)
429 dest.first, dest.second,
434 template <
class SrcImageIterator,
class SrcAccessor,
435 class DestImageIterator,
class DestAccessor>
437 copyImage(vigra::triple<SrcImageIterator, SrcImageIterator, SrcAccessor> src,
438 vigra::pair<DestImageIterator, DestAccessor> dest)
441 dest.first, dest.second);
445 template <
class SrcImageIterator,
class SrcAccessor,
446 class MaskImageIterator,
class MaskAccessor,
447 class DestImageIterator,
class DestAccessor>
449 copyImageIf(vigra::triple<SrcImageIterator, SrcImageIterator, SrcAccessor> src,
450 vigra::pair<MaskImageIterator, MaskAccessor> mask,
451 vigra::pair<DestImageIterator, DestAccessor> dest)
454 mask.first, mask.second,
455 dest.first, dest.second);
459 template <
class SrcImageIterator,
class SrcAccessor,
460 class MaskImageIterator,
class MaskAccessor,
461 class DestImageIterator,
class DestAccessor,
465 vigra::pair<MaskImageIterator, MaskAccessor> mask,
466 vigra::pair<DestImageIterator, DestAccessor> dest,
467 const Functor& functor)
470 mask.first, mask.second,
471 dest.first, dest.second,
479 #endif // OPENMP_VIGRA_H_INCLUDED_
void transformImage(vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, vigra::Diff2D destUL, TRANSFORM &transform, PixelTransform &pixelTransform, bool warparound, Interpolator interpol, AppBase::ProgressDisplay *progress, bool singleThreaded=false)
Transform an image into the panorama.
void copyImageIf(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, MaskImageIterator mask_upperleft, MaskAccessor mask_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc)
void combineThreeImages(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, SrcImageIterator3 src3_upperleft, SrcAccessor3 src3_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor &func)
void combineTwoImages(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor &func)
void transformImageIf(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, MaskImageIterator mask_upperleft, MaskAccessor mask_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor &func)
void combineTwoImagesIf(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, MaskImageIterator mask_upperleft, MaskAccessor mask_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor &func)
void transformImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor &func)
void copyImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc)