16 for (
size_t r = 0; r < source.
height() - 2; r += 2)
18 unsigned char *destRow = dest.
getRow(r);
19 unsigned char *sourceRowCurrent = source.
getRow(r);
20 unsigned char *sourceRowNext = source.
getRow(r + 1);
23 for (
size_t c = 0; c < dest.
width() - 2; c += 2)
26 destRow[0] = sourceRowNext[0];
27 destRow[1] = sourceRowCurrent[0];
28 destRow[2] = sourceRowCurrent[1];
36 destRow[0] = sourceRowNext[0];
37 destRow[1] = sourceRowCurrent[1];
38 destRow[2] = sourceRowCurrent[0];
45 destRow = dest.
getRow(r + 1);
46 sourceRowCurrent = source.
getRow(r + 1);
47 sourceRowNext = source.
getRow(r + 2);
50 for (
size_t c = 0; c < dest.
width() - 2; c += 2)
53 destRow[0] = sourceRowCurrent[0];
54 destRow[1] = sourceRowCurrent[1];
55 destRow[2] = sourceRowNext[1];;
63 destRow[0] = sourceRowCurrent[1];
64 destRow[1] = sourceRowCurrent[0];
65 destRow[2] = sourceRowNext[0];
82 for (
size_t r = 0; r < source.
height() - 2; r += 2)
84 unsigned char *destRow = dest.
getRow(r);
85 unsigned char *sourceRowCurrent = source.
getRow(r);
86 unsigned char *sourceRowNext = source.
getRow(r + 1);
89 for (
size_t c = 0; c < source.
width() - 2; c += 2)
92 destRow[0] = sourceRowCurrent[1];
93 destRow[1] = sourceRowCurrent[0];
94 destRow[2] = sourceRowNext[0];;
102 destRow[0] = sourceRowCurrent[0];
103 destRow[1] = sourceRowCurrent[1];
104 destRow[2] = sourceRowNext[0];
106 destRow += pixelSize;
111 destRow = dest.
getRow(r + 1);
112 sourceRowCurrent = source.
getRow(r + 1);
113 sourceRowNext = source.
getRow(r + 2);
116 for (
size_t c = 0; c < dest.
width() - 2; c += 2)
119 destRow[0] = sourceRowNext[1];
120 destRow[1] = sourceRowCurrent[1];
121 destRow[2] = sourceRowCurrent[0];
124 destRow += pixelSize;
129 destRow[0] = sourceRowNext[0];
130 destRow[1] = sourceRowCurrent[0];
131 destRow[2] = sourceRowCurrent[1];
133 destRow += pixelSize;
bool deBayer_GRBG8_TO_RGB(yarp::sig::Image &source, yarp::sig::Image &dest, int pixelSize)
bool deBayer_BGGR8_TO_BGR(yarp::sig::Image &source, yarp::sig::Image &dest, int pixelSize)
bool deBayer_RGGB8_TO_RGB(yarp::sig::Image &source, yarp::sig::Image &dest, int pixelSize)
bool deBayer_GRBG8_TO_BGR(yarp::sig::Image &source, yarp::sig::Image &dest, int pixelSize)
bool deBayer_RGGB8_TO_BGR(yarp::sig::Image &source, yarp::sig::Image &dest, int pixelSize)
bool deBayer_BGGR8_TO_RGB(yarp::sig::Image &source, yarp::sig::Image &dest, int pixelSize)
#define YARP_FIXME_NOTIMPLEMENTED(what)
Base class for storing images.
unsigned char * getRow(size_t r)
Get the address of a the first byte of a row in memory.
size_t width() const
Gets width of image in pixels.
void resize(size_t imgWidth, size_t imgHeight)
Reallocate an image to be of a desired size, throwing away its current contents.
size_t height() const
Gets height of image in pixels.
virtual int getPixelCode() const
Gets pixel type identifier.