babl r313 - in trunk: . babl babl/base extensions



Author: jheller
Date: Tue May 20 22:11:12 2008
New Revision: 313
URL: http://svn.gnome.org/viewvc/babl?rev=313&view=rev

Log:
2008-05-21  Jan Heller  <jheller svn gnome org>

        * babl/babl-internal.h:
        * babl/base/type-u16.c:
        * babl/base/type-u32.c:
        * babl/base/type-u8.c:
        * extensions/CIE-Lab.c:
        * extensions/gegl-fixups.c:
        * extensions/gggl-lies.c:
        * extensions/gggl.c:
        * extensions/gimp-8bit.c:
        * extensions/util.h: fallback to floor function when rint function
        is not available.

        * configure.ac: added check for rint function.


Modified:
   trunk/ChangeLog
   trunk/babl/babl-internal.h
   trunk/babl/base/type-u16.c
   trunk/babl/base/type-u32.c
   trunk/babl/base/type-u8.c
   trunk/configure.ac
   trunk/extensions/CIE-Lab.c
   trunk/extensions/gegl-fixups.c
   trunk/extensions/gggl-lies.c
   trunk/extensions/gggl.c
   trunk/extensions/gimp-8bit.c
   trunk/extensions/util.h

Modified: trunk/babl/babl-internal.h
==============================================================================
--- trunk/babl/babl-internal.h	(original)
+++ trunk/babl/babl-internal.h	Tue May 20 22:11:12 2008
@@ -30,12 +30,15 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <math.h>
 #include "assert.h"
 
 #undef  _BABL_INTERNAL_H
 #include "babl.h"
 #define _BABL_INTERNAL_H
 
+#include "config.h"
+
 #include "babl-list.h"
 #include "babl-hash-table.h"
 #include "babl-db.h"
@@ -49,6 +52,13 @@
 #define random  rand
 #endif
 
+/* fallback to floor function when rint is not around */
+#ifndef HAVE_RINT
+# define rint(f)  ((long) floor (((double) f) + 0.5))
+#endif
+
+
+
 Babl * babl_conversion_find       (const void     *source,
                                          const void     *destination);
 double   babl_conversion_error          (BablConversion *conversion);

Modified: trunk/babl/base/type-u16.c
==============================================================================
--- trunk/babl/base/type-u16.c	(original)
+++ trunk/babl/base/type-u16.c	Tue May 20 22:11:12 2008
@@ -21,8 +21,7 @@
 #include <assert.h>
 #include <math.h>
 
-#include "babl.h"
-#include "babl-ids.h"
+#include "babl-internal.h"
 #include "babl-base.h"
 
 

Modified: trunk/babl/base/type-u32.c
==============================================================================
--- trunk/babl/base/type-u32.c	(original)
+++ trunk/babl/base/type-u32.c	Tue May 20 22:11:12 2008
@@ -21,8 +21,7 @@
 #include <assert.h>
 #include <math.h>
 
-#include "babl.h"
-#include "babl-ids.h"
+#include "babl-internal.h"
 #include "babl-base.h"
 
 static inline long

Modified: trunk/babl/base/type-u8.c
==============================================================================
--- trunk/babl/base/type-u8.c	(original)
+++ trunk/babl/base/type-u8.c	Tue May 20 22:11:12 2008
@@ -20,8 +20,7 @@
 #include <assert.h>
 #include <stdint.h>
 
-#include "babl.h"
-#include "babl-ids.h"
+#include "babl-internal.h"
 #include "babl-base.h"
 
 #include <math.h>

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Tue May 20 22:11:12 2008
@@ -247,8 +247,10 @@
 dnl ===========================================================================
 
 AC_SEARCH_LIBS([dlopen], [dl])
+AC_SEARCH_LIBS([rint], [m])
 
 AC_REPLACE_FUNCS(gettimeofday)
+AC_CHECK_FUNCS(rint)
 
 #BABL_PATH_SEPARATOR must be defined as a character.
 #BABL_DIR_SEPARATOR must be defined as a string.

Modified: trunk/extensions/CIE-Lab.c
==============================================================================
--- trunk/extensions/CIE-Lab.c	(original)
+++ trunk/extensions/CIE-Lab.c	Tue May 20 22:11:12 2008
@@ -16,12 +16,11 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#include "config.h"
-
 #include <math.h>
 #include <string.h>
 
 #include "babl.h"
+#include "extensions/util.h"
 
 
 int init (void);

Modified: trunk/extensions/gegl-fixups.c
==============================================================================
--- trunk/extensions/gegl-fixups.c	(original)
+++ trunk/extensions/gegl-fixups.c	Tue May 20 22:11:12 2008
@@ -39,11 +39,10 @@
  * TODO: error diffusion,
  */
 
-#include "config.h"
-
 #include "babl.h"
 
 #include "base/util.h"
+#include "extensions/util.h"
 
 
 #define INLINE    inline

Modified: trunk/extensions/gggl-lies.c
==============================================================================
--- trunk/extensions/gggl-lies.c	(original)
+++ trunk/extensions/gggl-lies.c	Tue May 20 22:11:12 2008
@@ -23,12 +23,11 @@
  *  Copyright 2003, 2004, 2005 Ãyvind KolÃs <pippin gimp org>
  */
 
-#include "config.h"
-
 #include <math.h>
 #include <string.h>
 
 #include "babl.h"
+#include "extensions/util.h"
 
 
 #define INLINE    inline

Modified: trunk/extensions/gggl.c
==============================================================================
--- trunk/extensions/gggl.c	(original)
+++ trunk/extensions/gggl.c	Tue May 20 22:11:12 2008
@@ -21,12 +21,11 @@
  *  Copyright 2003, 2004, 2005 Ãyvind KolÃs <pippin gimp org>
  */
 
-#include "config.h"
-
 #include <math.h>
 #include <string.h>
 
 #include "babl.h"
+#include "extensions/util.h"
 
 
 #define INLINE    inline

Modified: trunk/extensions/gimp-8bit.c
==============================================================================
--- trunk/extensions/gimp-8bit.c	(original)
+++ trunk/extensions/gimp-8bit.c	Tue May 20 22:11:12 2008
@@ -19,13 +19,12 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#include "config.h"
-
 #include <stdio.h>
 
 #include "babl.h"
 
 #include "base/util.h"
+#include "extensions/util.h"
 
 #define INLINE    inline
 

Modified: trunk/extensions/util.h
==============================================================================
--- trunk/extensions/util.h	(original)
+++ trunk/extensions/util.h	Tue May 20 22:11:12 2008
@@ -22,6 +22,13 @@
 #include <assert.h>
 #include <math.h>
 
+#include "config.h"
+
+#ifndef HAVE_RINT
+# define rint(f)  ((long) floor (((double) f) + 0.5))
+#endif
+
+
 #define BABL_PLANAR_SANITY  \
   {                         \
     assert(src_bands>0);    \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]