plug-ins: merge file-rawtherapee/ into file-raw/

and use the same file-formats.h
This commit is contained in:
Michael Natterer 2017-07-24 20:58:25 +02:00
parent 0369ac9b9f
commit 87438c885a
8 changed files with 42 additions and 366 deletions

View File

@ -2523,7 +2523,6 @@ plug-ins/file-ico/Makefile
plug-ins/file-jpeg/Makefile
plug-ins/file-psd/Makefile
plug-ins/file-raw/Makefile
plug-ins/file-rawtherapee/Makefile
plug-ins/file-sgi/Makefile
plug-ins/file-tiff/Makefile
plug-ins/file-webp/Makefile

View File

@ -41,7 +41,6 @@ SUBDIRS = \
file-jpeg \
file-psd \
file-raw \
file-rawtherapee \
file-sgi \
file-tiff \
$(file_webp) \

View File

@ -12,6 +12,7 @@ endif
# if HAVE_WINDRES
# include $(top_srcdir)/build/windows/gimprc-plug-ins.rule
# file_darktable_RC = file-darktable.rc.o
# file_rawtherapee_RC = file-rawtherapee.rc.o
# endif
AM_LDFLAGS = $(mwindows)
@ -24,12 +25,18 @@ AM_CPPFLAGS = \
$(GTK_CFLAGS) \
$(GEGL_CFLAGS)
libexec_PROGRAMS = file-darktable
libexec_PROGRAMS = \
file-darktable \
file-rawtherapee
file_darktable_SOURCES = \
file-darktable.c \
file-formats.h
file_rawtherapee_SOURCES = \
file-rawtherapee.c \
file-formats.h
file_darktable_LDADD = \
$(libgimp) \
$(libgimpbase) \
@ -39,6 +46,15 @@ file_darktable_LDADD = \
$(INTLLIBS) \
$(file_darktable_RC)
file_rawtherapee_LDADD = \
$(libgimp) \
$(libgimpbase) \
$(CAIRO_LIBS) \
$(GEGL_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(file_rawtherapee_RC)
filerawdata_DATA = \
file-darktable-export-on-exit.lua \
file-darktable-get-size.lua

View File

@ -140,10 +140,17 @@ init (void)
for (i = 0; i < G_N_ELEMENTS (file_formats); i++)
{
const FileFormat *format = &file_formats[i];
gchar *load_proc;
gchar *load_blurb;
gchar *load_help;
gimp_install_procedure (format->load_proc,
format->load_blurb,
format->load_help,
load_proc = g_strdup_printf (format->load_proc_format, "rawtherapee");
load_blurb = g_strdup_printf (format->load_blurb_format, "rawtherapee");
load_help = g_strdup_printf (format->load_help_format, "rawtherapee");
gimp_install_procedure (load_proc,
load_blurb,
load_help,
"Alberto Griggio",
"Alberto Griggio",
"2017",
@ -154,15 +161,19 @@ init (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime (format->load_proc,
gimp_register_file_handler_mime (load_proc,
format->mime_type);
gimp_register_file_handler_raw (format->load_proc);
gimp_register_magic_load_handler (format->load_proc,
gimp_register_file_handler_raw (load_proc);
gimp_register_magic_load_handler (load_proc,
format->extensions,
"",
format->magic);
gimp_register_thumbnail_loader (format->load_proc, LOAD_THUMB_PROC);
gimp_register_thumbnail_loader (load_proc, LOAD_THUMB_PROC);
g_free (load_proc);
g_free (load_blurb);
g_free (load_help);
}
}
@ -204,9 +215,13 @@ run (const gchar *name,
/* check if the format passed is actually supported & load */
for (i = 0; i < G_N_ELEMENTS (file_formats); i++)
{
const FileFormat *format = &file_formats[i];
const FileFormat *format = &file_formats[i];
gchar *load_proc = NULL;
if (format->load_proc && ! strcmp (name, format->load_proc))
if (format->load_proc_format)
load_proc = g_strdup_printf (format->load_proc_format, "rawtherapee");
if (load_proc && ! strcmp (name, load_proc))
{
image_ID = load_image (param[1].data.d_string, run_mode, &error);

View File

@ -1,7 +0,0 @@
/Makefile.in
/Makefile
/.deps
/_libs
/.libs
/file-rawtherapee
/file-rawtherapee.exe

View File

@ -1,32 +0,0 @@
## Process this file with automake to produce Makefile.in
libgimp = $(top_builddir)/libgimp/libgimp-$(GIMP_API_VERSION).la
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
filerawtherapeedatadir = $(gimpdatadir)/file-rawtherapee
if OS_WIN32
mwindows = -mwindows
endif
AM_LDFLAGS = $(mwindows)
libexecdir = $(gimpplugindir)/plug-ins
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(includedir) \
$(GTK_CFLAGS) \
$(GEGL_CFLAGS)
libexec_PROGRAMS = file-rawtherapee
file_rawtherapee_SOURCES = \
file-rawtherapee.c \
file-formats.h
file_rawtherapee_LDADD = \
$(libgimp) \
$(libgimpbase) \
$(GLIB_LIBS) \
$(GEGL_LIBS)

View File

@ -1,313 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* file-rawtherapee.c -- raw file format plug-in that uses rawtherapee
* Copyright (C) 2016 Tobias Ellinghaus <me@houz.org>
* Copyright (C) 2017 Alberto Griggio <alberto.griggio@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* These are the raw formats that file-rawtherapee will register */
typedef struct _FileFormat FileFormat;
struct _FileFormat
{
const gchar *file_type;
const gchar *mime_type;
const gchar *extensions;
const gchar *magic;
const gchar *load_proc;
const gchar *load_blurb;
const gchar *load_help;
};
static const FileFormat file_formats[] =
{
{
N_("Raw Canon"),
"image/x-canon-cr2,image/x-canon-crw",
"cr2,crw",
NULL,
"file-rawtherapee-canon-load",
"Load files in the Canon raw formats via rawtherapee",
"This plug-in loads files in Canon's raw formats by calling rawtherapee."
},
{
N_("Raw Nikon"),
"image/x-nikon-nef,image/x-nikon-nrw",
"nef,nrw",
NULL,
"file-rawtherapee-nikon-load",
"Load files in the Nikon raw formats via rawtherapee",
"This plug-in loads files in Nikon's raw formats by calling rawtherapee."
},
{
N_("Raw Hasselblad"),
"image/x-hasselblad-3fr,image/x-hasselblad-fff",
"3fr,fff",
NULL,
"file-rawtherapee-hasselblad-load",
"Load files in the Hasselblad raw formats via rawtherapee",
"This plug-in loads files in Hasselblad's raw formats by calling rawtherapee."
},
{
N_("Raw Sony"),
"image/x-sony-arw,image/x-sony-srf,image/x-sony-sr2",
"arw,srf,sr2",
NULL,
"file-rawtherapee-sony-load",
"Load files in the Sony raw formats via rawtherapee",
"This plug-in loads files in Sony's raw formats by calling rawtherapee."
},
{
N_("Raw Casio BAY"),
"image/x-casio-bay",
"bay",
NULL,
"file-rawtherapee-bay-load",
"Load files in the BAY raw format via rawtherapee",
"This plug-in loads files in Casio's raw BAY format by calling rawtherapee."
},
{
N_("Raw Phantom Software CINE"),
"", /* FIXME: find a mime type */
"cine,cin",
NULL,
"file-rawtherapee-cine-load",
"Load files in the CINE raw format via rawtherapee",
"This plug-in loads files in Phantom Software's raw CINE format by calling rawtherapee."
},
{
N_("Raw Sinar"),
"", /* FIXME: find a mime type */
"cs1,ia,sti",
NULL,
"file-rawtherapee-sinar-load",
"Load files in the Sinar raw formats via rawtherapee",
"This plug-in loads files in Sinar's raw formats by calling rawtherapee."
},
{
N_("Raw Kodak"),
"image/x-kodak-dc2,image/x-kodak-dcr,image/x-kodak-kdc,image/x-kodak-k25,image/x-kodak-kc2",
"dc2,dcr,kdc,k25,kc2",
NULL,
"file-rawtherapee-kodak-load",
"Load files in the Kodak raw formats via rawtherapee",
"This plug-in loads files in Kodak's raw formats by calling rawtherapee."
},
{
N_("Raw Adobe DNG Digital Negative"),
"image/x-adobe-dng",
"dng",
NULL,
"file-rawtherapee-dng-load",
"Load files in the DNG raw format via rawtherapee",
"This plug-in loads files in the Adobe Digital Negative DNG format by calling rawtherapee."
},
{
N_("Raw Epson ERF"),
"image/x-epson-erf",
"erf",
NULL,
"file-rawtherapee-erf-load",
"Load files in the ERF raw format via rawtherapee",
"This plug-in loads files in Epson's raw ERF format by calling rawtherapee."
},
{
N_("Raw Phase One"),
"image/x-phaseone-cap,image/x-phaseone-iiq",
"cap,iiq",
NULL,
"file-rawtherapee-phaseone-load",
"Load files in the Phase One raw formats via rawtherapee",
"This plug-in loads files in Phase One's raw formats by calling rawtherapee."
},
{
N_("Raw Minolta"),
"image/x-minolta-mdc,image/x-minolta-mrw",
"mdc,mrw",
NULL,
"file-rawtherapee-minolta-load",
"Load files in the Minolta raw formats via rawtherapee",
"This plug-in loads files in Minolta's raw formats by calling rawtherapee."
},
{
N_("Raw Mamiya MEF"),
"image/x-mamiya-mef",
"mef", NULL,
"file-rawtherapee-mef-load",
"Load files in the MEF raw format via rawtherapee",
"This plug-in loads files in Mamiya's raw MEF format by calling rawtherapee."
},
{
N_("Raw Leaf MOS"),
"image/x-leaf-mos",
"mos",
NULL,
"file-rawtherapee-mos-load",
"Load files in the MOS raw format via rawtherapee",
"This plug-in loads files in Leaf's raw MOS format by calling rawtherapee."
},
{
N_("Raw Olympus ORF"),
"image/x-olympus-orf",
"orf",
NULL,
"file-rawtherapee-orf-load",
"Load files in the ORF raw format via rawtherapee",
"This plug-in loads files in Olympus' raw ORF format by calling rawtherapee."
},
{
N_("Raw Pentax PEF"),
"image/x-pentax-pef,image/x-pentax-raw",
"pef,raw",
NULL,
"file-rawtherapee-pef-load",
"Load files in the PEF raw format via rawtherapee",
"This plug-in loads files in Pentax' raw PEF format by calling rawtherapee."
},
{
N_("Raw Logitech PXN"),
"image/x-pxn", /* FIXME: is that the correct mime type? */
"pxn",
NULL,
"file-rawtherapee-pxn-load",
"Load files in the PXN raw format via rawtherapee",
"This plug-in loads files in Logitech's raw PXN format by calling rawtherapee."
},
{
N_("Raw Apple QuickTake QTK"),
"", /* FIXME: find a mime type */
"qtk",
NULL,
"file-rawtherapee-qtk-load",
"Load files in the QTK raw format via rawtherapee",
"This plug-in loads files in Apple's QuickTake QTK raw format by calling rawtherapee."
},
{
N_("Raw Fujifilm RAF"),
"image/x-fuji-raf",
"raf",
NULL,
"file-rawtherapee-raf-load",
"Load files in the RAF raw format via rawtherapee",
"This plug-in loads files in Fujifilm's raw RAF format by calling rawtherapee."
},
{
N_("Raw Panasonic"),
"image/x-panasonic-raw,image/x-panasonic-rw2",
"raw,rw2",
NULL,
"file-rawtherapee-panasonic-load",
"Load files in the Panasonic raw formats via rawtherapee",
"This plug-in loads files in Panasonic's raw formats by calling rawtherapee."
},
{
N_("Raw Digital Foto Maker RDC"),
"", /* FIXME: find a mime type */
"rdc",
NULL,
"file-rawtherapee-rdc-load",
"Load files in the RDC raw format via rawtherapee",
"This plug-in loads files in Digital Foto Maker's raw RDC format by calling rawtherapee."
},
{
N_("Raw Leica RWL"),
"image/x-leica-rwl",
"rwl",
NULL,
"file-rawtherapee-rwl-load",
"Load files in the RWL raw format via rawtherapee",
"This plug-in loads files in Leica's raw RWL format by calling rawtherapee."
},
{
N_("Raw Samsung SRW"),
"image/x-samsung-srw",
"srw",
NULL,
"file-rawtherapee-srw-load",
"Load files in the SRW raw format via rawtherapee",
"This plug-in loads files in Samsung's raw SRW format by calling rawtherapee."
},
{
N_("Raw Sigma X3F"),
"image/x-sigma-x3f",
"x3f",
NULL,
"file-rawtherapee-x3f-load",
"Load files in the X3F raw format via rawtherapee",
"This plug-in loads files in Sigma's raw X3F format by calling rawtherapee."
},
{
N_("Raw Arriflex ARI"),
"",
"ari",
NULL,
"file-rawtherapee-ari-load",
"Load files in the ARI raw format via rawtherapee",
"This plug-in loads files in Arriflex' raw ARI format by calling rawtherapee."
}
};

View File

@ -118,8 +118,7 @@ plug-ins/file-psd/psd-util.c
plug-ins/file-psd/psd.c
plug-ins/file-raw/file-darktable.c
plug-ins/file-raw/file-formats.h
plug-ins/file-rawtherapee/file-formats.h
plug-ins/file-rawtherapee/file-rawtherapee.c
plug-ins/file-raw/file-rawtherapee.c
plug-ins/file-sgi/sgi.c
plug-ins/file-tiff/file-tiff.c
plug-ins/file-tiff/file-tiff-load.c