Commit 91d3d57e authored by Michael Muré's avatar Michael Muré Committed by Øyvind "pippin" Kolås

abyss policy: add repeat_mode parameter in gegl_buffer_get,...

abyss policy: add repeat_mode parameter in gegl_buffer_get, gegl_sampler_get_from_buffer, gegl_sampler_get_from_mipmap, gegl_sampler_get_ptr. All sampler should handle the abyss policy now.
parent b957b82c
......@@ -1059,7 +1059,7 @@ gegl_buffer_get (GeglBuffer *buffer,
const Babl *format,
gpointer dest_buf,
gint rowstride,
GeglAbyssPolicy repeat_mode)
GeglAbyssPolicy repeat_mode)
{
g_return_if_fail (GEGL_IS_BUFFER (buffer));
gegl_buffer_get_unlocked (buffer, scale, rect, format, dest_buf, rowstride);
......
......@@ -159,7 +159,7 @@ gegl_sampler_cubic_get (GeglSampler *self,
context_rect = self->context_rect[0];
dx = (gint) x;
dy = (gint) y;
sampler_bptr = gegl_sampler_get_ptr (self, dx, dy);
sampler_bptr = gegl_sampler_get_ptr (self, dx, dy, repeat_mode);
{
for (v=dy+context_rect.y, i=0; v < dy+context_rect.y+context_rect.height ; v++)
......
......@@ -122,7 +122,7 @@ gegl_sampler_linear_get (GeglSampler* restrict self,
* Point the data tile pointer to the first channel of the top_left
* pixel value:
*/
const gfloat* restrict in_bptr = gegl_sampler_get_ptr (self, ix, iy);
const gfloat* restrict in_bptr = gegl_sampler_get_ptr (self, ix, iy, repeat_mode);
/*
* First bilinear weight:
......
......@@ -1317,7 +1317,7 @@ gegl_sampler_lohalo_get ( GeglSampler* restrict self,
* (level "0"), the one with scale=1.0.
*/
const gfloat* restrict input_bptr =
(gfloat*) gegl_sampler_get_ptr (self, ix_0, iy_0);
(gfloat*) gegl_sampler_get_ptr (self, ix_0, iy_0, repeat_mode);
/*
* (x_0,y_0) is the relative position of the sampling location
......@@ -2263,7 +2263,7 @@ gegl_sampler_lohalo_get ( GeglSampler* restrict self,
* Get pointer to mipmap level 1 data:
*/
const gfloat* restrict input_bptr_1 =
(gfloat*) gegl_sampler_get_from_mipmap (self, ix_1, iy_1, 1);
(gfloat*) gegl_sampler_get_from_mipmap (self, ix_1, iy_1, 1, repeat_mode);
/*
* Position of the sampling location in the coordinate
......
......@@ -69,6 +69,6 @@ gegl_sampler_nearest_get (GeglSampler *self,
GeglAbyssPolicy repeat_mode)
{
gfloat *sampler_bptr;
sampler_bptr = gegl_sampler_get_from_buffer (self, (gint)x, (gint)y);
sampler_bptr = gegl_sampler_get_from_buffer (self, (gint)x, (gint)y, repeat_mode);
babl_process (self->fish, sampler_bptr, output, 1);
}
......@@ -206,7 +206,8 @@ dispose (GObject *gobject)
gfloat *
gegl_sampler_get_ptr (GeglSampler *const sampler,
const gint x,
const gint y)
const gint y,
GeglAbyssPolicy repeat_mode)
{
guchar *buffer_ptr;
gint dx;
......@@ -282,7 +283,7 @@ gegl_sampler_get_ptr (GeglSampler *const sampler,
sampler->interpolate_format,
sampler->sampler_buffer[0],
GEGL_AUTO_ROWSTRIDE,
GEGL_ABYSS_NONE);
repeat_mode);
sampler->sampler_rectangle[0] = fetch_rectangle;
}
......@@ -298,7 +299,8 @@ gegl_sampler_get_ptr (GeglSampler *const sampler,
gfloat *
gegl_sampler_get_from_buffer (GeglSampler *const sampler,
const gint x,
const gint y)
const gint y,
GeglAbyssPolicy repeat_mode)
{
guchar *buffer_ptr;
gint dx;
......@@ -357,7 +359,7 @@ gegl_sampler_get_from_buffer (GeglSampler *const sampler,
sampler->interpolate_format,
sampler->sampler_buffer[0],
GEGL_AUTO_ROWSTRIDE,
GEGL_ABYSS_NONE);
repeat_mode);
sampler->sampler_rectangle[0] = fetch_rectangle;
}
......@@ -374,7 +376,8 @@ gfloat *
gegl_sampler_get_from_mipmap (GeglSampler *const sampler,
const gint x,
const gint y,
const gint level)
const gint level,
GeglAbyssPolicy repeat_mode)
{
guchar *buffer_ptr;
gint dx;
......@@ -453,7 +456,7 @@ gegl_sampler_get_from_mipmap (GeglSampler *const sampler,
sampler->interpolate_format,
sampler->sampler_buffer[level],
GEGL_AUTO_ROWSTRIDE,
GEGL_ABYSS_NONE);
repeat_mode);
sampler->sampler_rectangle[level] = fetch_rectangle;
}
......
......@@ -94,16 +94,19 @@ void gegl_sampler_get (GeglSampler *self,
void *output,
GeglAbyssPolicy repeat_mode);
gfloat * gegl_sampler_get_from_buffer (GeglSampler *sampler,
gint x,
gint y);
gfloat * gegl_sampler_get_from_mipmap (GeglSampler *sampler,
gint x,
gint y,
gint level);
gfloat * gegl_sampler_get_ptr (GeglSampler *sampler,
gint x,
gint y);
gfloat * gegl_sampler_get_from_buffer (GeglSampler *const sampler,
const gint x,
const gint y,
GeglAbyssPolicy repeat_mode);
gfloat * gegl_sampler_get_from_mipmap (GeglSampler *const sampler,
const gint x,
const gint y,
const gint level,
GeglAbyssPolicy repeat_mode);
gfloat * gegl_sampler_get_ptr (GeglSampler *const sampler,
const gint x,
const gint y,
GeglAbyssPolicy repeat_mode);
G_END_DECLS
......
......@@ -1062,7 +1062,7 @@ gegl_node_blit (GeglNode *self,
{
if (destination_buf)
{
gegl_buffer_get (buffer, 1.0, roi, format, destination_buf, rowstride);
gegl_buffer_get (buffer, 1.0, roi, format, destination_buf, rowstride, GEGL_REPEAT_MODE_ZERO);
}
if (scale != 1.0)
......
......@@ -125,8 +125,8 @@ process (GeglOperation *operation,
gegl_buffer_get (temp_in, NULL, 1.0, babl_format ("RGBA float"), buf,
GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
gegl_buffer_get (temp_aux, NULL, 1.0, babl_format ("RGBA float"), bufB, GEGL_AUTO_ROWSTRIDE,
GEGL_ABYSS_NONE);
gegl_buffer_get (temp_aux, NULL, 1.0, babl_format ("RGBA float"), bufB,
GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
{
gint offset=0;
gint x,y;
......
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