Ocean
AdvancedFrameShrinker.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_CV_ADVANCED_ADVANCED_FRAME_SHRINKER_H
9 #define META_OCEAN_CV_ADVANCED_ADVANCED_FRAME_SHRINKER_H
10 
12 
13 #include "ocean/base/Frame.h"
14 #include "ocean/base/Worker.h"
15 
16 namespace Ocean
17 {
18 
19 namespace CV
20 {
21 
22 namespace Advanced
23 {
24 
25 /**
26  * This class implements an advanced frame shrinker e.g., not simply combining visual information from the finer layer but also taking a corresponding mask into account.
27  * @ingroup cvadvanced
28  */
29 class OCEAN_CV_ADVANCED_EXPORT AdvancedFrameShrinker
30 {
31  public:
32 
33  /**
34  * Bisects a given frame while taking a corresponding mask into account.
35  * This function combines color information of corresponding non-mask pixels only and normalizes the resulting color due to the number of valid pixels.<br>
36  * In the following, the downsampling scheme is depicted for a 1 channel 8 bit frame:
37  * <pre>
38  * 2x2 source pixels: with 2x2 source mask pixels: resulting 1x1 target source pixel: resulting 1x1 target mask pixel:
39  * | 0x80 0x50 | | 0xFF 0x00 | | (0x80 + 0x40) / 2 | | 0xFF |
40  * | 0x70 0x40 | | 0x00 0xFF |
41  * </pre>
42  * @param source The source frame that will be bisected, with a frame dimension with at least 2x2, must be valid
43  * @param target The target frame receiving the bisected information, must be valid
44  * @param sourceMask Binary source mask to be bisected with 0x00 as mask pixels and 0xFF as non-mask pixels, other values are not allowed
45  * @param targetMask The target binary mask receiving the bisected binary mask, a mask pixel will be set to 0xFF if at least one non-mask pixels exists at the corresponding location in the source mask, 0x00 otherwise
46  * @param handleFullMaskPixel True, to handle also frame pixels corresponding to four mask pixels
47  * @param targetMaskHasPixel Optional state to determine whether the target mask has at least one mask pixel
48  * @param worker Optional worker object to distribute the computation
49  * @return True, if succeeded
50  */
51  static bool divideByTwo(const Frame& source, Frame& target, const Frame& sourceMask, Frame& targetMask, const bool handleFullMaskPixel, bool* targetMaskHasPixel = nullptr, Worker* worker = nullptr);
52 
53  /**
54  * Bisects a given frame with 8 bit per frame channel while taking a corresponding mask into account.
55  * This function combines color information of corresponding non-mask pixels only and normalizes the resulting color due to the number of valid pixels.
56  * In the following, the downsampling scheme is depicted for a 1 channel 8 bit frame:
57  * <pre>
58  * 2x2 source pixels: with 2x2 source mask pixels: resulting 1x1 target source pixel: resulting 1x1 target mask pixel:
59  * | 0x80 0x50 | | 0xFF 0x00 | | (0x80 + 0x40) / 2 | | 0xFF |
60  * | 0x70 0x40 | | 0x00 0xFF |
61  * </pre>
62  * @param source The source frame that will be bisected, must be valid
63  * @param target The target frame receiving the bisected information, must be valid
64  * @param sourceMask Binary source mask to be bisected with 0x00 as mask pixels and 0xFF as non-mask pixels, other values are not allowed
65  * @param targetMask The target binary mask receiving the bisected binary mask, a mask pixel will be set to 0xFF if at least one non-mask pixels exists at the corresponding location in the source mask, 0x00 otherwise
66  * @param sourceWidth Width of the source frame in pixel, with range [2, infinity)
67  * @param sourceHeight Height of the source frame in pixel, with range [2, infinity)
68  * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
69  * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
70  * @param sourceMaskPaddingElements The number of padding elements at the end of each source mask row, in elements, with range [0, infinity)
71  * @param targetMaskPaddingElements The number of padding elements at the end of each target mask row, in elements, with range [0, infinity)
72  * @param handleFullMaskPixel True, to handle also frame pixels corresponding to four mask pixels, otherwise this pixel will be untouched
73  * @param targetMaskHasPixel Optional resulting state to determine whether the target mask has at least one mask pixel
74  * @param worker Optional worker object to distribute the computation
75  * @tparam tChannels Number of data channels of the frame, with range [1, infinity)
76  */
77  template <unsigned int tChannels>
78  static inline void divideByTwo8BitPerChannel(const uint8_t* source, uint8_t* target, const uint8_t* sourceMask, uint8_t* targetMask, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int sourceMaskPaddingElements, const unsigned int targetMaskPaddingElements, const bool handleFullMaskPixel, bool* targetMaskHasPixel = nullptr, Worker* worker = nullptr);
79 
80  private:
81 
82  /**
83  * Bisects a subset of a given frame with 8 bit per frame channel.
84  * @param source The source frame that will be bisected, must be valid
85  * @param target The target frame receiving the bisected information, must be valid
86  * @param sourceMask Binary source mask to be bisected with 0x00 as mask pixels and 0xFF as non-mask pixels, other values are not allowed
87  * @param targetMask The target binary mask receiving the bisected binary mask, a mask pixel will be set to 0xFF if at least one non-mask pixels exists at the corresponding location in the source mask, 0x00 otherwise
88  * @param sourceWidth Width of the source frame in pixel, with range [2, infinity)
89  * @param sourceHeight Height of the source frame in pixel, with range [2, infinity)
90  * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
91  * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
92  * @param sourceMaskPaddingElements The number of padding elements at the end of each source mask row, in elements, with range [0, infinity)
93  * @param targetMaskPaddingElements The number of padding elements at the end of each target mask row, in elements, with range [0, infinity)
94  * @param handleFullMaskPixel True, to handle also frame pixels corresponding to four mask pixels, otherwise this pixel will be untouched
95  * @param targetMaskHasPixel Optional resulting state to determine whether the target mask has at least one mask pixel
96  * @param firstTargetRow First target row to be handled, with range [0, sourceHeight / 2)
97  * @param numberTargetRows Number of target rows to be handled, with range [1, sourceHeight / 2]
98  * @tparam tChannels Number of data channels of the frame, with range [1, infinity)
99  */
100  template <unsigned int tChannels>
101  static void divideByTwo8BitPerChannelSubset(const uint8_t* source, uint8_t* target, const uint8_t* sourceMask, uint8_t* targetMask, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int sourceMaskPaddingElements, const unsigned int targetMaskPaddingElements, const bool handleFullMaskPixel, bool* targetMaskHasPixel, const unsigned int firstTargetRow, const unsigned int numberTargetRows);
102 };
103 
104 template <unsigned int tChannels>
105 inline void AdvancedFrameShrinker::divideByTwo8BitPerChannel(const uint8_t* source, uint8_t* target, const uint8_t* sourceMask, uint8_t* targetMask, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int sourceMaskPaddingElements, const unsigned int targetMaskPaddingElements, const bool handleFullMaskPixel, bool* targetMaskHasPixel, Worker* worker)
106 {
107  static_assert(tChannels != 0u, "Invalid channel number!");
108 
109  ocean_assert(source && target);
110  ocean_assert(sourceMask && targetMask);
111 
112  ocean_assert(sourceWidth >= 2u && sourceHeight >= 2u);
113 
114  const unsigned int targetHeight = sourceHeight / 2u;
115 
116  if (worker)
117  {
118  worker->executeFunction(Worker::Function::createStatic(&AdvancedFrameShrinker::divideByTwo8BitPerChannelSubset<tChannels>, source, target, sourceMask, targetMask, sourceWidth, sourceHeight, sourcePaddingElements, targetPaddingElements, sourceMaskPaddingElements, targetMaskPaddingElements, handleFullMaskPixel, targetMaskHasPixel, 0u, 0u), 0u, targetHeight);
119  }
120  else
121  {
122  divideByTwo8BitPerChannelSubset<tChannels>(source, target, sourceMask, targetMask, sourceWidth, sourceHeight, sourcePaddingElements, targetPaddingElements, sourceMaskPaddingElements, targetMaskPaddingElements, handleFullMaskPixel, targetMaskHasPixel, 0u, targetHeight);
123  }
124 }
125 
126 template <unsigned int tChannels>
127 void AdvancedFrameShrinker::divideByTwo8BitPerChannelSubset(const uint8_t* source, uint8_t* target, const uint8_t* sourceMask, uint8_t* targetMask, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int sourceMaskPaddingElements, const unsigned int targetMaskPaddingElements, const bool handleFullMaskPixel, bool* targetMaskHasPixel, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
128 {
129  static_assert(tChannels != 0u, "Invalid channel number!");
130 
131  ocean_assert(source != nullptr && target != nullptr);
132  ocean_assert(sourceMask != nullptr && targetMask != nullptr);
133 
134  ocean_assert(sourceWidth >= 2u && sourceHeight >= 2u);
135 
136  const unsigned int targetWidth = sourceWidth / 2u;
137  const unsigned int targetHeight = sourceHeight / 2u;
138 
139  const unsigned int sourceStrideElements = sourceWidth * tChannels + sourcePaddingElements;
140  const unsigned int targetStrideElements = targetWidth * tChannels + targetPaddingElements;
141 
142  const unsigned int sourceMaskStrideElements = sourceWidth + sourceMaskPaddingElements;
143  const unsigned int targetMaskStrideElements = targetWidth + targetMaskPaddingElements;
144 
145  ocean_assert(firstTargetRow + numberTargetRows <= targetHeight);
146 
147  const bool threeRightColumns = sourceWidth % 2u == 1u;
148  const bool threeBottomRows = sourceHeight % 2u == 1u && firstTargetRow + numberTargetRows == targetHeight;
149 
150  ocean_assert(numberTargetRows >= 1u);
151  const unsigned int twoTargetRows = threeBottomRows ? numberTargetRows - 1u : numberTargetRows;
152 
153  ocean_assert(targetWidth >= 1u);
154  const unsigned int twoTargetColumns = threeRightColumns ? targetWidth - 1u : targetWidth;
155 
156  const uint8_t* sourceTop = source + firstTargetRow * 2u * sourceStrideElements;
157  const uint8_t* sourceBottom = sourceTop + sourceStrideElements;
158 
159  const uint8_t* sourceMaskTop = sourceMask + firstTargetRow * 2u * sourceMaskStrideElements;
160  const uint8_t* sourceMaskBottom = sourceMaskTop + sourceMaskStrideElements;
161 
162  target += firstTargetRow * targetStrideElements;
163  targetMask += firstTargetRow * targetMaskStrideElements;
164 
165  for (unsigned int ty = firstTargetRow; ty < firstTargetRow + twoTargetRows; ++ty)
166  {
167  for (unsigned int tx = 0u; tx < twoTargetColumns; ++tx)
168  {
169  const uint32_t state = uint32_t(sourceMaskTop[0]) | uint32_t(sourceMaskTop[1]) << 8u
170  | uint32_t(sourceMaskBottom[0]) << 16u | uint32_t(sourceMaskBottom[1]) << 24u;
171 
172  switch (state)
173  {
174  // FF FF
175  // FF FF
176  case 0xFFFFFFFFu:
177  {
178  for (unsigned int n = 0u; n < tChannels; ++n)
179  {
180  *target++ = uint8_t((sourceTop[n] + sourceTop[tChannels + n] + sourceBottom[n] + sourceBottom[tChannels + n] + 2u) / 4u);
181  }
182  *targetMask++ = 0xFF;
183  break;
184  }
185 
186  // 00 FF
187  // FF FF
188  case 0xFFFFFF00u:
189  {
190  for (unsigned int n = 0u; n < tChannels; ++n)
191  {
192  *target++ = uint8_t((sourceTop[tChannels + n] + sourceBottom[n] + sourceBottom[tChannels + n] + 1u) / 3u);
193  }
194  *targetMask++ = 0xFF;
195  break;
196  }
197 
198  // FF 00
199  // FF FF
200  case 0xFFFF00FFu:
201  {
202  for (unsigned int n = 0u; n < tChannels; ++n)
203  {
204  *target++ = uint8_t((sourceTop[n] + sourceBottom[n] + sourceBottom[tChannels + n] + 1u) / 3u);
205  }
206  *targetMask++ = 0xFF;
207  break;
208  }
209 
210  // FF FF
211  // 00 FF
212  case 0xFF00FFFFu:
213  {
214  for (unsigned int n = 0u; n < tChannels; ++n)
215  {
216  *target++ = uint8_t((sourceTop[n] + sourceTop[tChannels + n] + sourceBottom[tChannels + n] + 1u) / 3u);
217  }
218  *targetMask++ = 0xFF;
219  break;
220  }
221 
222  // FF FF
223  // FF 00
224  case 0x00FFFFFFu:
225  {
226  for (unsigned int n = 0u; n < tChannels; ++n)
227  {
228  *target++ = uint8_t((sourceTop[n] + sourceTop[tChannels + n] + sourceBottom[n] + 1u) / 3u);
229  }
230  *targetMask++ = 0xFF;
231  break;
232  }
233 
234  // 00 00
235  // FF FF
236  case 0xFFFF0000u:
237  {
238  for (unsigned int n = 0u; n < tChannels; ++n)
239  {
240  *target++ = uint8_t((sourceBottom[n] + sourceBottom[tChannels + n] + 1u) / 2u);
241  }
242  *targetMask++ = 0xFF;
243  break;
244  }
245 
246  // FF 00
247  // FF 00
248  case 0x00FF00FFu:
249  {
250  for (unsigned int n = 0u; n < tChannels; ++n)
251  {
252  *target++ = uint8_t((sourceTop[n] + sourceBottom[n] + 1u) / 2u);
253  }
254  *targetMask++ = 0xFF;
255  break;
256  }
257 
258  // FF FF
259  // 00 00
260  case 0x0000FFFFu:
261  {
262  for (unsigned int n = 0u; n < tChannels; ++n)
263  {
264  *target++ = uint8_t((sourceTop[n] + sourceTop[tChannels + n] + 1u) / 2u);
265  }
266  *targetMask++ = 0xFF;
267  break;
268  }
269 
270  // 00 FF
271  // 00 FF
272  case 0xFF00FF00u:
273  {
274  for (unsigned int n = 0u; n < tChannels; ++n)
275  {
276  *target++ = uint8_t((sourceTop[tChannels + n] + sourceBottom[tChannels + n] + 1u) / 2u);
277  }
278  *targetMask++ = 0xFF;
279  break;
280  }
281 
282  // 00 FF
283  // FF 00
284  case 0x00FFFF00u:
285  {
286  for (unsigned int n = 0u; n < tChannels; ++n)
287  {
288  *target++ = uint8_t((sourceTop[tChannels + n] + sourceBottom[n] + 1u) / 2u);
289  }
290  *targetMask++ = 0xFF;
291  break;
292  }
293 
294  // FF 00
295  // 00 FF
296  case 0xFF0000FFu:
297  {
298  for (unsigned int n = 0u; n < tChannels; ++n)
299  {
300  *target++ = uint8_t((sourceTop[n] + sourceBottom[tChannels + n] + 1u) / 2u);
301  }
302  *targetMask++ = 0xFF;
303  break;
304  }
305 
306  // 00 00
307  // 00 FF
308  case 0xFF000000u:
309  {
310  for (unsigned int n = 0u; n < tChannels; ++n)
311  {
312  *target++ = sourceBottom[tChannels + n];
313  }
314  *targetMask++ = 0xFF;
315  break;
316  }
317 
318  // FF 00
319  // 00 00
320  case 0x000000FFu:
321  {
322  for (unsigned int n = 0u; n < tChannels; ++n)
323  {
324  *target++ = sourceTop[n];
325  }
326  *targetMask++ = 0xFF;
327  break;
328  }
329 
330  // 00 FF
331  // 00 00
332  case 0x0000FF00u:
333  {
334  for (unsigned int n = 0u; n < tChannels; ++n)
335  {
336  *target++ = sourceTop[tChannels + n];
337  }
338  *targetMask++ = 0xFF;
339  break;
340  }
341 
342  // 00 00
343  // FF 00
344  case 0x00FF0000u:
345  {
346  for (unsigned int n = 0u; n < tChannels; ++n)
347  {
348  *target++ = sourceBottom[n];
349  }
350  *targetMask++ = 0xFF;
351  break;
352  }
353 
354  // 00 00
355  // 00 00
356  case 0x00000000u:
357  {
358  *targetMask++ = 0x00;
359 
360  if (targetMaskHasPixel)
361  {
362  *targetMaskHasPixel = true;
363  }
364 
365  if (handleFullMaskPixel)
366  {
367  for (unsigned int n = 0u; n < tChannels; ++n)
368  {
369  target[n] = uint8_t((sourceTop[n] + sourceTop[tChannels + n] + sourceBottom[n] + sourceBottom[tChannels + n] + 2u) / 4u);
370  }
371  }
372 
373  target += tChannels;
374  break;
375  }
376 
377  default:
378  ocean_assert(false && "Invalid mask!");
379  target += tChannels;
380  ++targetMask;
381  }
382 
383  sourceTop += tChannels * 2u;
384  sourceBottom += tChannels * 2u;
385 
386  sourceMaskTop += 2;
387  sourceMaskBottom += 2;
388  }
389 
390  if (threeRightColumns)
391  {
392  unsigned int values[tChannels] = {0u};
393  unsigned int validPixels = 0u;
394 
395  for (unsigned int i = 0u; i < 3u; ++i)
396  {
397  if (sourceMaskTop[i] == 0xFF)
398  {
399  for (unsigned int n = 0u; n < tChannels; ++n)
400  {
401  values[n] += sourceTop[i * tChannels + n];
402  }
403 
404  ++validPixels;
405  }
406  }
407 
408  for (unsigned int i = 0u; i < 3u; ++i)
409  {
410  if (sourceMaskBottom[i] == 0xFF)
411  {
412  for (unsigned int n = 0u; n < tChannels; ++n)
413  {
414  values[n] += sourceBottom[i * tChannels + n];
415  }
416 
417  ++validPixels;
418  }
419  }
420 
421  if (validPixels != 0u)
422  {
423  *targetMask = 0xFF;
424 
425  const unsigned int validPixels_2 = validPixels / 2u;
426 
427  for (unsigned int n = 0u; n < tChannels; ++n)
428  {
429  target[n] = (uint8_t)((values[n] + validPixels_2) / validPixels);
430  }
431  }
432  else
433  {
434  *targetMask = 0x00;
435 
436  if (targetMaskHasPixel)
437  {
438  *targetMaskHasPixel = true;
439  }
440 
441  if (handleFullMaskPixel)
442  {
443  for (unsigned int n = 0u; n < tChannels; ++n)
444  {
445  target[n] = (sourceTop[n] + sourceTop[tChannels + n] + sourceTop[tChannels * 2u + n] + sourceBottom[n] + sourceBottom[tChannels + n] + sourceBottom[tChannels * 2u + n] + 3u) / 6u;
446  }
447  }
448  }
449 
450  sourceTop += tChannels * 3u;
451  sourceBottom += tChannels * 3u;
452  target += tChannels;
453 
454  sourceMaskTop += 3;
455  sourceMaskBottom += 3;
456 
457  ++targetMask;
458  }
459 
460  sourceTop = sourceBottom + sourcePaddingElements;
461  sourceBottom = sourceTop + sourceStrideElements;
462 
463  sourceMaskTop = sourceMaskBottom + sourceMaskPaddingElements;
464  sourceMaskBottom = sourceMaskTop + sourceMaskStrideElements;
465 
466  target += targetPaddingElements;
467  targetMask += targetMaskPaddingElements;
468  }
469 
470  if (threeBottomRows)
471  {
472  for (unsigned int tx = 0u; tx < targetWidth; ++tx)
473  {
474  unsigned int values[tChannels] = {0u};
475  unsigned int validPixels = 0u;
476 
477  const unsigned int patchWidth = tx < twoTargetColumns ? 2u : 3u;
478 
479  for (unsigned int i = 0u; i < patchWidth; ++i)
480  {
481  if (sourceMaskTop[i] == 0xFF)
482  {
483  for (unsigned int n = 0u; n < tChannels; ++n)
484  {
485  values[n] += sourceTop[i * tChannels + n];
486  }
487 
488  ++validPixels;
489  }
490  }
491 
492  for (unsigned int i = 0u; i < patchWidth; ++i)
493  {
494  if (sourceMaskBottom[i] == 0xFF)
495  {
496  for (unsigned int n = 0u; n < tChannels; ++n)
497  {
498  values[n] += sourceBottom[i * tChannels + n];
499  }
500 
501  ++validPixels;
502  }
503  }
504 
505  for (unsigned int i = 0u; i < patchWidth; ++i)
506  {
507  if (sourceMaskBottom[sourceMaskStrideElements + i] == 0xFF)
508  {
509  for (unsigned int n = 0u; n < tChannels; ++n)
510  {
511  values[n] += sourceBottom[sourceStrideElements + i * tChannels + n];
512  }
513 
514  ++validPixels;
515  }
516  }
517 
518  if (validPixels != 0u)
519  {
520  *targetMask = 0xFF;
521 
522  const unsigned int validPixels_2 = validPixels / 2u;
523 
524  for (unsigned int n = 0u; n < tChannels; ++n)
525  {
526  target[n] = (uint8_t)((values[n] + validPixels_2) / validPixels);
527  }
528  }
529  else
530  {
531  *targetMask = 0x00;
532 
533  if (targetMaskHasPixel)
534  {
535  *targetMaskHasPixel = true;
536  }
537 
538  if (handleFullMaskPixel)
539  {
540  for (unsigned int i = 0u; i < patchWidth; ++i)
541  {
542  for (unsigned int n = 0u; n < tChannels; ++n)
543  {
544  values[n] += sourceTop[i * tChannels + n];
545  values[n] += sourceBottom[i * tChannels + n];
546  values[n] += sourceBottom[sourceStrideElements + i * tChannels + n];
547  }
548  }
549 
550  validPixels = patchWidth * 3u;
551  const unsigned int validPixels_2 = validPixels / 2u;
552 
553  for (unsigned int n = 0u; n < tChannels; ++n)
554  {
555  target[n] = uint8_t((values[n] + validPixels_2) / validPixels);
556  }
557  }
558  }
559 
560  sourceTop += tChannels * 2u;
561  sourceBottom += tChannels * 2u;
562  target += tChannels;
563 
564  sourceMaskTop += 2;
565  sourceMaskBottom += 2;
566 
567  ++targetMask;
568  }
569  }
570 }
571 
572 }
573 
574 }
575 
576 }
577 
578 #endif // META_OCEAN_CV_ADVANCED_ADVANCED_FRAME_SHRINKER_H
This class implements an advanced frame shrinker e.g., not simply combining visual information from t...
Definition: AdvancedFrameShrinker.h:30
static void divideByTwo8BitPerChannel(const uint8_t *source, uint8_t *target, const uint8_t *sourceMask, uint8_t *targetMask, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int sourceMaskPaddingElements, const unsigned int targetMaskPaddingElements, const bool handleFullMaskPixel, bool *targetMaskHasPixel=nullptr, Worker *worker=nullptr)
Bisects a given frame with 8 bit per frame channel while taking a corresponding mask into account.
Definition: AdvancedFrameShrinker.h:105
static bool divideByTwo(const Frame &source, Frame &target, const Frame &sourceMask, Frame &targetMask, const bool handleFullMaskPixel, bool *targetMaskHasPixel=nullptr, Worker *worker=nullptr)
Bisects a given frame while taking a corresponding mask into account.
static void divideByTwo8BitPerChannelSubset(const uint8_t *source, uint8_t *target, const uint8_t *sourceMask, uint8_t *targetMask, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int sourceMaskPaddingElements, const unsigned int targetMaskPaddingElements, const bool handleFullMaskPixel, bool *targetMaskHasPixel, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
Bisects a subset of a given frame with 8 bit per frame channel.
Definition: AdvancedFrameShrinker.h:127
static Caller< void > createStatic(typename StaticFunctionPointerMaker< void, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass >::Type function)
Creates a new caller container for a static function with no function parameter.
Definition: Caller.h:2876
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
bool executeFunction(const Function &function, const unsigned int first, const unsigned int size, const unsigned int firstIndex=(unsigned int)(-1), const unsigned int sizeIndex=(unsigned int)(-1), const unsigned int minimalIterations=1u, const unsigned int threadIndex=(unsigned int)(-1))
Executes a callback function separable by two function parameters.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15