Commit 500bef58 authored by Michael Muré's avatar Michael Muré
Browse files

rename all GEGL_INTERPOLATION_* to GEGL_SAMPLER_*

parent 81322c10
......@@ -320,9 +320,9 @@ GeglBuffer * gegl_buffer_dup (GeglBuffer *buffer);
* @dest: buffer capable of storing one pixel in @format.
* @format: the format to store the sampled color in.
* @sampler_type: the sampler type to use,
* to be ported from working code. Valid values: GEGL_INTERPOLATION_NEAREST,
* GEGL_INTERPOLATION_LINEAR, GEGL_INTERPOLATION_CUBIC,
* GEGL_INTERPOLATION_LANCZOS and GEGL_INTERPOLATION_LOHALO
* to be ported from working code. Valid values: GEGL_SAMPLER_NEAREST,
* GEGL_SAMPLER_LINEAR, GEGL_SAMPLER_CUBIC,
* GEGL_SAMPLER_LANCZOS and GEGL_SAMPLER_LOHALO
*
* Query interpolate pixel values at a given coordinate using a specified form
* of interpolation. The samplers used cache for a small neighbourhood of the
......@@ -357,7 +357,7 @@ void gegl_buffer_sample_cleanup (GeglBuffer *buffer);
* @string: the string to look up
*
* Looks up the GeglInterpolation corresponding to a string, if no matching
* interpolation is found GEGL_INTERPOLATION_NEAREST is returned.
* interpolation is found GEGL_SAMPLER_NEAREST is returned.
*/
GeglSamplerType gegl_sampler_type_from_string (const gchar *string);
......@@ -366,9 +366,9 @@ GeglSamplerType gegl_sampler_type_from_string (const gchar *string);
* @buffer: buffer to create a new sampler for
* @format: format we want data back in
* @sampler_type: the sampler type to use,
* to be ported from working code. Valid values: GEGL_INTERPOLATION_NEAREST,
* GEGL_INTERPOLATION_LINEAR, GEGL_INTERPOLATION_CUBIC,
* GEGL_INTERPOLATION_LANCZOS and GEGL_INTERPOLATION_LOHALO
* to be ported from working code. Valid values: GEGL_SAMPLER_NEAREST,
* GEGL_SAMPLER_LINEAR, GEGL_SAMPLER_CUBIC,
* GEGL_SAMPLER_LANCZOS and GEGL_SAMPLER_LOHALO
*
* Create a new sampler, when you are done with the sampler, g_object_unref
* it.
......
......@@ -528,20 +528,20 @@ gegl_sampler_type_from_string (const gchar *string)
{
if (g_str_equal (string, "nearest") ||
g_str_equal (string, "none"))
return GEGL_INTERPOLATION_NEAREST;
return GEGL_SAMPLER_NEAREST;
if (g_str_equal (string, "linear") ||
g_str_equal (string, "bilinear"))
return GEGL_INTERPOLATION_LINEAR;
return GEGL_SAMPLER_LINEAR;
if (g_str_equal (string, "cubic") ||
g_str_equal (string, "bicubic"))
return GEGL_INTERPOLATION_CUBIC;
return GEGL_SAMPLER_CUBIC;
if (g_str_equal (string, "lohalo"))
return GEGL_INTERPOLATION_LOHALO;
return GEGL_SAMPLER_LOHALO;
return GEGL_INTERPOLATION_NEAREST;
return GEGL_SAMPLER_NEAREST;
}
GType
......@@ -551,15 +551,15 @@ gegl_sampler_gtype_from_enum (GeglSamplerType sampler_type)
{
switch (sampler_type)
{
case GEGL_INTERPOLATION_NEAREST:
case GEGL_SAMPLER_NEAREST:
return GEGL_TYPE_SAMPLER_NEAREST;
case GEGL_INTERPOLATION_LINEAR:
case GEGL_SAMPLER_LINEAR:
return GEGL_TYPE_SAMPLER_LINEAR;
case GEGL_INTERPOLATION_CUBIC:
case GEGL_SAMPLER_CUBIC:
return GEGL_TYPE_SAMPLER_CUBIC;
case GEGL_INTERPOLATION_LANCZOS:
case GEGL_SAMPLER_LANCZOS:
return GEGL_TYPE_SAMPLER_LANCZOS;
case GEGL_INTERPOLATION_LOHALO:
case GEGL_SAMPLER_LOHALO:
return GEGL_TYPE_SAMPLER_LOHALO;
default:
return GEGL_TYPE_SAMPLER_LINEAR;
......@@ -576,7 +576,7 @@ gegl_buffer_sampler_new (GeglBuffer *buffer,
if (format == NULL)
format = babl_format ("RaGaBaA float");
desired_type = gegl_sampler_gtype_from_enum (sampler_type);
if (sampler_type == GEGL_INTERPOLATION_LANCZOS)
if (sampler_type == GEGL_SAMPLER_LANCZOS)
sampler = g_object_new (desired_type,
"format", format,
"buffer", buffer,
......
......@@ -103,7 +103,7 @@ const gchar * gegl_extension_handler_get_saver (const gchar *extensi
* gegl_sampler_compute_scale (scale, x, y);
* gegl_unmap(x,y,sample_x,sample_y);
* gegl_buffer_sample (buffer, sample_x, sample_y, scale, dest, format,
* GEGL_INTERPOLATION_LOHALO);
* GEGL_SAMPLER_LOHALO);
*
* #undef gegl_unmap // IMPORTANT undefine map macro
*/
......
......@@ -26,11 +26,11 @@ gegl_sampler_type_get_type (void)
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ GEGL_INTERPOLATION_NEAREST, "GEGL_INTERPOLATION_NEAREST", "nearest" },
{ GEGL_INTERPOLATION_LINEAR, "GEGL_INTERPOLATION_LINEAR", "linear" },
{ GEGL_INTERPOLATION_CUBIC, "GEGL_INTERPOLATION_CUBIC", "cubic" },
{ GEGL_INTERPOLATION_LANCZOS, "GEGL_INTERPOLATION_LANCZOS", "lanczos" },
{ GEGL_INTERPOLATION_LOHALO, "GEGL_INTERPOLATION_LOHALO", "lohalo" },
{ GEGL_SAMPLER_NEAREST, "GEGL_SAMPLER_NEAREST", "nearest" },
{ GEGL_SAMPLER_LINEAR, "GEGL_SAMPLER_LINEAR", "linear" },
{ GEGL_SAMPLER_CUBIC, "GEGL_SAMPLER_CUBIC", "cubic" },
{ GEGL_SAMPLER_LANCZOS, "GEGL_SAMPLER_LANCZOS", "lanczos" },
{ GEGL_SAMPLER_LOHALO, "GEGL_SAMPLER_LOHALO", "lohalo" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("GeglSamplerTypeType", values);
......
......@@ -65,11 +65,11 @@ GType gegl_processor_get_type (void) G_GNUC_CONST;
#define GEGL_IS_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_PROCESSOR))
typedef enum {
GEGL_INTERPOLATION_NEAREST = 0,
GEGL_INTERPOLATION_LINEAR,
GEGL_INTERPOLATION_CUBIC,
GEGL_INTERPOLATION_LANCZOS,
GEGL_INTERPOLATION_LOHALO
GEGL_SAMPLER_NEAREST = 0,
GEGL_SAMPLER_LINEAR,
GEGL_SAMPLER_CUBIC,
GEGL_SAMPLER_LANCZOS,
GEGL_SAMPLER_LOHALO
} GeglSamplerType;
GType gegl_sampler_type_get_type (void) G_GNUC_CONST;
#define GEGL_TYPE_SAMPLER_TYPE (gegl_sampler_type_get_type())
......
......@@ -20,7 +20,7 @@
#ifdef GEGL_CHANT_PROPERTIES
gegl_chant_enum (sampler_type, _("Sampler"), GeglSamplerType, GEGL_TYPE_SAMPLER_TYPE,
GEGL_INTERPOLATION_CUBIC, _("Sampler used internaly"))
GEGL_SAMPLER_CUBIC, _("Sampler used internaly"))
#else
......
......@@ -24,7 +24,7 @@ gegl_chant_double (scaling, _("Scaling"), 0.0, 5000.0, 1.0,
_("scaling factor of displacement, indicates how large spatial"
" displacement a relative mapping value of 1.0 corresponds to."))
gegl_chant_enum (sampler_type, _("Sampler"), GeglSamplerType, GEGL_TYPE_SAMPLER_TYPE,
GEGL_INTERPOLATION_CUBIC, _("Sampler used internaly"))
GEGL_SAMPLER_CUBIC, _("Sampler used internaly"))
#else
......
......@@ -234,7 +234,7 @@ apply_mirror (double mirror_angle,
#ifndef DO_NOT_USE_BUFFER_SAMPLE
gegl_buffer_sample (src, cx, cy, NULL, &dst_buf[(row * roi->width + col) * 4], format, GEGL_INTERPOLATION_LINEAR);
gegl_buffer_sample (src, cx, cy, NULL, &dst_buf[(row * roi->width + col) * 4], format, GEGL_SAMPLER_LINEAR);
#endif
#ifdef DO_NOT_USE_BUFFER_SAMPLE
......
......@@ -274,7 +274,7 @@ convolve_pixel(gfloat *src_buf,
gfloat temp_color[4];
gegl_buffer_sample (input, s_x, s_y, NULL, temp_color,
babl_format ("RGBA float"),
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
if (i!=3 && o->weight)
sum += matrix[x][y] * temp_color[i]
* temp_color[3];
......
......@@ -514,7 +514,7 @@ process (GeglOperation *operation,
iy = CLAMP (y, boundary.y, boundary.y + boundary.height - 1);
gegl_buffer_sample (input, ix, iy, NULL, color, format,
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
fill_poly_color (&poly, &extended, &boundary, dst_buf, color);
}
......
......@@ -244,7 +244,7 @@ get_rgba_pixel (void *data,
return;
gegl_buffer_sample (p->in_drawable, x, y, NULL, buf,
p->rgba_float,
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
for (i = 0; i < 4; i++)
pixel[i] = buf[i];
}
......@@ -255,7 +255,7 @@ get_rgba_pixel (void *data,
return;
gegl_buffer_sample (p->aux_drawable, x, y, NULL, buf,
p->rgba_float,
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
for (i = 0; i < 4; i++)
pixel[i] = buf[i];
}
......
......@@ -393,7 +393,7 @@ lens_distort_newl (gfloat *src_buf,
gfloat color[4];
gegl_buffer_sample (input, tmpx+x, tmpy+y, NULL, color,
babl_format ("RGBA float"),
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
val += color[rgb] * wx[x] * wy[y];
wt += wx[x] * wy[y];
}
......
......@@ -174,7 +174,7 @@ fractaltrace (GeglBuffer *input,
if (0 <= px && px < picture->width && 0 <= py && py < picture->height)
{
gegl_buffer_sample (input, px, py, &scale, dest, format,
GEGL_INTERPOLATION_LOHALO);
GEGL_SAMPLER_LOHALO);
}
else
{
......@@ -207,7 +207,7 @@ fractaltrace (GeglBuffer *input,
}
gegl_buffer_sample (input, px, py, &scale, dest, format,
GEGL_INTERPOLATION_LOHALO);
GEGL_SAMPLER_LOHALO);
break;
case BACKGROUND_TYPE_TRANSPARENT:
......
......@@ -239,7 +239,7 @@ lens_distort_func (gfloat *src_buf,
{
gegl_buffer_sample (input, x, y, NULL, temp,
babl_format ("RGBA float"),
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
}
else
{
......
......@@ -90,9 +90,9 @@ apply_spread (gint x_amount,
calc_sample_coords (x1, y1, x_amount, y_amount, gr, &x, &y);
/* Only displace the pixel if it's within the bounds of the image. */
if (x >= 0 && x < img_width && y >= 0 && y < img_height)
gegl_buffer_sample (src, x, y, NULL, &dst_buf[(y1 * roi->width + x1) * 4], format, GEGL_INTERPOLATION_LINEAR);
gegl_buffer_sample (src, x, y, NULL, &dst_buf[(y1 * roi->width + x1) * 4], format, GEGL_SAMPLER_LINEAR);
else /* Else just copy it */
gegl_buffer_sample (src, x1, y1, NULL, &dst_buf[(y1 * roi->width + x1) * 4], format, GEGL_INTERPOLATION_LINEAR);
gegl_buffer_sample (src, x1, y1, NULL, &dst_buf[(y1 * roi->width + x1) * 4], format, GEGL_SAMPLER_LINEAR);
} /* for */
} /* for */
......
......@@ -219,13 +219,13 @@ do_plasma_big (PlasmaContext *context,
return FALSE;
gegl_buffer_sample (context->output, x1, y1, NULL, tl, babl_format ("RGBA float"),
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
gegl_buffer_sample (context->output, x1, y2, NULL, bl, babl_format ("RGBA float"),
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
gegl_buffer_sample (context->output, x2, y1, NULL, tr, babl_format ("RGBA float"),
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
gegl_buffer_sample (context->output, x2, y2, NULL, br, babl_format ("RGBA float"),
GEGL_INTERPOLATION_NEAREST);
GEGL_SAMPLER_NEAREST);
ran = context->o->turbulence / (2.0 * scale_depth);
......
......@@ -343,7 +343,7 @@ process (GeglOperation *operation,
if (inside)
gegl_buffer_sample (input, px, py, &scale, dest, format,
GEGL_INTERPOLATION_LOHALO);
GEGL_SAMPLER_LOHALO);
else
for (i=0; i<4; i++)
dest[i] = 0.0;
......
......@@ -141,7 +141,7 @@ apply_whirl_pinch (gdouble whirl, gdouble pinch, gdouble radius,
scale_x = 1.0;
scale_y = roi->width / (gdouble) roi->height;
sampler = gegl_buffer_sampler_new (src, babl_format ("RaGaBaA float"),
GEGL_INTERPOLATION_LOHALO);
GEGL_SAMPLER_LOHALO);
for (row = 0; row < roi->height; row++) {
for (col = 0; col < roi->width; col++) {
......
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