Author: post
Date: 2009-07-07 19:07:32 +0200 (Tue, 07 Jul 2009)
New Revision: 2574

Modified:
   trunk/plugins/demosaic/demosaic.c
Log:
- Only do "none" demosaic, if pixels are in a 2x2 pattern.

Modified: trunk/plugins/demosaic/demosaic.c
===================================================================
--- trunk/plugins/demosaic/demosaic.c   2009-07-07 16:19:20 UTC (rev 2573)
+++ trunk/plugins/demosaic/demosaic.c   2009-07-07 17:07:32 UTC (rev 2574)
@@ -199,6 +199,14 @@
        filters = input->filters;
        filters &= ~((filters & 0x55555555) << 1);
 
+       /* Check if pattern is 2x2, otherwise we cannot do "none" demosaic */
+       if (demosaic->method != RS_DEMOSAIC_NONE) 
+               if (! ( (filters & 0xff ) == ((filters >> 8) & 0xff) &&
+                       ((filters >> 16) & 0xff) == ((filters >> 24) & 0xff) &&
+                       (filters & 0xff) == ((filters >> 24) &0xff)))
+                               demosaic->method = RS_DEMOSAIC_PPG;
+
+
        /* Populate new image with bayer data */
   if (demosaic->method != RS_DEMOSAIC_NONE) 
        {


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to