Commit ca9f243d authored by Øyvind Kolås's avatar Øyvind Kolås

Added YAFR sampler from Nicolas Robidoux from bug #550569, this

is a sampler with seemingly better quality than cubic with good
performance, it could perhaps form the default method used for
enlargement in combination with a different approach for scaling
down.
* gegl/buffer/gegl-sampler-yafr.c: new file
* gegl/buffer/gegl-sampler-yafr.h: new file.
* gegl/buffer/Makefile.am: ..
* gegl/buffer/gegl-buffer-access.c: ..
* gegl/buffer/gegl-buffer.c: ..
* gegl/buffer/gegl-buffer.h: ..
* gegl/buffer/gegl-sampler.c: .. updated to add a new sampler.

svn path=/trunk/; revision=2583
parent a6870b62
2008-09-05 Øyvind Kolås <pippin@gimp.org>
Added YAFR sampler from Nicolas Robidoux from bug #550569, this
is a sampler with seemingly better quality than cubic with good
performance, it could perhaps form the default method used for
enlargement in combination with a different approach for scaling
down.
* gegl/buffer/gegl-sampler-yafr.c: new file
* gegl/buffer/gegl-sampler-yafr.h: new file.
* gegl/buffer/Makefile.am: ..
* gegl/buffer/gegl-buffer-access.c: ..
* gegl/buffer/gegl-buffer.c: ..
* gegl/buffer/gegl-buffer.h: ..
* gegl/buffer/gegl-sampler.c: .. updated to add a new sampler.
2008-09-05 Sven Neumann <sven@gimp.org>
* gegl/operation/gegl-operation-composer3.c
......
......@@ -22,6 +22,7 @@ BUFFER_sources = \
gegl-sampler-lanczos.c \
gegl-sampler-linear.c \
gegl-sampler-nearest.c \
gegl-sampler-yafr.c \
gegl-region-generic.c \
gegl-tile.c \
gegl-tile-source.c \
......@@ -50,6 +51,7 @@ BUFFER_headers = \
gegl-sampler-lanczos.h \
gegl-sampler-linear.h \
gegl-sampler-nearest.h \
gegl-sampler-yafr.h \
gegl-region.h \
gegl-region-generic.h \
gegl-tile.h \
......
......@@ -36,6 +36,7 @@
#include "gegl-sampler-linear.h"
#include "gegl-sampler-cubic.h"
#include "gegl-sampler-lanczos.h"
#include "gegl-sampler-yafr.h"
#include "gegl-buffer-index.h"
#include "gegl-tile-backend.h"
#include "gegl-buffer-iterator.h"
......
......@@ -62,6 +62,7 @@
#include "gegl-sampler-linear.h"
#include "gegl-sampler-cubic.h"
#include "gegl-sampler-lanczos.h"
#include "gegl-sampler-yafr.h"
#include "gegl-types.h"
#include "gegl-utils.h"
#include "gegl-id-pool.h"
......
......@@ -295,6 +295,7 @@ typedef enum {
GEGL_INTERPOLATION_LINEAR,
GEGL_INTERPOLATION_CUBIC,
GEGL_INTERPOLATION_LANCZOS,
GEGL_INTERPOLATION_YAFR,
} GeglInterpolation;
/**
......
This diff is collapsed.
/* 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 <http://www.gnu.org/licenses/>.
*
*/
#ifndef __GEGL_SAMPLER_YAFR_H__
#define __GEGL_SAMPLER_YAFR_H__
#include "gegl-sampler.h"
G_BEGIN_DECLS
#define GEGL_TYPE_SAMPLER_YAFR (gegl_sampler_yafr_get_type ())
#define GEGL_SAMPLER_YAFR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_SAMPLER_YAFR, GeglSamplerYafr))
#define GEGL_SAMPLER_YAFR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEGL_TYPE_SAMPLER_YAFR, GeglSamplerYafrClass))
#define GEGL_IS_SAMPLER_YAFR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_SAMPLER_YAFR))
#define GEGL_IS_SAMPLER_YAFR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_SAMPLER_YAFR))
#define GEGL_SAMPLER_YAFR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEGL_TYPE_SAMPLER_YAFR, GeglSamplerYafrClass))
typedef struct _GeglSamplerYafr GeglSamplerYafr;
typedef struct _GeglSamplerYafrClass GeglSamplerYafrClass;
struct _GeglSamplerYafr
{
GeglSampler parent_instance;
/*< private >*/
gdouble b;
gdouble c;
gchar *type;
};
struct _GeglSamplerYafrClass
{
GeglSamplerClass parent_class;
};
GType gegl_sampler_yafr_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif
......@@ -29,6 +29,7 @@
#include "gegl-sampler-linear.h"
#include "gegl-sampler-cubic.h"
#include "gegl-sampler-lanczos.h"
#include "gegl-sampler-yafr.h"
#if ENABLE_MP
GStaticRecMutex mutex = G_STATIC_REC_MUTEX_INIT;
......@@ -387,6 +388,10 @@ gegl_buffer_interpolation_from_string (const gchar *string)
g_str_equal (string, "bicubic"))
return GEGL_INTERPOLATION_CUBIC;
if (g_str_equal (string, "yafr") ||
g_str_equal (string, "yafr"))
return GEGL_INTERPOLATION_YAFR;
if (g_str_equal (string, "lanczos"))
return GEGL_INTERPOLATION_LANCZOS;
......@@ -405,6 +410,8 @@ gegl_sampler_type_from_interpolation (GeglInterpolation interpolation)
return GEGL_TYPE_SAMPLER_LINEAR;
case GEGL_INTERPOLATION_CUBIC:
return GEGL_TYPE_SAMPLER_CUBIC;
case GEGL_INTERPOLATION_YAFR:
return GEGL_TYPE_SAMPLER_YAFR;
case GEGL_INTERPOLATION_LANCZOS:
return GEGL_TYPE_SAMPLER_LANCZOS;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment