summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Kolås <pippin@gimp.org>2015-06-08 19:32:52 +0200
committerØyvind Kolås <pippin@gimp.org>2015-06-08 19:32:52 +0200
commit73ca89e42f5b0f0290d08be05650f0b86ffe5ec9 (patch)
tree05cb536d684199086374a836476fc1ad1b663e9f
parentf8447e2cebf51d80d76398fa7e91bbcd892a3200 (diff)
openraw: remove in favor of libraw
-rw-r--r--configure.ac17
-rw-r--r--operations/external/Makefile.am7
-rw-r--r--operations/external/openraw.c262
3 files changed, 0 insertions, 286 deletions
diff --git a/configure.ac b/configure.ac
index 52b2572c..96f24101 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,6 @@ m4_define([libv4l2_required_version], [1.0.1])
m4_define([lua_required_version], [5.1.0])
m4_define([openexr_required_version], [0.0.0])
m4_define([libraw_required_version], [0.16.0])
-m4_define([openraw_required_version], [0.0.5])
m4_define([pango_required_version], [0.0.0])
m4_define([pangocairo_required_version], [0.0.0])
m4_define([png_required_version], [0.0.0])
@@ -871,21 +870,6 @@ AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
-######################
-# Check for libopenraw
-######################
-
-AC_ARG_WITH(libopenraw, [ --without-libopenraw build without openraw support])
-
-have_libopenraw="no"
-if test "x$with_libopenraw" != "xno"; then
- PKG_CHECK_MODULES(OPENRAW, libopenraw-1.0 >= openraw_required_version,
- have_libopenraw="yes",
- have_libopenraw="no (openraw library not found)")
-fi
-
-AM_CONDITIONAL(HAVE_OPENRAW, test "$have_libopenraw" = "yes")
-
AC_SUBST(OPENRAW_CFLAGS)
AC_SUBST(OPENRAW_LIBS)
@@ -1311,7 +1295,6 @@ Optional dependencies:
OpenEXR: $have_openexr
rsvg: $have_librsvg
SDL: $have_sdl
- openraw: $have_libopenraw
libraw: $have_libraw
Jasper: $have_jasper
graphviz: $have_graphviz
diff --git a/operations/external/Makefile.am b/operations/external/Makefile.am
index 2a72c2a5..eb5af450 100644
--- a/operations/external/Makefile.am
+++ b/operations/external/Makefile.am
@@ -82,13 +82,6 @@ sdl_display_la_LIBADD = $(op_libs) $(SDL_LIBS)
sdl_display_la_CFLAGS = $(AM_CFLAGS) $(SDL_CFLAGS)
endif
-#if HAVE_OPENRAW
-#ops += openraw.la
-#openraw_la_SOURCES = openraw.c
-#openraw_la_LIBADD = $(op_libs) $(OPENRAW_LIBS)
-#openraw_la_CFLAGS = $(AM_CFLAGS) $(OPENRAW_CFLAGS)
-#endif
-
if HAVE_LIBRAW
ops += raw-load.la
raw_load_la_SOURCES = raw-load.c
diff --git a/operations/external/openraw.c b/operations/external/openraw.c
deleted file mode 100644
index 2c0c5090..00000000
--- a/operations/external/openraw.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/* This file is an image processing operation for GEGL
- *
- * GEGL is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * GEGL 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 GEGL; if not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright 2006 Øyvind Kolås <pippin@gimp.org>
- * Copyright 2008 Hubert Figuière <hub@figuiere.net>
- */
-
-#include "config.h"
-#include <glib/gi18n-lib.h>
-
-#ifdef GEGL_PROPERTIES
-
-property_file_path (path, "File", "")
- description (_("Path of file to load."))
-
-#else
-
-#include "gegl-plugin.h"
-struct _GeglOp
-{
- GeglOperationSource parent_instance;
- gpointer properties;
-
- gchar *cached_path; /* Path we have cached. Detects need for recache. */
-};
-
-typedef struct
-{
- GeglOperationSourceClass parent_class;
-} GeglOpClass;
-
-#define GEGL_OP_C_SOURCE openraw.c
-#include "gegl-op.h"
-GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_SOURCE)
-
-#include <stdio.h>
-#include <libopenraw/libopenraw.h>
-
-
-/* We can't release the pixel data itself, so we ignore the first argument
- * and release the libopenraw structure instead.
- */
-static void
-destroy_rawdata (void * rawdata)
-{
- or_rawdata_release (rawdata);
-}
-
-
-static void
-free_buffer (GeglOperation * operation)
-{
- GeglProperties *o = GEGL_PROPERTIES (operation);
- GeglOp *self = GEGL_OP(operation);
-
- if (o->user_data)
- {
- g_assert (self->cached_path);
- g_object_unref (o->user_data);
- o->user_data = NULL;
- }
-
- if (self->cached_path)
- {
- g_free (self->cached_path);
- self->cached_path = NULL;
- }
-}
-
-
-/* Loads the RAW pixel data from the specified path in chant parameters into
- * a GeglBuffer for caching. Maintains copy of the path that has been cached
- * so we can check for modifications and recache.
- */
-static GeglBuffer *
-load_buffer (GeglOperation *operation)
-{
- GeglProperties *o = GEGL_PROPERTIES (operation);
- GeglOp *self = GEGL_OP(operation);
-
- ORRawDataRef rawdata;
- ORRawFileRef rawfile;
-
- /* If the path has changed since last time, destroy our cache */
- if (!self->cached_path || strcmp (self->cached_path, o->path))
- {
- free_buffer(operation);
- }
-
- if (o->user_data)
- {
- return o->user_data;
- }
- g_assert (self->cached_path == NULL);
-
- /* Gather the file and data resources needed for our cache */
- rawfile = or_rawfile_new(o->path, OR_RAWFILE_TYPE_UNKNOWN);
- if (!rawfile)
- {
- return NULL;
- }
-
- rawdata = or_rawdata_new();
- if(or_rawfile_get_rawdata(rawfile, rawdata, OR_OPTIONS_NONE) != OR_ERROR_NONE)
- {
- goto clean_file;
- }
-
- if(or_rawdata_format (rawdata) != OR_DATA_TYPE_CFA)
- {
- goto clean_file;
- }
-
- /* Build a gegl_buffer, backed with the libopenraw supplied data. */
- {
- GeglRectangle extent = { 0, 0, 0, 0 };
- guint32 width, height;
- void * data = or_rawdata_data(rawdata);
-
- or_rawdata_dimensions(rawdata, &width, &height);
- g_assert (height > 0 && width > 0);
- extent.width = width;
- extent.height = height;
-
- g_assert (o->user_data == NULL);
- o->user_data = gegl_buffer_linear_new_from_data(data,
- babl_format ("Y u16"),
- &extent,
- GEGL_AUTO_ROWSTRIDE,
- destroy_rawdata,
- rawdata);
- }
-
- self->cached_path = g_strdup (o->path);
-
-clean_file:
- or_rawfile_release(rawfile);
-
- return o->user_data;
-}
-
-
-static void
-prepare (GeglOperation *operation)
-{
- gegl_operation_set_format (operation, "output", babl_format ("Y u16"));
-}
-
-
-static GeglRectangle
-get_bounding_box (GeglOperation *operation)
-{
- GeglProperties *o = GEGL_PROPERTIES (operation);
- if (!load_buffer (operation))
- {
- GeglRectangle nullrect = { 0, 0, 0, 0 };
- return nullrect;
- }
-
- return *gegl_buffer_get_extent (o->user_data);
-}
-
-
-static GeglRectangle
-get_cached_region (GeglOperation *operation,
- const GeglRectangle *roi)
-{
- return get_bounding_box (operation);
-}
-
-
-static gboolean
-process (GeglOperation *operation,
- GeglOperationContext *context,
- const gchar *output_pad,
- const GeglRectangle *result,
- gint level)
-{
- GeglProperties *o = GEGL_PROPERTIES (operation);
- g_assert (g_str_equal (output_pad, "output"));
-
- if (!load_buffer (operation))
- {
- return FALSE;
- }
-
- /* Give the operation a reference to the object, and keep a reference
- * ourselves. We desperately do not want to delete our cached object, as
- * we continue to service metadata calls after giving the object to the
- * context.
- */
- g_assert(o->user_data);
- gegl_operation_context_take_object (context, "output", G_OBJECT (o->user_data));
- g_object_ref (G_OBJECT (o->user_data));
-
- return TRUE;
-}
-
-
-#include <glib-object.h>
-
-static void
-finalize (GObject *object)
-{
- free_buffer (GEGL_OPERATION (object));
-
- G_OBJECT_CLASS (gegl_op_parent_class)->finalize (object);
-}
-
-
-static void
-gegl_op_class_init (GeglOpClass *klass)
-{
- static gboolean done = FALSE;
-
- GObjectClass *object_class;
- GeglOperationClass *operation_class;
-
- object_class = G_OBJECT_CLASS (klass);
- operation_class = GEGL_OPERATION_CLASS (klass);
-
- object_class->finalize = finalize;
-
- operation_class->process = process;
- operation_class->get_bounding_box = get_bounding_box;
- operation_class->get_cached_region = get_cached_region;
- operation_class->prepare = prepare;
-
- gegl_operation_class_set_keys (operation_class,
- "name", "gegl:openraw-load",
- "title", _("OpenRAW File Loader"),
- "categories", "hidden",
- "description", "Camera RAW image loader using Open RAW",
- NULL);
-
- if (done)
- return;
-
- /* query libopenraw instead. need a new API */
- gegl_extension_handler_register (".cr2", "gegl:openraw-load");
- gegl_extension_handler_register (".crw", "gegl:openraw-load");
- gegl_extension_handler_register (".erf", "gegl:openraw-load");
- gegl_extension_handler_register (".mrw", "gegl:openraw-load");
- gegl_extension_handler_register (".nef", "gegl:openraw-load");
- gegl_extension_handler_register (".dng", "gegl:openraw-load");
-
- done = TRUE;
-}
-
-#endif