Commit 3ad73b36 authored by Michael Natterer's avatar Michael Natterer 😴

libgimpcolor: add GdkPixbuf <-> GeglBuffer utility functions

and update tons of includes in libgimp and app.
parent 105219ec
......@@ -11,9 +11,9 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(BABL_CFLAGS) \
$(GEGL_CFLAGS) \
$(CAIRO_CFLAGS) \
$(GLIB_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
-I$(includedir)
composite_libraries = \
......
......@@ -26,9 +26,9 @@
#include <string.h>
#include <stdio.h>
#include <babl/babl.h>
#include <cairo.h>
#include <glib-object.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -27,9 +27,9 @@
#include <unistd.h>
#endif
#include <babl/babl.h>
#include <cairo.h>
#include <glib-object.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -20,9 +20,9 @@
#include "config.h"
#include <babl/babl.h>
#include <cairo.h>
#include <glib-object.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -20,9 +20,9 @@
#include "config.h"
#include <babl/babl.h>
#include <cairo.h>
#include <glib-object.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -20,9 +20,9 @@
#include "config.h"
#include <babl/babl.h>
#include <cairo.h>
#include <glib-object.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -20,9 +20,9 @@
#include "config.h"
#include <babl/babl.h>
#include <cairo.h>
#include <glib-object.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -25,6 +25,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -48,6 +48,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gobject/gvaluecollector.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -17,13 +17,15 @@
#include "config.h"
#include <cairo.h>
#include <gegl.h>
#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "core-types.h"
#include "gegl/gimp-babl.h"
#include "gegl/gimp-gegl-utils.h"
#include "gimp-utils.h"
#include "gimpbuffer.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -20,6 +20,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gegl-plugin.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -24,6 +24,7 @@
#include <cairo.h>
#include <gegl.h>
#include <glib/gstdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -24,6 +24,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -134,6 +134,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -19,6 +19,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -19,6 +19,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -33,6 +33,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib/gstdio.h>
#ifdef G_OS_WIN32
......
......@@ -27,6 +27,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib/gstdio.h>
#include "libgimpbase/gimpbase.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
......
......@@ -23,6 +23,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gegl-paramspecs.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpconfig/gimpconfig.h"
......
......@@ -30,7 +30,7 @@
#include <fcntl.h>
#include <gegl.h>
#include <glib.h>
#include <glib/gstdio.h>
#ifdef G_OS_WIN32
......@@ -41,14 +41,15 @@
#define _O_BINARY 0
#endif
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "core-types.h"
#include "gegl/gimp-gegl-utils.h"
#include "gimppattern.h"
#include "gimppattern-header.h"
#include "gimppattern-load.h"
......
......@@ -28,6 +28,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -22,15 +22,16 @@
#include <string.h>
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "libgimpconfig/gimpconfig.h"
#include "core-types.h"
#include "gegl/gimp-gegl-utils.h"
#include "gimp-utils.h"
#include "gimpcontext.h"
#include "gimpmarshal.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpconfig/gimpconfig.h"
......
......@@ -48,41 +48,6 @@ gimp_interpolation_to_gegl_filter (GimpInterpolationType interpolation)
return "nearest";
}
const Babl *
gimp_pixbuf_get_format (GdkPixbuf *pixbuf)
{
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
switch (gdk_pixbuf_get_n_channels (pixbuf))
{
case 3: return babl_format ("R'G'B' u8");
case 4: return babl_format ("R'G'B'A u8");
}
g_return_val_if_reached (NULL);
}
GeglBuffer *
gimp_pixbuf_create_buffer (GdkPixbuf *pixbuf)
{
gint width;
gint height;
gint rowstride;
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
return gegl_buffer_linear_new_from_data (gdk_pixbuf_get_pixels (pixbuf),
gimp_pixbuf_get_format (pixbuf),
GEGL_RECTANGLE (0, 0, width, height),
rowstride,
(GDestroyNotify) g_object_unref,
g_object_ref (pixbuf));
}
GeglBuffer *
gimp_gegl_buffer_new (const GeglRectangle *rect,
const Babl *format)
......
......@@ -34,10 +34,6 @@ GeglBuffer * gimp_gegl_buffer_dup (GeglBuffer *buffer)
GeglBuffer * gimp_tile_manager_create_buffer (TileManager *tm,
const Babl *format);
TileManager * gimp_gegl_buffer_get_tiles (GeglBuffer *buffer);
const Babl * gimp_pixbuf_get_format (GdkPixbuf *pixbuf);
GeglBuffer * gimp_pixbuf_create_buffer (GdkPixbuf *pixbuf);
void gimp_gegl_buffer_refetch_tiles (GeglBuffer *buffer);
GeglColor * gimp_gegl_color_new (const GimpRGB *rgb);
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -24,6 +24,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib/gstdio.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -25,6 +25,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib/gstdio.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -23,7 +23,6 @@
#include <cairo.h>
#include <gegl.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "gimp-gegl-types.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -23,7 +23,6 @@
#include <cairo.h>
#include <gegl.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "gimp-gegl-types.h"
......
......@@ -23,6 +23,7 @@
#include <cairo.h>
#include <gegl-plugin.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
......
......@@ -23,7 +23,6 @@
#include <cairo.h>
#include <gegl.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "gimp-gegl-types.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -22,6 +22,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -23,8 +23,6 @@
#include <cairo.h>
#include <gegl.h>
#include "libgimpcolor/gimpcolor.h"
#include "gimp-gegl-types.h"
#include "gimpoperationthreshold.h"
......
......@@ -13,9 +13,9 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(BABL_CFLAGS) \
$(CAIRO_CFLAGS) \
$(GEGL_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
-I$(includedir)
noinst_LIBRARIES = libapppaint-funcs.a
......
......@@ -21,6 +21,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -17,11 +17,8 @@
#include "config.h"
#include <cairo.h>
#include <gegl.h>
#include "libgimpcolor/gimpcolor.h"
#include "paint-types.h"
#include "core/gimp.h"
......
......@@ -19,6 +19,7 @@
#include <cairo.h>
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
......
......@@ -23,6 +23,8 @@
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "pdb-types.h"
#include "core/gimp.h"
......
......@@ -21,6 +21,8 @@
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "pdb-types.h"
#include "core/gimp.h"
......
......@@ -23,6 +23,8 @@
#include <gegl.h>
#include <gdk-pixbuf/gdk-pixbuf.h>