Revision: 56342
http://sourceforge.net/p/brlcad/code/56342
Author: mohitdaga
Date: 2013-07-30 16:52:31 +0000 (Tue, 30 Jul 2013)
Log Message:
-----------
Add icv_fade() function. This is an implementation from pixfade utility.
Modified Paths:
--------------
brlcad/trunk/include/icv.h
brlcad/trunk/src/libicv/filter.c
Modified: brlcad/trunk/include/icv.h
===================================================================
--- brlcad/trunk/include/icv.h 2013-07-30 16:48:51 UTC (rev 56341)
+++ brlcad/trunk/include/icv.h 2013-07-30 16:52:31 UTC (rev 56342)
@@ -360,8 +360,10 @@
icv_image_t* curr_img,
icv_image_t* new_img,
ICV_FILTER filter_type);
+
+
+ICV_EXPORT extern int icv_fade(icv_image_t* img, double fraction);
-
/** @} */
/* end image utilities */
Modified: brlcad/trunk/src/libicv/filter.c
===================================================================
--- brlcad/trunk/src/libicv/filter.c 2013-07-30 16:48:51 UTC (rev 56341)
+++ brlcad/trunk/src/libicv/filter.c 2013-07-30 16:52:31 UTC (rev 56342)
@@ -275,3 +275,24 @@
}
return 0;
}
+
+int icv_fade(icv_image_t* img, double fraction)
+{
+ size_t size;
+ double *data;
+
+ size= img->height*img->width*img->channels;
+
+ data = img->data;
+
+ if (fraction<0)
+ bu_exit(1,"Multiplier invalid. Image not Faded.");
+
+ for (;size>0; size--) {
+ *data = *data*fraction;
+ if(*data > 1)
+ *data= 1.0;
+ data++;
+ }
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits