|
|
@ -16,8 +16,8 @@ void debayer_grbg16_simple (uint16_t * src, int src_w, int src_h,
|
|
|
|
for (ys = 0, yd = 0; ys < src_h && yd < dst_h; ys++, yd++) {
|
|
|
|
for (ys = 0, yd = 0; ys < src_h && yd < dst_h; ys++, yd++) {
|
|
|
|
for (xs = 0, xd = 0; xs < src_w; xs++) {
|
|
|
|
for (xs = 0, xd = 0; xs < src_w; xs++) {
|
|
|
|
|
|
|
|
|
|
|
|
/* read the pixel but only the lower 8bit */
|
|
|
|
/* read the pixel but only the higher 8bit, assuming data is little endian */
|
|
|
|
t = *(src++) & 0x00FF;
|
|
|
|
t = *(src++) >> 8;
|
|
|
|
|
|
|
|
|
|
|
|
if (xs & 1) {
|
|
|
|
if (xs & 1) {
|
|
|
|
if (ys & 1) {
|
|
|
|
if (ys & 1) {
|
|
|
@ -40,9 +40,9 @@ void debayer_grbg16_simple (uint16_t * src, int src_w, int src_h,
|
|
|
|
/* only paint the image if the source is within the destination */
|
|
|
|
/* only paint the image if the source is within the destination */
|
|
|
|
if (xd < dst_w) {
|
|
|
|
if (xd < dst_w) {
|
|
|
|
/* set the pixel */
|
|
|
|
/* set the pixel */
|
|
|
|
*(dst++) = b;
|
|
|
|
|
|
|
|
*(dst++) = g;
|
|
|
|
|
|
|
|
*(dst++) = r;
|
|
|
|
*(dst++) = r;
|
|
|
|
|
|
|
|
*(dst++) = g;
|
|
|
|
|
|
|
|
*(dst++) = b;
|
|
|
|
xd++;
|
|
|
|
xd++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|