Revision: 56427
http://sourceforge.net/p/brlcad/code/56427
Author: mohitdaga
Date: 2013-08-01 18:36:26 +0000 (Thu, 01 Aug 2013)
Log Message:
-----------
Adding icv_add_val function. This adds a constant value to all the pixels of an
image.
Modified Paths:
--------------
brlcad/trunk/include/icv.h
brlcad/trunk/src/libicv/operations.c
Modified: brlcad/trunk/include/icv.h
===================================================================
--- brlcad/trunk/include/icv.h 2013-08-01 18:36:23 UTC (rev 56426)
+++ brlcad/trunk/include/icv.h 2013-08-01 18:36:26 UTC (rev 56427)
@@ -362,6 +362,16 @@
*/
void icv_sanitize(icv_image_t* img);
+/**
+ * This adds a double value to all the pixels of the image.
+ * Also if the flag ICV_OPERATIONS_MODE is set this doesnt santizes
+ * the image.
+ *
+ * Note to set the flag for a bif (icv_image struct);
+ * bif->flags |= ICV_OPERATIONS_MODE;
+ */
+void icv_add_val(icv_image_t* img, double val);
+
typedef enum {
ICV_FILTER_LOW_PASS,
ICV_FILTER_LAPLACIAN,
Modified: brlcad/trunk/src/libicv/operations.c
===================================================================
--- brlcad/trunk/src/libicv/operations.c 2013-08-01 18:36:23 UTC (rev
56426)
+++ brlcad/trunk/src/libicv/operations.c 2013-08-01 18:36:26 UTC (rev
56427)
@@ -47,6 +47,24 @@
img->flags |= ICV_SANITIZED;
}
+void icv_add_val(icv_image_t* img, double val)
+{
+ double *data = NULL;
+ size_t size;
+
+ data = img->data;
+
+ for (size = img->width*img->height*img->channels; size>0; size--) {
+ *data += val;
+ data++;
+ }
+
+ if(img->flags && ICV_OPERATIONS_MODE)
+ img->flags&=(!ICV_SANITIZED);
+ else
+ icv_sanitize(img);
+}
+
/*
* Local Variables:
* tab-width: 8
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