megapixels: Implement quick-debayering all Bayer 8-bits pixel formats

This application was supporting only debayering of BGGR8 streams:
this is an issue on cameras that are outputting a different format.

Implement quick-debayering of all Bayer 8-bits pixfmts in order to
solve wrong tint issues on many, many camera sensors.

This was tested on a Sony Exmor-RS IMX300 sensor.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
This commit is contained in:
AngeloGioacchino Del Regno
2020-10-25 17:30:57 +01:00
committed by Martijn Braam
parent 6a5f1078ef
commit b56182ca33
3 changed files with 75 additions and 36 deletions

8
main.c
View File

@@ -610,7 +610,9 @@ process_image(const int *p, int size)
}
pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, current.width / (skip*2), current.height / (skip*2));
pixels = gdk_pixbuf_get_pixels(pixbuf);
quick_debayer_bggr8((const uint8_t *)p, pixels, current.width, current.height, skip, current.blacklevel);
quick_debayer((const uint8_t *)p, pixels, current.fmt,
current.width, current.height, skip,
current.blacklevel);
if (current.rotate == 0) {
pixbufrot = pixbuf;
@@ -765,7 +767,9 @@ process_image(const int *p, int size)
// Update the thumbnail if this is the last frame
pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, current.width / (skip*2), current.height / (skip*2));
pixels = gdk_pixbuf_get_pixels(pixbuf);
quick_debayer_bggr8((const uint8_t *)p, pixels, current.width, current.height, skip, current.blacklevel);
quick_debayer((const uint8_t *)p, pixels, current.fmt,
current.width, current.height, skip,
current.blacklevel);
if (current.rotate == 0) {
pixbufrot = pixbuf;