[prev in list] [next in list] [prev in thread] [next in thread] 

List:       konq-bugs
Subject:    [Bug 58170] OpenEXR viewer for Konqueror
From:       Brad Hards <bradh () frogmouth ! net>
Date:       2004-02-01 4:40:51
Message-ID: 20040201044051.27074.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=58170      




------- Additional Comments From bradh@frogmouth.net  2004-02-01 05:40 -------
Subject: kdelibs

CVS commit by bhards: 

This patch adds a kimgio plugin for the OpenEXR file format. OpenEXR is a
product of Industrial Light and Magic, and offers high dynamic range.
Each pixel is a combination of a number of channels, and each channel
is normally a 16 bit floating point number. The plugin converts the
A, R, G and B channels to a QImage, with a standard exposure (0.0),
standard knee values (low = 0.0, high=5.0) and standard defog (0.0).
Changing these is trivial, but supporting variable values will require
an API that provides the ability to pass the values in.

You can find out more about OpenEXR at http://www.openexr.com. There are
sample images in the OpenEXR CVS tree, or you can download a tarball of
samples (http://savannah.nongnu.org/download/openexr/OpenEXR-images.tar.gz
note well: its 12 Meg).

This kimgio plugin depends on the availability of the OpenEXR library,
at least version 1.0.7. You can download RPMs and tarballs from 
http://savannah.nongnu.org/download/openexr/OpenEXR-images.tar.gz. I 
understand that gentoo ebuilds and .debs are also available. 

The stuff in kimgio/configure.in.in should obviously go to 
kde-common/admin/acinclude.m4.in, but I can't seem to get it committed, so
it can hang around in here for now.

There may be performance gains to be made - I'm committing this before
working on any performance issues though.

CCMAIL: 58170@bugs.kde.org


  A            kimgio/exr.cpp   1.1 [no copyright]
  A            kimgio/exr.h   1.1 [no copyright]
  A            kimgio/exr.kimgio   1.1
  M +14 -4     kimgio/Makefile.am   1.51
  M +59 -0     kimgio/configure.in.in   1.8
  M +3 -2      kio/kio/kimageio.h   1.15


--- kdelibs/kimgio/Makefile.am  #1.50:1.51
@@ -10,7 +10,13 @@
 endif
 
+if include_EXR_MODULES
+KIMGIO_EXR_MODULES=kimg_exr.la
+KIMGIO_EXR_DATAFILES=exr.kimgio
+KDE_CXXFLAGS = $(USE_EXCEPTIONS)
+endif
+
 kde_module_LTLIBRARIES= kimg_eps.la kimg_xview.la  \
                  $(KIMGIO_TIFF_MODULES) kimg_ico.la $(KIMGIO_JP2_MODULES) \
-             kimg_pcx.la kimg_tga.la
+             kimg_pcx.la kimg_tga.la $(KIMGIO_EXR_MODULES)
 
 KIMGIO_PLUGIN = -avoid-version -export-symbols-regex 'kimgio_.*_(read|write)'
@@ -48,7 +54,11 @@
 kimg_tga_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
 
-noinst_HEADERS= xview.h eps.h tiffr.h g3r.h ico.h jp2.h pcx.h tga.h
+kimg_exr_la_SOURCES = exr.cpp
+kimg_exr_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
+kimg_exr_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_EXR)
+
+noinst_HEADERS= xview.h eps.h tiffr.h g3r.h ico.h jp2.h pcx.h tga.h exr.h
 
-INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir)/dcop -I$(top_srcdir)/libltdl \
$(all_includes) +INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir)/dcop \
-I$(top_srcdir)/libltdl $(all_includes) -Drestrict= $(EXR_FLAGS)  
 servicedir = $(kde_servicesdir)
@@ -56,3 +66,3 @@
                ppm.kimgio xbm.kimgio jpeg.kimgio xv.kimgio eps.kimgio \
            $(KIMGIO_TIFF_DATAFILES) ico.kimgio $(KIMGIO_JP2_DATAFILES) \
-           gif.kimgio pcx.kimgio tga.kimgio
+           gif.kimgio pcx.kimgio tga.kimgio $(KIMGIO_EXR_DATAFILES)

--- kdelibs/kimgio/configure.in.in  #1.7:1.8
@@ -1,8 +1,67 @@
+AC_DEFUN(AC_FIND_LIBEXR,
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_CACHE_VAL(ac_cv_libexr,
+[
+  if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+
+  AC_MSG_CHECKING([for OpenEXR libraries])
+
+  if test "$PKG_CONFIG" = "no" ; then
+     echo "*** The pkg-config script could not be found. Make sure it is"
+     echo "*** in your path, or set the PKG_CONFIG environment variable"
+     echo "*** to the full path to pkg-config."
+     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get \
pkg-config." +  else
+     kde_save_LIBS="$LIBS"
+     LIBS="$LIBS $all_libraries $USER_LDFLAGS -lIlmImf -lImath -lHalf -lIex $LIBZ \
-lm" +     AC_LANG_SAVE
+     AC_LANG_CPLUSPLUS
+     kde_save_CXXFLAGS="$CXXFLAGS"
+     EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
+     CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
+
+    AC_TRY_LINK(dnl
+        [
+        #include <ImfRgbaFile.h>
+        ],
+        [
+        using namespace Imf;
+        RgbaInputFile file ("dummy");
+        return 0;
+        ],
+        eval "ac_cv_libexr='-lIlmImf -lImath -lHalf -lIex $LIBZ -lm'",
+        eval "ac_cv_libexr=no"
+    )
+    LIBS="$kde_save_LIBS"
+    CXXFLAGS="$kde_save_CXXFLAGS"
+    AC_LANG_RESTORE
+    ])dnl
+    if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
+        AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
+        LIB_EXR="$ac_cv_libexr"
+        AC_MSG_RESULT($ac_cv_libexr)
+    else
+        AC_MSG_RESULT(no)
+        LIB_EXR=""
+    fi
+  fi
+  AC_SUBST(LIB_EXR)
+  AC_SUBST(EXR_FLAGS)
+])
+
+
+
 AC_FIND_TIFF
 AC_FIND_JPEG
 AC_FIND_PNG
 AC_FIND_JASPER
+AC_FIND_LIBEXR
 
 AM_CONDITIONAL(include_TIFF_MODULES, test -n "$LIBTIFF")
 AM_CONDITIONAL(include_JP2_MODULES, test -n "$LIB_JASPER")
+AM_CONDITIONAL(include_EXR_MODULES, test -n "$LIB_EXR")
 

--- kdelibs/kio/kio/kimageio.h  #1.14:1.15
@@ -30,4 +30,5 @@
  * @li BMP     \<read\> \<write\>
  * @li EPS     \<read\> \<write\>
+ * @li EXR     \<read\>
  * @li G3      \<read\>
  * @li GIF     \<read\>
_______________________________________________
Konq-bugs mailing list
Konq-bugs@mail.kde.org
https://mail.kde.org/mailman/listinfo/konq-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic