Revision: 56253
          http://sourceforge.net/p/brlcad/code/56253
Author:   mohitdaga
Date:     2013-07-27 08:14:16 +0000 (Sat, 27 Jul 2013)
Log Message:
-----------
Adding additional feature in bw_save. This now has ability to handle and save 
rgb(3 channel pix) images in bw format. This usage rgb2gray function.

Modified Paths:
--------------
    brlcad/trunk/src/libicv/fileformat.c

Modified: brlcad/trunk/src/libicv/fileformat.c
===================================================================
--- brlcad/trunk/src/libicv/fileformat.c        2013-07-27 04:04:49 UTC (rev 
56252)
+++ brlcad/trunk/src/libicv/fileformat.c        2013-07-27 08:14:16 UTC (rev 
56253)
@@ -261,10 +261,11 @@
     long int ret;
     long int size;
 
-    /* TODO :: ADD functions which converts RGB to GRAY Color Space */
-    if (bif->color_space != ICV_COLOR_SPACE_GRAY) {
-       bu_log("bw_save : Color Space conflict");
-       return -1;
+    if (bif->color_space == ICV_COLOR_SPACE_RGB) {
+       icv_image_rgb2gray(bif, 0, 0, 0, 0, 0);
+    } else if (bif->color_space != ICV_COLOR_SPACE_GRAY) {
+        bu_log("bw_save : Color Space conflict");
+        return -1;
     }
     data =  data2uchar(bif);
     size = bif->height*bif->width;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to