Revision: 56425
          http://sourceforge.net/p/brlcad/code/56425
Author:   mohitdaga
Date:     2013-08-01 18:29:56 +0000 (Thu, 01 Aug 2013)
Log Message:
-----------
Add operations file. This will contain all the airthmatic and related routines.

Modified Paths:
--------------
    brlcad/trunk/include/icv.h
    brlcad/trunk/src/libicv/CMakeLists.txt

Added Paths:
-----------
    brlcad/trunk/src/libicv/operations.c

Modified: brlcad/trunk/include/icv.h
===================================================================
--- brlcad/trunk/include/icv.h  2013-08-01 18:18:19 UTC (rev 56424)
+++ brlcad/trunk/include/icv.h  2013-08-01 18:29:56 UTC (rev 56425)
@@ -105,7 +105,6 @@
 };
 
 
-
 typedef struct icv_image icv_image_t;
 #define ICV_IMAGE_NULL ((struct icv_image *)0)
 
@@ -337,6 +336,14 @@
                               unsigned int ynum,
                               unsigned int xnum);
 
+/** @file libicv/operations.c
+ *
+ * This file contains routines for operations.
+ *
+ */
+
+void icv_sanitize(icv_image_t* img);
+
 /** @file libicv/filter.c
  *
  * This file contains routines for image filtering. This is done
@@ -345,6 +352,16 @@
  *
  */
 
+/**
+ * This function sanitizes the image.
+ * That is it makes the ranges between 0.0 to 1.0 for the data part.
+ * Also it adds ICV_SANITIZED flag.
+ *
+ * Note to check if an image(bif) is sanitized
+ *  (bif->flags&&ICV_SANITIZED)
+ */
+void icv_sanitize(icv_image_t* img);
+
 typedef enum {
     ICV_FILTER_LOW_PASS,
     ICV_FILTER_LAPLACIAN,
@@ -396,6 +413,7 @@
  */
 ICV_EXPORT extern int icv_fade(icv_image_t *img, double fraction);
 
+
 /** @} */
 /* end image utilities */
 

Modified: brlcad/trunk/src/libicv/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libicv/CMakeLists.txt      2013-08-01 18:18:19 UTC (rev 
56424)
+++ brlcad/trunk/src/libicv/CMakeLists.txt      2013-08-01 18:29:56 UTC (rev 
56425)
@@ -14,6 +14,7 @@
   crop.c
   filter.c
   encoding.c
+  operations.c
   pix.c
   bw.c
   )

Added: brlcad/trunk/src/libicv/operations.c
===================================================================
--- brlcad/trunk/src/libicv/operations.c                                (rev 0)
+++ brlcad/trunk/src/libicv/operations.c        2013-08-01 18:29:56 UTC (rev 
56425)
@@ -0,0 +1,58 @@
+/*                    O P E R A T I O N S . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2013 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file libicv/operations.c
+ *
+ * This file contains routines for operations.
+ *
+ */
+
+#include "common.h"
+
+#include <math.h>
+
+#include "bu.h"
+#include "icv.h"
+
+#include "bio.h"
+
+void icv_sanitize(icv_image_t* img)
+{
+    double *data = NULL;
+    size_t size;
+    data= img->data;
+    for (size = img->width*img->height*img->channels; size>0; size--) {
+       if(*data>1.0)
+           *data = 1.0;
+       else if (*data<0)
+           *data = 0;
+       data++;
+    }
+    img->flags |= ICV_SANITIZED;
+}
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */


Property changes on: brlcad/trunk/src/libicv/operations.c
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
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

Reply via email to