YARP
Yet Another Robot Platform
Image.copyPixels.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #include <yarp/os/Log.h>
11 #include <yarp/sig/Image.h>
12 #include <yarp/sig/impl/IplImage.h>
13 
14 #include <cstring>
15 #include <cstdio>
16 
17 using namespace yarp::sig;
18 
19 #define DBG if(0)
20 
21 // Default copy mechanism
22 template <class T1, class T2>
23 static inline void CopyPixel(const T1 *src, T2 *dest)
24 {
25  *dest = *src;
26 }
27 
28 /******************************************************************************/
29 
30 static inline void CopyPixel(const PixelMono* src, PixelRgb* dest)
31 {
32  dest->r = *src;
33  dest->g = *src;
34  dest->b = *src;
35 }
36 
37 static inline void CopyPixel(const PixelMono* src, PixelRgba* dest)
38 {
39  dest->r = *src;
40  dest->g = *src;
41  dest->b = *src;
42  dest->a = 255;
43 }
44 
45 static inline void CopyPixel(const PixelMono* src, PixelBgra* dest)
46 {
47  dest->r = *src;
48  dest->g = *src;
49  dest->b = *src;
50  dest->a = 255;
51 }
52 
53 static inline void CopyPixel(const PixelMono* src, PixelRgbInt* dest)
54 {
55  dest->r = *src;
56  dest->g = *src;
57  dest->b = *src;
58 }
59 
60 static inline void CopyPixel(const PixelMono* src, PixelBgr* dest)
61 {
62  dest->r = *src;
63  dest->g = *src;
64  dest->b = *src;
65 }
66 
67 static inline void CopyPixel(const PixelMono* src, PixelHsv* dest)
68 {
69  dest->v = *src;
70  dest->h = 0;
71  dest->s = 0;
72 }
73 
74 static inline void CopyPixel(const PixelMono* src, PixelRgbSigned* dest)
75 {
76  dest->r = *src;
77  dest->g = *src;
78  dest->b = *src;
79 }
80 
81 static inline void CopyPixel(const PixelMono* src, PixelRgbFloat* dest)
82 {
83  dest->r = *src;
84  dest->g = *src;
85  dest->b = *src;
86 }
87 
88 static inline void CopyPixel(const PixelMono* src, PixelHsvFloat* dest)
89 {
90  dest->v = *src;
91  dest->h = 0;
92  dest->s = 0;
93 }
94 
95 static inline void CopyPixel(const PixelMono* src, PixelMonoSigned* dest)
96 {
97  *dest = *src >> 1;
98 }
99 
100 static inline void CopyPixel(const PixelMono* src, PixelInt* dest)
101 {
102  *dest = *src;
103 }
104 
105 static inline void CopyPixel(const PixelMono* src, PixelMono16* dest)
106 {
107  *dest = *src;
108 }
109 
110 static inline void CopyPixel(const PixelMono* src, PixelFloat* dest)
111 {
112  *dest = *src;
113 }
114 
115 /******************************************************************************/
116 
117 static inline void CopyPixel(const PixelRgb* src, PixelMono* dest)
118 {
119  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
120 }
121 
122 static inline void CopyPixel(const PixelRgb* src, PixelMono16* dest)
123 {
124  *dest = static_cast<yarp::sig::PixelMono16>((src->r + src->g + src->b)/3);
125 }
126 
127 static inline void CopyPixel(const PixelRgb* src, PixelInt* dest)
128 {
129  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
130 }
131 
132 static inline void CopyPixel(const PixelRgb* src, PixelHsv* dest)
133 {
134  YARP_UNUSED(src);
135  YARP_UNUSED(dest);
136  yAssert(false); // Not implemented yet
137 }
138 
139 static inline void CopyPixel(const PixelRgb* src, PixelMonoSigned* dest)
140 {
141  *dest = static_cast<char>((src->r + src->g + src->b)/3);
142 }
143 
144 static inline void CopyPixel(const PixelRgb* src, PixelRgbSigned* dest)
145 {
146  dest->r = src->r;
147  dest->g = src->g;
148  dest->b = src->b;
149 }
150 
151 static inline void CopyPixel(const PixelRgb* src, PixelRgba* dest)
152 {
153  dest->r = src->r;
154  dest->g = src->g;
155  dest->b = src->b;
156  dest->a = 255;
157 }
158 
159 static inline void CopyPixel(const PixelRgb* src, PixelBgra* dest)
160 {
161  dest->r = src->r;
162  dest->g = src->g;
163  dest->b = src->b;
164  dest->a = 255;
165 }
166 
167 static inline void CopyPixel(const PixelRgb* src, PixelRgbInt* dest)
168 {
169  dest->r = src->r;
170  dest->g = src->g;
171  dest->b = src->b;
172 }
173 
174 static inline void CopyPixel(const PixelRgb* src, PixelFloat* dest)
175 {
176  *dest = ((src->r + src->g + src->b)/3.0f);
177 }
178 
179 static inline void CopyPixel(const PixelRgb* src, PixelRgbFloat* dest)
180 {
181  dest->r = src->r;
182  dest->g = src->g;
183  dest->b = src->b;
184 }
185 
186 static inline void CopyPixel(const PixelRgb* src, PixelBgr* dest)
187 {
188  dest->r = src->r;
189  dest->g = src->g;
190  dest->b = src->b;
191 }
192 
193 static inline void CopyPixel(const PixelRgb* src, PixelHsvFloat* dest)
194 {
195  YARP_UNUSED(src);
196  YARP_UNUSED(dest);
197  yAssert(false); // Not implemented yet
198 }
199 
200 /******************************************************************************/
201 
202 static inline void CopyPixel(const PixelHsv* src, PixelMono* dest)
203 {
204  YARP_UNUSED(src);
205  YARP_UNUSED(dest);
206  yAssert(false); // Not implemented yet
207 }
208 
209 static inline void CopyPixel(const PixelHsv* src, PixelMono16* dest)
210 {
211  YARP_UNUSED(src);
212  YARP_UNUSED(dest);
213  yAssert(false); // Not implemented yet
214 }
215 
216 static inline void CopyPixel(const PixelHsv* src, PixelRgb* dest)
217 {
218  YARP_UNUSED(src);
219  YARP_UNUSED(dest);
220  yAssert(false); // Not implemented yet
221 }
222 
223 static inline void CopyPixel(const PixelHsv* src, PixelRgba* dest)
224 {
225  YARP_UNUSED(src);
226  YARP_UNUSED(dest);
227  yAssert(false); // Not implemented yet
228 }
229 
230 static inline void CopyPixel(const PixelHsv* src, PixelBgra* dest)
231 {
232  YARP_UNUSED(src);
233  YARP_UNUSED(dest);
234  yAssert(false); // Not implemented yet
235 }
236 
237 static inline void CopyPixel(const PixelHsv* src, PixelRgbInt* dest)
238 {
239  YARP_UNUSED(src);
240  YARP_UNUSED(dest);
241  yAssert(false); // Not implemented yet
242 }
243 
244 static inline void CopyPixel(const PixelHsv* src, PixelBgr* dest)
245 {
246  YARP_UNUSED(src);
247  YARP_UNUSED(dest);
248  yAssert(false); // Not implemented yet
249 }
250 
251 static inline void CopyPixel(const PixelHsv* src, PixelMonoSigned* dest)
252 {
253  YARP_UNUSED(src);
254  YARP_UNUSED(dest);
255  yAssert(false); // Not implemented yet
256 }
257 
258 static inline void CopyPixel(const PixelHsv* src, PixelRgbSigned* dest)
259 {
260  YARP_UNUSED(src);
261  YARP_UNUSED(dest);
262  yAssert(false); // Not implemented yet
263 }
264 
265 static inline void CopyPixel(const PixelHsv* src, PixelFloat* dest)
266 {
267  YARP_UNUSED(src);
268  YARP_UNUSED(dest);
269  yAssert(false); // Not implemented yet
270 }
271 
272 static inline void CopyPixel(const PixelHsv* src, PixelRgbFloat* dest)
273 {
274  YARP_UNUSED(src);
275  YARP_UNUSED(dest);
276  yAssert(false); // Not implemented yet
277 }
278 
279 static inline void CopyPixel(const PixelHsv* src, PixelHsvFloat* dest)
280 {
281  YARP_UNUSED(src);
282  YARP_UNUSED(dest);
283  yAssert(false); // Not implemented yet
284 }
285 
286 static inline void CopyPixel(const PixelHsv* src, PixelInt* dest)
287 {
288  YARP_UNUSED(src);
289  YARP_UNUSED(dest);
290  yAssert(false); // Not implemented yet
291 }
292 
293 /******************************************************************************/
294 
295 static inline void CopyPixel(const PixelBgr* src, PixelMono* dest)
296 {
297  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
298 }
299 
300 static inline void CopyPixel(const PixelBgr* src, PixelMono16* dest)
301 {
302  *dest = static_cast<yarp::sig::PixelMono16>((src->r + src->g + src->b)/3);
303 }
304 
305 static inline void CopyPixel(const PixelBgr* src, PixelInt* dest)
306 {
307  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
308 }
309 
310 static inline void CopyPixel(const PixelBgr* src, PixelHsv* dest)
311 {
312  yAssert(false); // Not implemented yet
313 }
314 
315 static inline void CopyPixel(const PixelBgr* src, PixelMonoSigned* dest)
316 {
317  *dest = static_cast<char>((src->r + src->g + src->b)/3);
318 }
319 
320 static inline void CopyPixel(const PixelBgr* src, PixelRgbSigned* dest)
321 {
322  dest->r = src->r;
323  dest->g = src->g;
324  dest->b = src->b;
325 }
326 
327 static inline void CopyPixel(const PixelBgr* src, PixelFloat* dest)
328 {
329  *dest = ((src->r + src->g + src->b)/3.0f);
330 }
331 
332 static inline void CopyPixel(const PixelBgr* src, PixelRgbFloat* dest)
333 {
334  dest->r = src->r;
335  dest->g = src->g;
336  dest->b = src->b;
337 }
338 
339 static inline void CopyPixel(const PixelBgr* src, PixelRgb* dest)
340 {
341  dest->r = src->r;
342  dest->g = src->g;
343  dest->b = src->b;
344 }
345 
346 static inline void CopyPixel(const PixelBgr* src, PixelRgba* dest)
347 {
348  dest->r = src->r;
349  dest->g = src->g;
350  dest->b = src->b;
351  dest->a = 255;
352 }
353 
354 static inline void CopyPixel(const PixelBgr* src, PixelBgra* dest)
355 {
356  dest->r = src->r;
357  dest->g = src->g;
358  dest->b = src->b;
359  dest->a = 255;
360 }
361 
362 static inline void CopyPixel(const PixelBgr* src, PixelRgbInt* dest)
363 {
364  dest->r = src->r;
365  dest->g = src->g;
366  dest->b = src->b;
367 }
368 
369 static inline void CopyPixel(const PixelBgr* src, PixelHsvFloat* dest)
370 {
371  yAssert(false); // Not implemented yet
372 }
373 
374 /******************************************************************************/
375 
376 static inline void CopyPixel(const PixelRgba* src, PixelMono* dest)
377 {
378  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
379 }
380 
381 static inline void CopyPixel(const PixelRgba* src, PixelMono16* dest)
382 {
383  *dest = static_cast<yarp::sig::PixelMono16>((src->r + src->g + src->b)/3);
384 }
385 
386 static inline void CopyPixel(const PixelRgba* src, PixelInt* dest)
387 {
388  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
389 }
390 
391 static inline void CopyPixel(const PixelRgba* src, PixelHsv* dest)
392 {
393  yAssert(false); // Not implemented yet
394 }
395 
396 static inline void CopyPixel(const PixelRgba* src, PixelMonoSigned* dest)
397 {
398  *dest = static_cast<char>((src->r + src->g + src->b)/3);
399 }
400 
401 static inline void CopyPixel(const PixelRgba* src, PixelRgbSigned* dest)
402 {
403  dest->r = src->r;
404  dest->g = src->g;
405  dest->b = src->b;
406 }
407 
408 static inline void CopyPixel(const PixelRgba* src, PixelFloat* dest)
409 {
410  *dest = ((src->r + src->g + src->b)/3.0f);
411 }
412 
413 static inline void CopyPixel(const PixelRgba* src, PixelRgbFloat* dest)
414 {
415  dest->r = src->r;
416  dest->g = src->g;
417  dest->b = src->b;
418 }
419 
420 static inline void CopyPixel(const PixelRgba* src, PixelRgb* dest)
421 {
422  dest->r = src->r;
423  dest->g = src->g;
424  dest->b = src->b;
425 }
426 
427 static inline void CopyPixel(const PixelRgba* src, PixelBgra* dest)
428 {
429  dest->r = src->r;
430  dest->g = src->g;
431  dest->b = src->b;
432  dest->a = src->a;
433 }
434 
435 static inline void CopyPixel(const PixelRgba* src, PixelBgr* dest)
436 {
437  dest->r = src->r;
438  dest->g = src->g;
439  dest->b = src->b;
440 }
441 
442 static inline void CopyPixel(const PixelRgba* src, PixelRgbInt* dest)
443 {
444  dest->r = src->r;
445  dest->g = src->g;
446  dest->b = src->b;
447 }
448 
449 static inline void CopyPixel(const PixelRgba* src, PixelHsvFloat* dest)
450 {
451  yAssert(false); // Not implemented yet
452 }
453 
454 /******************************************************************************/
455 
456 static inline void CopyPixel(const PixelBgra* src, PixelMono* dest)
457 {
458  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
459 }
460 
461 static inline void CopyPixel(const PixelBgra* src, PixelMono16* dest)
462 {
463  *dest = static_cast<yarp::sig::PixelMono16>((src->r + src->g + src->b)/3);
464 }
465 
466 static inline void CopyPixel(const PixelBgra* src, PixelInt* dest)
467 {
468  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
469 }
470 
471 static inline void CopyPixel(const PixelBgra* src, PixelHsv* dest)
472 {
473  yAssert(false); // Not implemented yet
474 }
475 
476 static inline void CopyPixel(const PixelBgra* src, PixelMonoSigned* dest)
477 {
478  *dest = static_cast<char>((src->r + src->g + src->b)/3);
479 }
480 
481 static inline void CopyPixel(const PixelBgra* src, PixelRgbSigned* dest)
482 {
483  dest->r = src->r;
484  dest->g = src->g;
485  dest->b = src->b;
486 }
487 
488 static inline void CopyPixel(const PixelBgra* src, PixelFloat* dest)
489 {
490  *dest = ((src->r + src->g + src->b)/3.0f);
491 }
492 
493 static inline void CopyPixel(const PixelBgra* src, PixelRgbFloat* dest)
494 {
495  dest->r = src->r;
496  dest->g = src->g;
497  dest->b = src->b;
498 }
499 
500 static inline void CopyPixel(const PixelBgra* src, PixelRgb* dest)
501 {
502  dest->r = src->r;
503  dest->g = src->g;
504  dest->b = src->b;
505 }
506 
507 static inline void CopyPixel(const PixelBgra* src, PixelRgba* dest)
508 {
509  dest->r = src->r;
510  dest->g = src->g;
511  dest->b = src->b;
512  dest->a = src->a;
513 }
514 
515 static inline void CopyPixel(const PixelBgra* src, PixelBgr* dest)
516 {
517  dest->r = src->r;
518  dest->g = src->g;
519  dest->b = src->b;
520 }
521 
522 static inline void CopyPixel(const PixelBgra* src, PixelRgbInt* dest)
523 {
524  dest->r = src->r;
525  dest->g = src->g;
526  dest->b = src->b;
527 }
528 
529 static inline void CopyPixel(const PixelBgra* src, PixelHsvFloat* dest)
530 {
531  yAssert(false); // Not implemented yet
532 }
533 
534 /******************************************************************************/
535 
536 static inline void CopyPixel(const PixelRgbInt* src, PixelMono* dest)
537 {
538  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
539 }
540 
541 static inline void CopyPixel(const PixelRgbInt* src, PixelMono16* dest)
542 {
543  *dest = static_cast<yarp::sig::PixelMono16>((src->r + src->g + src->b)/3);
544 }
545 
546 static inline void CopyPixel(const PixelRgbInt* src, PixelInt* dest)
547 {
548  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
549 }
550 
551 static inline void CopyPixel(const PixelRgbInt* src, PixelHsv* dest)
552 {
553  yAssert(false); // Not implemented yet
554 }
555 
556 static inline void CopyPixel(const PixelRgbInt* src, PixelMonoSigned* dest)
557 {
558  *dest = static_cast<char>((src->r + src->g + src->b)/3);
559 }
560 
561 static inline void CopyPixel(const PixelRgbInt* src, PixelRgbSigned* dest)
562 {
563  dest->r = static_cast<char>(src->r);
564  dest->g = static_cast<char>(src->g);
565  dest->b = static_cast<char>(src->b);
566 }
567 
568 static inline void CopyPixel(const PixelRgbInt* src, PixelFloat* dest)
569 {
570  *dest = ((src->r + src->g + src->b)/3.0f);
571 }
572 
573 static inline void CopyPixel(const PixelRgbInt* src, PixelRgbFloat* dest)
574 {
575  dest->r = static_cast<float>(static_cast<int>(src->r));
576  dest->g = static_cast<float>(static_cast<int>(src->g));
577  dest->b = static_cast<float>(static_cast<int>(src->b));
578 }
579 
580 static inline void CopyPixel(const PixelRgbInt* src, PixelRgb* dest)
581 {
582  dest->r = static_cast<unsigned char>(src->r);
583  dest->g = static_cast<unsigned char>(src->g);
584  dest->b = static_cast<unsigned char>(src->b);
585 }
586 
587 static inline void CopyPixel(const PixelRgbInt* src, PixelBgr* dest)
588 {
589  dest->r = static_cast<unsigned char>(src->r);
590  dest->g = static_cast<unsigned char>(src->g);
591  dest->b = static_cast<unsigned char>(src->b);
592 }
593 
594 static inline void CopyPixel(const PixelRgbInt* src, PixelRgba* dest)
595 {
596  dest->r = static_cast<unsigned char>(src->r);
597  dest->g = static_cast<unsigned char>(src->g);
598  dest->b = static_cast<unsigned char>(src->b);
599  dest->a = 255;
600 }
601 
602 static inline void CopyPixel(const PixelRgbInt* src, PixelBgra* dest)
603 {
604  dest->r = static_cast<unsigned char>(src->r);
605  dest->g = static_cast<unsigned char>(src->g);
606  dest->b = static_cast<unsigned char>(src->b);
607  dest->a = 255;
608 }
609 
610 static inline void CopyPixel(const PixelRgbInt* src, PixelHsvFloat* dest)
611 {
612  yAssert(false); // Not implemented yet
613 }
614 
615 /******************************************************************************/
616 
617 static inline void CopyPixel(const PixelMonoSigned* src, PixelRgb* dest)
618 {
619  dest->r = *src;
620  dest->g = *src;
621  dest->b = *src;
622 }
623 
624 static inline void CopyPixel(const PixelMonoSigned* src, PixelRgba* dest)
625 {
626  dest->r = *src;
627  dest->g = *src;
628  dest->b = *src;
629  dest->a = 255;
630 }
631 
632 static inline void CopyPixel(const PixelMonoSigned* src, PixelBgra* dest)
633 {
634  dest->r = *src;
635  dest->g = *src;
636  dest->b = *src;
637  dest->a = 255;
638 }
639 
640 static inline void CopyPixel(const PixelMonoSigned* src, PixelRgbInt* dest)
641 {
642  dest->r = *src;
643  dest->g = *src;
644  dest->b = *src;
645 }
646 
647 static inline void CopyPixel(const PixelMonoSigned* src, PixelBgr* dest)
648 {
649  dest->r = *src;
650  dest->g = *src;
651  dest->b = *src;
652 }
653 
654 static inline void CopyPixel(const PixelMonoSigned* src, PixelHsv* dest)
655 {
656  dest->v = *src;
657  dest->h = 0;
658  dest->s = 0;
659 }
660 
661 static inline void CopyPixel(const PixelMonoSigned* src, PixelRgbSigned* dest)
662 {
663  dest->r = *src;
664  dest->g = *src;
665  dest->b = *src;
666 }
667 
668 static inline void CopyPixel(const PixelMonoSigned* src, PixelRgbFloat* dest)
669 {
670  dest->r = *src;
671  dest->g = *src;
672  dest->b = *src;
673 }
674 
675 static inline void CopyPixel(const PixelMonoSigned* src, PixelHsvFloat* dest)
676 {
677  dest->v = *src;
678  dest->h = 0;
679  dest->s = 0;
680 }
681 
682 static inline void CopyPixel(const PixelMonoSigned* src, PixelMono* dest)
683 {
684  *dest = *src + 128;
685 }
686 
687 static inline void CopyPixel(const PixelMonoSigned* src, PixelInt* dest)
688 {
689  *dest = *src;
690 }
691 
692 static inline void CopyPixel(const PixelMonoSigned* src, PixelMono16* dest)
693 {
694  *dest = static_cast<yarp::sig::PixelMono16>(*src);
695 }
696 
697 /******************************************************************************/
698 
699 static inline void CopyPixel(const PixelRgbSigned* src, PixelMono* dest)
700 {
701  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
702 }
703 
704 static inline void CopyPixel(const PixelRgbSigned* src, PixelMono16* dest)
705 {
706  *dest = static_cast<PixelMono16>((src->r + src->g + src->b)/3);
707 }
708 
709 static inline void CopyPixel(const PixelRgbSigned* src, PixelInt* dest)
710 {
711  *dest = static_cast<int>((src->r + src->g + src->b)/3);
712 }
713 
714 static inline void CopyPixel(const PixelRgbSigned* src, PixelHsv* dest)
715 {
716  yAssert(false); // Not implemented yet
717 }
718 
719 static inline void CopyPixel(const PixelRgbSigned* src, PixelMonoSigned* dest)
720 {
721  *dest = static_cast<char>((src->r + src->g + src->b)/3);
722 }
723 
724 static inline void CopyPixel(const PixelRgbSigned* src, PixelRgb* dest)
725 {
726  dest->r = src->r;
727  dest->g = src->g;
728  dest->b = src->b;
729 }
730 
731 static inline void CopyPixel(const PixelRgbSigned* src, PixelRgba* dest)
732 {
733  dest->r = src->r;
734  dest->g = src->g;
735  dest->b = src->b;
736  dest->a = 255;
737 }
738 
739 static inline void CopyPixel(const PixelRgbSigned* src, PixelBgra* dest)
740 {
741  dest->r = src->r;
742  dest->g = src->g;
743  dest->b = src->b;
744  dest->a = 255;
745 }
746 
747 static inline void CopyPixel(const PixelRgbSigned* src, PixelRgbInt* dest)
748 {
749  dest->r = src->r;
750  dest->g = src->g;
751  dest->b = src->b;
752 }
753 
754 static inline void CopyPixel(const PixelRgbSigned* src, PixelBgr* dest)
755 {
756  dest->r = src->r;
757  dest->g = src->g;
758  dest->b = src->b;
759 }
760 
761 static inline void CopyPixel(const PixelRgbSigned* src, PixelFloat* dest)
762 {
763  *dest = ((src->r + src->g + src->b)/3.0f);
764 }
765 
766 static inline void CopyPixel(const PixelRgbSigned* src, PixelRgbFloat* dest)
767 {
768  dest->r = src->r;
769  dest->g = src->g;
770  dest->b = src->b;
771 }
772 
773 static inline void CopyPixel(const PixelRgbSigned* src, PixelHsvFloat* dest)
774 {
775  yAssert(false); // Not implemented yet
776 }
777 
778 /******************************************************************************/
779 
780 static inline void CopyPixel(const PixelFloat* src, PixelMono* dest)
781 {
782  *dest = static_cast<unsigned char>(*src);
783 }
784 
785 static inline void CopyPixel(const PixelFloat* src, PixelMono16* dest)
786 {
787  *dest = static_cast<yarp::sig::PixelMono16>(*src);
788 }
789 
790 static inline void CopyPixel(const PixelFloat* src, PixelInt* dest)
791 {
792  *dest = static_cast<unsigned char>(*src);
793 }
794 
795 static inline void CopyPixel(const PixelFloat* src, PixelMonoSigned* dest)
796 {
797  *dest = static_cast<char>(*src);
798 }
799 
800 static inline void CopyPixel(const PixelFloat* src, PixelRgb* dest)
801 {
802  dest->r = static_cast<unsigned char>(*src);
803  dest->g = static_cast<unsigned char>(*src);
804  dest->b = static_cast<unsigned char>(*src);
805 }
806 
807 static inline void CopyPixel(const PixelFloat* src, PixelRgba* dest)
808 {
809  dest->r = static_cast<unsigned char>(*src);
810  dest->g = static_cast<unsigned char>(*src);
811  dest->b = static_cast<unsigned char>(*src);
812  dest->a = 255;
813 }
814 
815 static inline void CopyPixel(const PixelFloat* src, PixelBgra* dest)
816 {
817  dest->r = static_cast<unsigned char>(*src);
818  dest->g = static_cast<unsigned char>(*src);
819  dest->b = static_cast<unsigned char>(*src);
820  dest->a = 255;
821 }
822 
823 static inline void CopyPixel(const PixelFloat* src, PixelRgbInt* dest)
824 {
825  dest->r = static_cast<int>(*src);
826  dest->g = static_cast<int>(*src);
827  dest->b = static_cast<int>(*src);
828 }
829 
830 static inline void CopyPixel(const PixelFloat* src, PixelBgr* dest)
831 {
832  dest->r = static_cast<unsigned char>(*src);
833  dest->g = static_cast<unsigned char>(*src);
834  dest->b = static_cast<unsigned char>(*src);
835 }
836 
837 static inline void CopyPixel(const PixelFloat* src, PixelHsv* dest)
838 {
839  dest->v = static_cast<unsigned char>(*src);
840  dest->h = 0;
841  dest->s = 0;
842 }
843 
844 static inline void CopyPixel(const PixelFloat* src, PixelRgbSigned* dest)
845 {
846  dest->r = static_cast<signed char>(*src);
847  dest->g = static_cast<signed char>(*src);
848  dest->b = static_cast<signed char>(*src);
849 }
850 
851 static inline void CopyPixel(const PixelFloat* src, PixelRgbFloat* dest)
852 {
853  dest->r = *src;
854  dest->g = *src;
855  dest->b = *src;
856 }
857 
858 static inline void CopyPixel(const PixelFloat* src, PixelHsvFloat* dest)
859 {
860  dest->v = *src;
861  dest->h = 0;
862  dest->s = 0;
863 }
864 
865 /******************************************************************************/
866 
867 static inline void CopyPixel(const PixelRgbFloat* src, PixelMono* dest)
868 {
869  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
870 }
871 
872 static inline void CopyPixel(const PixelRgbFloat* src, PixelInt* dest)
873 {
874  *dest = static_cast<unsigned char>((src->r + src->g + src->b)/3);
875 }
876 
877 static inline void CopyPixel(const PixelRgbFloat* src, PixelMono16* dest)
878 {
879  *dest = static_cast<yarp::sig::PixelMono16>((src->r + src->g + src->b)/3);
880 }
881 
882 static inline void CopyPixel(const PixelRgbFloat* src, PixelHsv* dest)
883 {
884  yAssert(false); // Not implemented yet
885 }
886 
887 static inline void CopyPixel(const PixelRgbFloat* src, PixelMonoSigned* dest)
888 {
889  *dest = static_cast<char>((src->r + src->g + src->b)/3);
890 }
891 
892 static inline void CopyPixel(const PixelRgbFloat* src, PixelRgb* dest)
893 {
894  dest->r = static_cast<unsigned char>(src->r);
895  dest->g = static_cast<unsigned char>(src->g);
896  dest->b = static_cast<unsigned char>(src->b);
897 }
898 
899 static inline void CopyPixel(const PixelRgbFloat* src, PixelRgba* dest)
900 {
901  dest->r = static_cast<unsigned char>(src->r);
902  dest->g = static_cast<unsigned char>(src->g);
903  dest->b = static_cast<unsigned char>(src->b);
904  dest->a = 255;
905 }
906 
907 static inline void CopyPixel(const PixelRgbFloat* src, PixelBgra* dest)
908 {
909  dest->r = static_cast<unsigned char>(src->r);
910  dest->g = static_cast<unsigned char>(src->g);
911  dest->b = static_cast<unsigned char>(src->b);
912  dest->a = 255;
913 }
914 
915 static inline void CopyPixel(const PixelRgbFloat* src, PixelRgbInt* dest)
916 {
917  dest->r = static_cast<int>(src->r);
918  dest->g = static_cast<int>(src->g);
919  dest->b = static_cast<int>(src->b);
920 }
921 
922 static inline void CopyPixel(const PixelRgbFloat* src, PixelBgr* dest)
923 {
924  dest->r = static_cast<unsigned char>(src->r);
925  dest->g = static_cast<unsigned char>(src->g);
926  dest->b = static_cast<unsigned char>(src->b);
927 }
928 
929 static inline void CopyPixel(const PixelRgbFloat* src, PixelFloat* dest)
930 {
931  *dest = ((src->r + src->g + src->b)/3);
932 }
933 
934 static inline void CopyPixel(const PixelRgbFloat* src, PixelRgbSigned* dest)
935 {
936  dest->r = static_cast<signed char>(src->r);
937  dest->g = static_cast<signed char>(src->g);
938  dest->b = static_cast<signed char>(src->b);
939 }
940 
941 static inline void CopyPixel(const PixelRgbFloat* src, PixelHsvFloat* dest)
942 {
943  yAssert(false); // Not implemented yet
944 }
945 
946 /******************************************************************************/
947 
948 static inline void CopyPixel(const PixelHsvFloat* src, PixelMono* dest)
949 {
950  yAssert(false); // Not implemented yet
951 }
952 
953 static inline void CopyPixel(const PixelHsvFloat* src, PixelMono16* dest)
954 {
955  yAssert(false); // Not implemented yet
956 }
957 
958 static inline void CopyPixel(const PixelHsvFloat* src, PixelRgb* dest)
959 {
960  yAssert(false); // Not implemented yet
961 }
962 
963 static inline void CopyPixel(const PixelHsvFloat* src, PixelBgr* dest)
964 {
965  yAssert(false); // Not implemented yet
966 }
967 
968 static inline void CopyPixel(const PixelHsvFloat* src, PixelRgba* dest)
969 {
970  yAssert(false); // Not implemented yet
971 }
972 
973 static inline void CopyPixel(const PixelHsvFloat* src, PixelBgra* dest)
974 {
975  yAssert(false); // Not implemented yet
976 }
977 
978 static inline void CopyPixel(const PixelHsvFloat* src, PixelRgbInt* dest)
979 {
980  yAssert(false); // Not implemented yet
981 }
982 
983 static inline void CopyPixel(const PixelHsvFloat* src, PixelMonoSigned* dest)
984 {
985  yAssert(false); // Not implemented yet
986 }
987 
988 static inline void CopyPixel(const PixelHsvFloat* src, PixelRgbSigned* dest)
989 {
990  yAssert(false); // Not implemented yet
991 }
992 
993 static inline void CopyPixel(const PixelHsvFloat* src, PixelFloat* dest)
994 {
995  yAssert(false); // Not implemented yet
996 }
997 
998 static inline void CopyPixel(const PixelHsvFloat* src, PixelRgbFloat* dest)
999 {
1000  yAssert(false); // Not implemented yet
1001 }
1002 
1003 static inline void CopyPixel(const PixelHsvFloat* src, PixelHsv* dest)
1004 {
1005  yAssert(false); // Not implemented yet
1006 }
1007 
1008 static inline void CopyPixel(const PixelHsvFloat* src, PixelInt* dest)
1009 {
1010  yAssert(false); // Not implemented yet
1011 }
1012 
1013 /******************************************************************************/
1014 
1015 static inline void CopyPixel(const PixelInt* src, PixelRgb* dest)
1016 {
1017  dest->r = static_cast<char>(*src);
1018  dest->g = static_cast<char>(*src);
1019  dest->b = static_cast<char>(*src);
1020 }
1021 
1022 static inline void CopyPixel(const PixelInt* src, PixelRgba* dest)
1023 {
1024  dest->r = static_cast<char>(*src);
1025  dest->g = static_cast<char>(*src);
1026  dest->b = static_cast<char>(*src);
1027  dest->a = 255;
1028 }
1029 
1030 static inline void CopyPixel(const PixelInt* src, PixelBgra* dest)
1031 {
1032  dest->r = static_cast<char>(*src);
1033  dest->g = static_cast<char>(*src);
1034  dest->b = static_cast<char>(*src);
1035  dest->a = 255;
1036 }
1037 
1038 static inline void CopyPixel(const PixelInt* src, PixelRgbInt* dest)
1039 {
1040  dest->r = *src;
1041  dest->g = *src;
1042  dest->b = *src;
1043 }
1044 
1045 static inline void CopyPixel(const PixelInt* src, PixelBgr* dest)
1046 {
1047  dest->r = static_cast<char>(*src);
1048  dest->g = static_cast<char>(*src);
1049  dest->b = static_cast<char>(*src);
1050 }
1051 
1052 static inline void CopyPixel(const PixelInt* src, PixelHsv* dest)
1053 {
1054  dest->v = static_cast<yarp::sig::PixelMono>(*src);
1055  dest->h = dest->s = 0;
1056 }
1057 
1058 static inline void CopyPixel(const PixelInt* src, PixelRgbSigned* dest)
1059 {
1060  dest->r = static_cast<yarp::sig::PixelMono>(*src);
1061  dest->g = static_cast<yarp::sig::PixelMono>(*src);
1062  dest->b = static_cast<yarp::sig::PixelMono>(*src);
1063 }
1064 
1065 static inline void CopyPixel(const PixelInt* src, PixelFloat* dest)
1066 {
1067  *dest = static_cast<float>(*src);
1068 }
1069 
1070 static inline void CopyPixel(const PixelInt* src, PixelRgbFloat* dest)
1071 {
1072  dest->r = static_cast<float>(*src);
1073  dest->g = static_cast<float>(*src);
1074  dest->b = static_cast<float>(*src);
1075 }
1076 
1077 static inline void CopyPixel(const PixelInt* src, PixelHsvFloat* dest)
1078 {
1079  dest->v = float(*src);
1080  dest->h = 0;
1081  dest->s = 0;
1082 }
1083 
1084 static inline void CopyPixel(const PixelInt* src, PixelMonoSigned* dest)
1085 {
1086  *dest = static_cast<char>(*src >> 1);
1087 }
1088 
1089 static inline void CopyPixel(const PixelInt* src, PixelMono* dest)
1090 {
1091  *dest = static_cast<yarp::sig::PixelMono>(*src);
1092 }
1093 
1094 static inline void CopyPixel(const PixelInt* src, PixelMono16* dest)
1095 {
1096  *dest = static_cast<yarp::sig::PixelMono16>(*src);
1097 }
1098 
1099 /******************************************************************************/
1100 
1101 static inline void CopyPixel(const PixelMono16* src, PixelRgb* dest)
1102 {
1103  dest->r = static_cast<char>(*src);
1104  dest->g = static_cast<char>(*src);
1105  dest->b = static_cast<char>(*src);
1106 }
1107 
1108 static inline void CopyPixel(const PixelMono16* src, PixelRgba* dest)
1109 {
1110  dest->r = static_cast<char>(*src);
1111  dest->g = static_cast<char>(*src);
1112  dest->b = static_cast<char>(*src);
1113  dest->a = 255;
1114 }
1115 
1116 static inline void CopyPixel(const PixelMono16* src, PixelBgra* dest)
1117 {
1118  dest->r = static_cast<char>(*src);
1119  dest->g = static_cast<char>(*src);
1120  dest->b = static_cast<char>(*src);
1121  dest->a = 255;
1122 }
1123 
1124 static inline void CopyPixel(const PixelMono16* src, PixelRgbInt* dest)
1125 {
1126  dest->r = static_cast<int>(static_cast<unsigned>(*src));
1127  dest->g = static_cast<int>(static_cast<unsigned>(*src));
1128  dest->b = static_cast<int>(static_cast<unsigned>(*src));
1129 }
1130 
1131 static inline void CopyPixel(const PixelMono16* src, PixelInt* dest)
1132 {
1133  *dest = static_cast<int>(static_cast<unsigned>(*src));
1134 }
1135 
1136 static inline void CopyPixel(const PixelMono16* src, PixelBgr* dest)
1137 {
1138  dest->r = static_cast<char>(*src);
1139  dest->g = static_cast<char>(*src);
1140  dest->b = static_cast<char>(*src);
1141 }
1142 
1143 static inline void CopyPixel(const PixelMono16* src, PixelHsv* dest)
1144 {
1145  dest->v = static_cast<yarp::sig::PixelMono>(*src);
1146  dest->h = 0;
1147  dest->s = 0;
1148 }
1149 
1150 static inline void CopyPixel(const PixelMono16* src, PixelRgbSigned* dest)
1151 {
1152  dest->r = static_cast<yarp::sig::PixelMono>(*src);
1153  dest->g = static_cast<yarp::sig::PixelMono>(*src);
1154  dest->b = static_cast<yarp::sig::PixelMono>(*src);
1155 }
1156 
1157 static inline void CopyPixel(const PixelMono16* src, PixelFloat* dest)
1158 {
1159  *dest = static_cast<float>(*src);
1160 }
1161 
1162 static inline void CopyPixel(const PixelMono16* src, PixelRgbFloat* dest)
1163 {
1164  dest->r = static_cast<float>(*src);
1165  dest->g = static_cast<float>(*src);
1166  dest->b = static_cast<float>(*src);
1167 }
1168 
1169 static inline void CopyPixel(const PixelMono16* src, PixelHsvFloat* dest)
1170 {
1171  dest->v = static_cast<float>(*src);
1172  dest->h = 0;
1173  dest->s = 0;
1174 }
1175 
1176 static inline void CopyPixel(const PixelMono16* src, PixelMonoSigned* dest)
1177 {
1178  *dest = static_cast<char>(*src >> 1);
1179 }
1180 
1181 static inline void CopyPixel(const PixelMono16* src, PixelMono* dest)
1182 {
1183  *dest = static_cast<yarp::sig::PixelMono>(*src);
1184 }
1185 
1186 static inline void CopyPixel(const PixelInt* src, PixelInt* dest)
1187 {
1188  *dest = *src;
1189 }
1190 
1191 /******************************************************************************/
1192 
1193 
1194 //static inline int PAD_BYTES (int len, int pad)
1195 //{
1196 // const int rem = len % pad;
1197 // return (rem != 0) ? (pad - rem) : rem;
1198 //}
1199 
1202 template <class T1, class T2>
1203 static void CopyPixels(const T1 *osrc, int q1, T2 *odest, int q2,
1204  int w, int h,
1205  bool flip)
1206 {
1207  const T1 *src = osrc;
1208  T2 *dest = odest;
1209  const int p1 = PAD_BYTES (w * sizeof(T1), q1);
1210  const int p2 = PAD_BYTES (w * sizeof(T2), q2);
1211  //const int step1 = w*sizeof(T1) + p1;
1212  const int step2 = w*sizeof(T2) + p2;
1213  DBG printf("q1 %d q2 %d (%dx%d) inc %d %d\n", q1, q2, w, h, p1, p2);
1214 
1215  if (flip) {
1216  odest = reinterpret_cast<T2*>(((char *)odest) + step2*(h-1));
1217  dest = odest;
1218  }
1219 
1220  for (int i=0; i<h; i++) {
1221  DBG printf("x,y = %d,%d\n", 0,i);
1222  for (int j = 0; j < w; j++) {
1223  CopyPixel(src,dest);
1224  src++;
1225  dest++;
1226  }
1227 
1228  src = reinterpret_cast<const T1*>(((char *)src) + p1);
1229  odest = reinterpret_cast<T2*>(((char *)odest) + step2*(flip?-1:1));
1230  dest = odest;
1231  }
1232 }
1233 
1234 
1249 
1250 #define HASH(id1, id2) ((int)(((int)(id1%65537))*11 + ((long int)(id2))))
1251 #define HANDLE_CASE(len, x1, T1, q1, o1, x2, T2, q2, o2) CopyPixels(reinterpret_cast<const T1*>(x1), q1, reinterpret_cast<T2*>(x2), q2, w, h, o1!=o2);
1252 #define MAKE_CASE(id1, id2) case HASH(id1, id2): HANDLE_CASE(len, src, Def_##id1, quantum1, topIsLow1, dest, Def_##id2, quantum2, topIsLow2); break;
1253 
1254 // More elegant ways to do this, but needs to be efficient at pixel level
1255 void Image::copyPixels(const unsigned char *src, size_t id1,
1256  char unsigned *dest, size_t id2, size_t w, size_t h,
1257  size_t imageSize, size_t quantum1, size_t quantum2,
1258  bool topIsLow1, bool topIsLow2)
1259 {
1260  DBG printf("copyPixels...\n");
1261 
1262  if (id1==id2&&quantum1==quantum2&&topIsLow1==topIsLow2) {
1263  memcpy(dest,src,imageSize);
1264  return;
1265  }
1266 
1267 
1268  switch(HASH(id1,id2)) {
1269  // Macros rely on len, x1, x2 variable names
1270 
1271  // Each MAKE_CASE line here expands to something like this:
1272  //
1273  // case HASH(VOCAB_PIXEL_MONO, VOCAB_PIXEL_RGB):
1274  // CopyPixels(reinterpret_cast<const PixelMono*>(src), quantum1,
1275  // reinterpret_cast<PixelRgb*>(dest), quantum2,
1276  // w, h, topIsLow1!=topIsLow2);
1277  // break;
1278 
1293 
1308 
1323 
1338 
1353 
1368 
1383 
1398 
1413 
1428 
1443 
1458 
1473 
1488 
1489  default:
1490  printf("*** Tried to copy type %zu to %zu\n", id1, id2);
1491  std::exit(1);
1492  break;
1493  }
1494 
1495  DBG printf("... done copyPixels\n");
1496 }
Def_VOCAB_PIXEL_MONO_FLOAT
PixelFloat Def_VOCAB_PIXEL_MONO_FLOAT
Definition: Image.copyPixels.cpp:1244
yarp::sig::PixelRgba::a
unsigned char a
Definition: Image.h:491
VOCAB_PIXEL_RGB_INT
@ VOCAB_PIXEL_RGB_INT
Definition: Image.h:58
Def_VOCAB_PIXEL_MONO16
PixelMono16 Def_VOCAB_PIXEL_MONO16
Definition: Image.copyPixels.cpp:1236
yarp::sig::PixelRgbSigned::r
char r
Definition: Image.h:563
VOCAB_PIXEL_RGB_FLOAT
@ VOCAB_PIXEL_RGB_FLOAT
Definition: Image.h:60
yarp::sig::PixelRgbInt::r
yarp::os::NetInt32 r
Definition: Image.h:602
yarp::sig::PixelRgb::g
unsigned char g
Definition: Image.h:455
yarp::sig::PixelRgba::b
unsigned char b
Definition: Image.h:490
yarp::sig::PixelRgbInt::g
yarp::os::NetInt32 g
Definition: Image.h:603
yarp::sig
Signal processing.
Definition: Image.h:25
Def_VOCAB_PIXEL_INT
PixelInt Def_VOCAB_PIXEL_INT
Definition: Image.copyPixels.cpp:1247
VOCAB_PIXEL_RGB_SIGNED
@ VOCAB_PIXEL_RGB_SIGNED
Definition: Image.h:57
yarp::sig::PixelRgbFloat::r
float r
Definition: Image.h:580
yarp::sig::PixelRgbFloat::g
float g
Definition: Image.h:581
Def_VOCAB_PIXEL_MONO_SIGNED
PixelMonoSigned Def_VOCAB_PIXEL_MONO_SIGNED
Definition: Image.copyPixels.cpp:1242
yarp::sig::PixelHsvFloat::v
float v
Definition: Image.h:626
yarp::sig::PixelMonoSigned
char PixelMonoSigned
Signed byte pixel type.
Definition: Image.h:555
yarp::sig::PAD_BYTES
size_t PAD_BYTES(size_t len, size_t pad)
computes the padding of YARP images.
Definition: Image.h:36
yarp::sig::PixelBgr
Packed RGB pixel type, with pixels stored in reverse order.
Definition: Image.h:525
yarp::sig::PixelRgbSigned
Signed, packed RGB pixel type.
Definition: Image.h:562
yarp::sig::PixelRgbFloat::b
float b
Definition: Image.h:582
YARP_UNUSED
#define YARP_UNUSED(var)
Definition: api.h:159
yarp::sig::PixelHsv::v
unsigned char v
Definition: Image.h:548
HASH
#define HASH(id1, id2)
Definition: Image.copyPixels.cpp:1250
yarp::sig::PixelHsvFloat::s
float s
Definition: Image.h:625
yarp::sig::PixelBgra
Packed BGRA pixel type.
Definition: Image.h:500
yarp::sig::PixelHsvFloat
Floating point HSV pixel type.
Definition: Image.h:623
yarp::sig::PixelRgb::b
unsigned char b
Definition: Image.h:456
VOCAB_PIXEL_RGBA
@ VOCAB_PIXEL_RGBA
Definition: Image.h:51
yarp::sig::PixelRgbInt
Integer RGB pixel type.
Definition: Image.h:601
CopyPixel
static void CopyPixel(const T1 *src, T2 *dest)
Definition: Image.copyPixels.cpp:23
Def_VOCAB_PIXEL_MONO
PixelMono Def_VOCAB_PIXEL_MONO
Definition: Image.copyPixels.cpp:1235
yarp::sig::PixelRgba::g
unsigned char g
Definition: Image.h:489
VOCAB_PIXEL_HSV_FLOAT
@ VOCAB_PIXEL_HSV_FLOAT
Definition: Image.h:61
Log.h
yarp::sig::PixelBgr::r
unsigned char r
Definition: Image.h:528
yarp::sig::PixelBgra::g
unsigned char g
Definition: Image.h:502
yarp::sig::PixelBgra::a
unsigned char a
Definition: Image.h:504
yarp::sig::PixelMono
unsigned char PixelMono
Monochrome pixel type.
Definition: Image.h:436
yarp::sig::PixelFloat
float PixelFloat
Floating point pixel type.
Definition: Image.h:572
yarp::sig::PixelHsvFloat::h
float h
Definition: Image.h:624
yarp::sig::PixelRgbInt::b
yarp::os::NetInt32 b
Definition: Image.h:604
yarp::sig::PixelInt
yarp::os::NetInt32 PixelInt
32-bit integer pixel type.
Definition: Image.h:446
yarp::sig::PixelBgra::b
unsigned char b
Definition: Image.h:501
VOCAB_PIXEL_BGRA
@ VOCAB_PIXEL_BGRA
Definition: Image.h:52
DBG
#define DBG
Definition: Image.copyPixels.cpp:19
yarp::sig::PixelBgr::g
unsigned char g
Definition: Image.h:527
yarp::sig::PixelHsv
Packed HSV (hue/saturation/value pixel type.
Definition: Image.h:545
yarp::sig::PixelHsv::s
unsigned char s
Definition: Image.h:547
yarp::sig::PixelBgr::b
unsigned char b
Definition: Image.h:526
IplImage.h
yarp::sig::PixelRgbSigned::b
char b
Definition: Image.h:565
yarp::sig::PixelBgra::r
unsigned char r
Definition: Image.h:503
VOCAB_PIXEL_MONO_SIGNED
@ VOCAB_PIXEL_MONO_SIGNED
Definition: Image.h:56
yarp::sig::PixelRgbSigned::g
char g
Definition: Image.h:564
Image.h
yarp::sig::PixelRgba
Packed RGBA pixel type.
Definition: Image.h:475
VOCAB_PIXEL_INT
@ VOCAB_PIXEL_INT
Definition: Image.h:53
MAKE_CASE
#define MAKE_CASE(id1, id2)
Definition: Image.copyPixels.cpp:1252
yarp::sig::PixelRgba::r
unsigned char r
Definition: Image.h:488
VOCAB_PIXEL_MONO
@ VOCAB_PIXEL_MONO
Definition: Image.h:48
CopyPixels
static void CopyPixels(const T1 *osrc, int q1, T2 *odest, int q2, int w, int h, bool flip)
Definition: Image.copyPixels.cpp:1203
yarp::sig::PixelRgbFloat
Floating point RGB pixel type.
Definition: Image.h:579
yarp::sig::PixelRgb
Packed RGB pixel type.
Definition: Image.h:453
yarp::sig::PixelMono16
yarp::os::NetUint16 PixelMono16
16-bit monochrome pixel type.
Definition: Image.h:441
VOCAB_PIXEL_RGB
@ VOCAB_PIXEL_RGB
Definition: Image.h:50
yAssert
#define yAssert(x)
Definition: Log.h:297
VOCAB_PIXEL_MONO16
@ VOCAB_PIXEL_MONO16
Definition: Image.h:49
VOCAB_PIXEL_BGR
@ VOCAB_PIXEL_BGR
Definition: Image.h:55
yarp::sig::PixelHsv::h
unsigned char h
Definition: Image.h:546
VOCAB_PIXEL_HSV
@ VOCAB_PIXEL_HSV
Definition: Image.h:54
VOCAB_PIXEL_MONO_FLOAT
@ VOCAB_PIXEL_MONO_FLOAT
Definition: Image.h:59
yarp::sig::PixelRgb::r
unsigned char r
Definition: Image.h:454