Commit cc7028d8 authored by Øyvind "pippin" Kolås's avatar Øyvind "pippin" Kolås

buffer: move definitions of GeglRectangle and buffer enums to buffer

This reverts earlier indentation breaking changes when GeglRectangle was
renamed GeglBufferRectangle this change also retains the existing released API
and ABI more exactly.
parent e98f33c3
......@@ -62,9 +62,11 @@ GEGL_introspectable_headers = \
buffer/gegl-buffer-iterator.h \
buffer/gegl-buffer-iterator2.h \
buffer/gegl-buffer-backend.h \
buffer/gegl-rectangle.h \
buffer/gegl-tile-backend.h \
buffer/gegl-tile-handler.h \
buffer/gegl-tile-source.h \
buffer/gegl-buffer-enums.h \
graph/gegl-node.h \
process/gegl-graph-debug.h \
process/gegl-processor.h \
......
......@@ -29,12 +29,15 @@ libbuffer_la_SOURCES = \
gegl-buffer-access.c \
gegl-buffer-config.c \
gegl-buffer-config.h \
gegl-buffer-enums.c \
gegl-buffer-enums.h \
gegl-buffer-matrix2.c \
gegl-buffer-matrix2.h \
gegl-buffer-index.h \
gegl-buffer-iterator.c \
gegl-buffer-iterator2.c \
gegl-buffer-linear.c \
gegl-rectangle.c \
gegl-buffer-load.c \
gegl-buffer-save.c \
gegl-sampler.c \
......@@ -64,6 +67,7 @@ libbuffer_la_SOURCES = \
gegl-buffer-iterator.h \
gegl-buffer-iterator2.h \
gegl-buffer-iterator-private.h \
gegl-rectangle.h \
gegl-buffer-types.h \
gegl-buffer-formats.h \
gegl-sampler.h \
......
void
BILINEAR_FUNCNAME (guchar *dest_buf,
const guchar *source_buf,
BILINEAR_FUNCNAME (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint bpp,
const gint d_rowstride)
const gint s_rowstride,
const gdouble scale,
const gint bpp,
const gint d_rowstride)
{
const gint components = bpp / sizeof(BILINEAR_TYPE);
const gint ver = s_rowstride/(bpp/components);
......
void
BOXFILTER_FUNCNAME (guchar *dest_buf,
const guchar *source_buf,
BOXFILTER_FUNCNAME (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint bpp,
const gint d_rowstride)
const gint s_rowstride,
const gdouble scale,
const gint bpp,
const gint d_rowstride)
{
const BOXFILTER_TYPE *src[9];
gint components = bpp / sizeof(BOXFILTER_TYPE);
......
......@@ -26,9 +26,7 @@
#include <babl/babl.h>
#include "gegl-buffer.h"
#include "gegl-types.h"
#include "gegl-buffer-formats.h"
#include "gegl-utils.h"
#include "gegl-algorithms.h"
#include <math.h>
......@@ -151,14 +149,14 @@ static inline int int_floorf (float x)
static void
gegl_boxfilter_u8_nl (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint bpp,
const gint d_rowstride)
gegl_boxfilter_u8_nl (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint bpp,
const gint d_rowstride)
{
const uint8_t *src[9];
gint components = bpp / sizeof(uint8_t);
......@@ -324,14 +322,14 @@ gegl_boxfilter_u8_nl (guchar *dest_buf,
}
static void
gegl_boxfilter_u8_nl_alpha (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint bpp,
const gint d_rowstride)
gegl_boxfilter_u8_nl_alpha (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint bpp,
const gint d_rowstride)
{
const uint8_t *src[9];
gint components = bpp / sizeof(uint8_t);
......@@ -457,14 +455,14 @@ gegl_boxfilter_u8_nl_alpha (guchar *dest_buf,
#undef C
static void
gegl_bilinear_u8_nl (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint components,
const gint d_rowstride)
gegl_bilinear_u8_nl (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint components,
const gint d_rowstride)
{
const gint ver = s_rowstride;
const gint diag = ver + components;
......@@ -585,14 +583,14 @@ gegl_bilinear_u8_nl (guchar *dest_buf,
}
static void
gegl_bilinear_u8_nl_alpha (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint components,
const gint d_rowstride)
gegl_bilinear_u8_nl_alpha (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint components,
const gint d_rowstride)
{
const gint ver = s_rowstride;
const gint diag = ver + components;
......@@ -993,14 +991,14 @@ gegl_downscale_2x2_nearest (const Babl *format,
}
static void
gegl_resample_boxfilter_generic (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride)
gegl_resample_boxfilter_generic (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride)
{
const Babl *tmp_format = babl_format_with_space ("RGBA float", format);
const Babl *from_fish = babl_fish (format, tmp_format);
......@@ -1045,14 +1043,14 @@ gegl_resample_boxfilter_generic (guchar *dest_buf,
}
}
void gegl_resample_boxfilter (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride)
void gegl_resample_boxfilter (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride)
{
const Babl *model = babl_format_get_model (format);
const Babl *comp_type = babl_format_get_type (format, 0);
......@@ -1100,14 +1098,14 @@ void gegl_resample_boxfilter (guchar *dest_buf,
}
static void
gegl_resample_bilinear_generic (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride)
gegl_resample_bilinear_generic (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride)
{
const Babl *tmp_format = babl_format_with_space ("RGBA float", format);
const Babl *from_fish = babl_fish (format, tmp_format);
......@@ -1153,14 +1151,14 @@ gegl_resample_bilinear_generic (guchar *dest_buf,
}
}
void gegl_resample_bilinear (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride)
void gegl_resample_bilinear (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride)
{
const Babl *model = babl_format_get_model (format);
const Babl *comp_type = babl_format_get_type (format, 0);
......@@ -1210,14 +1208,14 @@ void gegl_resample_bilinear (guchar *dest_buf,
}
void
gegl_resample_nearest (guchar *dst,
const guchar *src,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
const gint src_stride,
const gdouble scale,
const gint bpp,
const gint dst_stride)
gegl_resample_nearest (guchar *dst,
const guchar *src,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
const gint src_stride,
const gdouble scale,
const gint bpp,
const gint dst_stride)
{
gint jj[dst_rect->width];
gint x, y;
......
......@@ -19,6 +19,7 @@
#ifndef __GEGL_ALGORITHMS_H__
#define __GEGL_ALGORITHMS_H__
#include "gegl-buffer.h"
G_BEGIN_DECLS
#define GEGL_SCALE_EPSILON 1.e-6
......@@ -92,125 +93,125 @@ void gegl_downscale_2x2_nearest (const Babl *format,
* available for #format fall back to nearest neighbor.
* #scale is assumed to be between 0.5 and +inf.
*/
void gegl_resample_boxfilter (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride);
void gegl_resample_boxfilter_double (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_float (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u32 (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u16 (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u8 (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride);
void gegl_resample_boxfilter_double (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_float (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u32 (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u16 (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u8 (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
/* Attempt to resample with a 2x2 bilinear filter, if no implementation is
* available for #format fall back to nearest neighbor.
*/
void gegl_resample_bilinear (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride);
void gegl_resample_bilinear_double (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_bilinear_float (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_bilinear_u32 (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_bilinear_u16 (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_bilinear_u8 (guchar *dest_buf,
const guchar *source_buf,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_nearest (guchar *dst,
const guchar *src,
const GeglBufferRectangle *dst_rect,
const GeglBufferRectangle *src_rect,
gint src_stride,
gdouble scale,
gint bpp,
gint dst_stride);
void gegl_resample_bilinear (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
const Babl *format,
gint d_rowstride);
void gegl_resample_bilinear_double (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_bilinear_float (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_bilinear_u32 (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_bilinear_u16 (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_bilinear_u8 (guchar *dest_buf,
const guchar *source_buf,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint bpp,
gint d_rowstride);
void gegl_resample_nearest (guchar *dst,
const guchar *src,
const GeglRectangle *dst_rect,
const GeglRectangle *src_rect,
gint src_stride,
gdouble scale,
gint bpp,
gint dst_stride);
GeglDownscale2x2Fun gegl_downscale_2x2_get_fun (const Babl *format);
......
This diff is collapsed.
......@@ -19,7 +19,6 @@
#ifndef __GEGL_BUFFER_BACKEND_H__
#define __GEGL_BUFFER_BACKEND_H__
#include "gegl-types.h"
G_BEGIN_DECLS
......@@ -31,6 +30,8 @@ typedef struct _GeglTileHandler GeglTileHandler;
typedef void (*GeglTileCallback) (GeglTile *tile,
gpointer user_data);
/* All commands have the ability to pass commands to all tiles the handlers
* add abstraction to the commands the documentaiton given here is valid
* when the commands are issued to a full blown GeglBuffer instance.
......@@ -65,6 +66,8 @@ typedef struct _GeglTileCopyParams
G_END_DECLS
#include "gegl-buffer.h"
#include "gegl-buffer-enums.h"
#include "gegl-tile-backend.h"
#include "gegl-tile-source.h"
#include "gegl-tile-handler.h"
......
......@@ -23,10 +23,9 @@
#include <glib-object.h>
#include <glib/gprintf.h>
#include "gegl.h"
#include "gegl-buffer.h"
#include "gegl-buffer-config.h"
#include "opencl/gegl-cl.h"
G_DEFINE_TYPE (GeglBufferConfig, gegl_buffer_config, G_TYPE_OBJECT)
......
/* This file is part of 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 <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include "gegl-buffer-enums.h"
GType
gegl_abyss_policy_get_type (void)
{
static GType etype = 0;
if (etype == 0)
{
static GEnumValue values[] = {
{ GEGL_ABYSS_NONE, N_("None"), "none" },
{ GEGL_ABYSS_CLAMP, N_("Clamp"), "clamp" },
{ GEGL_ABYSS_LOOP, N_("Loop"), "loop" },
{ GEGL_ABYSS_BLACK, N_("Black"), "black" },
{ GEGL_ABYSS_WHITE, N_("White"), "white" },
// we do not really want this one introspected/translated,
// will this bite us?
//{ GEGL_BUFFER_NEAREST, N_("Nearest"), "nearest" },
{ 0, NULL, NULL }
};
gint i;
for (i = 0; i < G_N_ELEMENTS (values); i++)
if (values[i].value_name)
values[i].value_name =
dgettext (GETTEXT_PACKAGE, values[i].value_name);
etype = g_enum_register_static ("GeglAbyssPolicy", values);
}
return etype;
}
GType
gegl_access_mode_get_type (void)
{
static GType ftype = 0;
if (ftype == 0)
{
static GFlagsValue values[] = {
{ GEGL_ACCESS_READ, N_("Read"), "read" },
{ GEGL_ACCESS_WRITE, N_("Write"), "write" },
{ GEGL_ACCESS_READWRITE, N_("Read/Write"), "readwrite" },
{ 0, NULL, NULL }
};
gint i;
for (i = 0; i < G_N_ELEMENTS (values); i++)
if (values[i].value_name)
values[i].value_name =
dgettext (GETTEXT_PACKAGE, values[i].value_name);
ftype = g_flags_register_static ("GeglAccessMode", values);
}
return ftype;
}
GType
gegl_sampler_type_get_type (void)
{
static GType etype = 0;
if (etype == 0)
{
static GEnumValue values[] = {
{ GEGL_SAMPLER_NEAREST, N_("Nearest"), "nearest" },
{ GEGL_SAMPLER_LINEAR, N_("Linear"), "linear" },
{ GEGL_SAMPLER_CUBIC, N_("Cubic"), "cubic" },
{ GEGL_SAMPLER_NOHALO, N_("NoHalo"), "nohalo" },
{ GEGL_SAMPLER_LOHALO, N_("LoHalo"), "lohalo" },
{ 0, NULL, NULL }
};
gint i;
for (i = 0; i < G_N_ELEMENTS (values); i++)
if (values[i].value_name)
values[i].value_name =
dgettext (GETTEXT_PACKAGE, values[i].value_name);
etype = g_enum_register_static ("GeglSamplerType", values);
}
return etype;
}
/* This file is part of 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 <https://www.gnu.org/licenses/>.
*
* Copyright 2011 Michael Muré <batolettre@gmail.com>
*
*/
/* This file holds public enums from GEGL
*
* !!!!!!!!!!!! NOTE !!!!!!!!!!!!!!
*