diff options
author | Hubert Figuière <hub@figuiere.net> | 2023-07-31 16:15:22 -0400 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2023-07-31 19:18:24 -0400 |
commit | f212fd299543bb6c1d4bed8dc975135e1be997b8 (patch) | |
tree | 8c137872ae93ffbf9c52f206fb1ab84fa2afe6bd /demo | |
parent | e17c5af05aa6c9de795d0da76385d1c342a2d378 (diff) |
gdkpixbuf: remove GDK pixbuf
See https://gitlab.freedesktop.org/libopenraw/libopenraw/-/issues/7
See https://gitlab.freedesktop.org/libopenraw/libopenraw/-/issues/10
See https://gitlab.freedesktop.org/libopenraw/libopenraw/-/issues/9
See https://gitlab.freedesktop.org/libopenraw/libopenraw/-/issues/3
Diffstat (limited to 'demo')
-rw-r--r-- | demo/Makefile.am | 19 | ||||
-rw-r--r-- | demo/gdk.c | 68 | ||||
-rw-r--r-- | demo/pixbufload.c | 107 |
3 files changed, 3 insertions, 191 deletions
diff --git a/demo/Makefile.am b/demo/Makefile.am index 622b91f..e27bcf8 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -1,18 +1,11 @@ -if BUILD_GNOME_SUPPORT -GNOME_BINARIES = gdk pixbufload -endif +noinst_PROGRAMS = extensions thumbc ccfa ppmload -noinst_PROGRAMS = extensions thumbc ccfa ppmload $(GNOME_BINARIES) - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib \ - -I$(top_srcdir)/gnome/include \ - @LIBGDKPIXBUF_CFLAGS@ @BOOST_CPPFLAGS@ +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_sr2cdir)/lib \ + @BOOST_CPPFLAGS@ LIBOPENRAW_LIBS = $(top_builddir)/lib/libopenraw.la -lm -LIBOPENRAWGNOME_LIBS = $(top_builddir)/gnome/libopenrawgnome.la \ - @LIBGDKPIXBUF_LIBS@ extensions_SOURCES = extensions.cpp extensions_LDADD = $(LIBOPENRAW_LIBS) @@ -23,11 +16,5 @@ thumbc_LDADD = $(LIBOPENRAW_LIBS) ccfa_SOURCES = ccfa.c ccfa_LDADD = $(LIBOPENRAW_LIBS) -gdk_SOURCES = gdk.c -gdk_LDADD = $(LIBOPENRAW_LIBS) $(LIBOPENRAWGNOME_LIBS) - -pixbufload_SOURCES = pixbufload.c -pixbufload_LDADD = $(LIBOPENRAW_LIBS) $(LIBOPENRAWGNOME_LIBS) - ppmload_SOURCES = ppmload.c ppmload_LDADD = $(LIBOPENRAW_LIBS) diff --git a/demo/gdk.c b/demo/gdk.c deleted file mode 100644 index 1f5d10a..0000000 --- a/demo/gdk.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * libopenraw - gdk.c - * - * Copyright (C) 2007-2013 Hubert Figuiere - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * 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 library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - - - -#include <stdio.h> - -#include <libopenraw/libopenraw.h> -#include <libopenraw-gnome/gdkpixbuf.h> - -int -main(int argc, char **argv) -{ - char *filename = argv[1]; - - (void)argc; - or_debug_set_level(DEBUG2); -#if !GLIB_CHECK_VERSION(2,36,0) - /* deprecated in 2.36 */ - g_type_init(); -#endif - - if(filename && *filename) - { - GdkPixbuf *pixbuf; - - pixbuf = or_gdkpixbuf_extract_rotated_thumbnail(filename, 160); - if(pixbuf) { - gdk_pixbuf_save (pixbuf, "gdk.jpg", "jpeg", NULL, - "quality", "100", NULL); - g_object_unref(pixbuf); - } - else { - printf("error\n"); - } - } - else { - printf("No input file name\n"); - } - - return 0; -} -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)) - indent-tabs-mode:nil - fill-column:80 - End: -*/ diff --git a/demo/pixbufload.c b/demo/pixbufload.c deleted file mode 100644 index 241e071..0000000 --- a/demo/pixbufload.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * libopenraw - gdk.c - * - * Copyright (C) 2007-2023 Hubert Figuiere - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * 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 library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - - - -#include <stdio.h> -#include <stdlib.h> - -#include <libopenraw/libopenraw.h> -#include <libopenraw-gnome/gdkpixbuf.h> - -static void pixbuf_free(guchar * data, gpointer u) -{ - ORBitmapDataRef b = (ORBitmapDataRef)u; - (void)data; - or_bitmapdata_release(b); -} - -int -main(int argc, char **argv) -{ - GdkPixbuf *pixbuf = NULL; - ORRawFileRef raw_file = NULL; - char *filename = argv[1]; - or_error err = OR_ERROR_NONE; - ORBitmapDataRef bitmapdata = NULL; - - (void)argc; - or_debug_set_level(DEBUG2); -#if !GLIB_CHECK_VERSION(2,36,0) - /* deprecated in 2.36 */ - g_type_init(); -#endif - - if(!filename || !*filename) { - printf("No input file name\n"); - return 1; - } - - raw_file = or_rawfile_new(filename, OR_RAWFILE_TYPE_UNKNOWN); - if(!raw_file) { - printf("error loading file %s\n", filename); - return 1; - } - - bitmapdata = or_rawfile_get_rendered_image(raw_file, 0, &err); - if (err == OR_ERROR_NONE && bitmapdata) { - uint32_t x,y; - or_data_type format = or_bitmapdata_format(bitmapdata); - x = y = 0; - or_bitmapdata_dimensions(bitmapdata, &x, &y); - if (format == OR_DATA_TYPE_PIXMAP_8RGB) { - pixbuf = gdk_pixbuf_new_from_data(or_bitmapdata_data(bitmapdata), - GDK_COLORSPACE_RGB, - FALSE, 8, x , y, - x * 3, - pixbuf_free, bitmapdata); - } else { - /* Gdk pixbuf still does not supporting 8bpp. */ - printf("16 bits isn't supported be GdkPixbuf.\n"); - } - } - or_bitmapdata_release(bitmapdata); - or_rawfile_release(raw_file); - - if(pixbuf) { - GError* error = NULL; - if(!gdk_pixbuf_save (pixbuf, "gdk-demosaic.jpg", "jpeg", &error, - "quality", "100", NULL) && error) { - printf("error saving image: %s\n", error->message); - g_error_free(error); - } - g_object_unref(pixbuf); - } - else { - printf("error creating pixbuf\n"); - return 1; - } - - return 0; -} -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)) - indent-tabs-mode:nil - fill-column:80 - End: -*/ |