Commit 37fb3f2e authored by Øyvind Kolås's avatar Øyvind Kolås

modified to use "provider" instead of "source" property when doing

	* gegl/operations/*/*.c: modified to use "provider" instead of
	"source" property when doing low-level GeglBuffer actions, also
	replaced some sub-buffer creations with gegl_buffer_create_sub_buffer.



svn path=/trunk/; revision=1606
parent 426947bd
2007-09-06 Øyvind Kolås <pippin@gimp.org>
* gegl/operations/*/*.c: modified to use "provider" instead of
"source" property when doing low-level GeglBuffer actions, also
replaced some sub-buffer creations with gegl_buffer_create_sub_buffer.
2007-09-06 Øyvind Kolås <pippin@gimp.org>
Made GeglTileStore become GeglTileProvider.
......
......@@ -691,7 +691,7 @@ process (GeglOperation *operation,
affine->matrix [1][2] == (gint) affine->matrix [1][2])))
{
output = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"provider", input,
"x", result->x,
"y", result->y,
"width", result->width ,
......
......@@ -60,7 +60,7 @@ process (GeglOperation *operation,
g_assert (input);
output = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"provider", input,
"x", (int)crop->x,
"y", (int)crop->y,
"width", (int)crop->width,
......
......@@ -58,7 +58,7 @@ process (GeglOperation *operation,
g_assert (input);
output = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"provider", input,
"shift-x", (int)-translate->x,
"shift-y", (int)-translate->y,
"abyss-width", -1, /* turn of abyss (relying
......
......@@ -139,7 +139,7 @@ process (GeglOperation *operation,
*
*/
source = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"provider", input,
"x", result->x,
"y", result->y,
"width", result->width ,
......
......@@ -60,13 +60,7 @@ load_cache (GeglChantOperation *op_magick_load)
{
GeglBuffer *cache = GEGL_BUFFER(gegl_node_get_cache (temp_gegl));
GeglBuffer *newbuf = g_object_new (GEGL_TYPE_BUFFER,
"source", cache,
"x", rect.x,
"y", rect.y,
"width", rect.width,
"height", rect.height,
NULL);
GeglBuffer *newbuf = gegl_buffer_create_sub_buffer (cache, &rect);
op_magick_load->priv = (gpointer)newbuf;
g_object_unref (cache);
}
......
......@@ -72,34 +72,17 @@ process (GeglOperation *operation,
}
else
{
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
bilateral_filter (temp_in, output, self->blur_radius, self->edge_preservation);
g_object_unref (temp_in);
}
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -62,28 +62,10 @@ process (GeglOperation *operation,
GeglBuffer *temp;
GeglRectangle compute = gegl_operation_compute_input_request (operation, "inputt", gegl_operation_need_rect (operation, context_id));
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
temp = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
temp = gegl_buffer_new (&compute, babl_format ("RGBA float"));
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
hor_max (temp_in, temp, self->radius);
ver_max (temp, output, self->radius);
......@@ -92,13 +74,8 @@ process (GeglOperation *operation,
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -63,28 +63,11 @@ process (GeglOperation *operation,
GeglBuffer *temp;
GeglRectangle compute = gegl_operation_compute_input_request (operation, "inputt", gegl_operation_need_rect (operation, context_id));
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
temp = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
temp = gegl_buffer_new (&compute, babl_format ("RGBA float"));
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
hor_min (temp_in, temp, self->radius);
......@@ -94,13 +77,7 @@ process (GeglOperation *operation,
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -69,34 +69,16 @@ process (GeglOperation *operation,
}
else
{
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
median (temp_in, output, self->radius, self->percentile / 100.0);
g_object_unref (temp_in);
}
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -73,34 +73,16 @@ process (GeglOperation *operation,
GeglBuffer *temp_in;
GeglRectangle compute = gegl_operation_compute_input_request (operation, "inputt", gegl_operation_need_rect (operation, context_id));
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
c2g (temp_in, output, self->radius, self->samples, self->iterations, self->same_spray, self->rgamma, self->strength, self->gamma);
g_object_unref (temp_in);
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -57,34 +57,15 @@ process (GeglOperation *operation,
GeglRectangle compute = gegl_operation_compute_input_request (operation, "inputt", gegl_operation_need_rect (operation, context_id));
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGB float"),
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
demosaic (self, temp_in, output);
g_object_unref (temp_in);
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -69,34 +69,15 @@ process (GeglOperation *operation,
}
else
{
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
median (temp_in, output, self->radius, self->percentile / 100.0);
g_object_unref (temp_in);
}
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -124,13 +124,7 @@ process (GeglOperation *operation,
priv->buf = g_malloc (priv->width * priv->height * 4);
}
source = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", requested->x,
"y", requested->y,
"width", requested->width ,
"height", requested->height,
NULL);
source = gegl_buffer_create_sub_buffer (input, requested);
gegl_buffer_get (source, NULL, 1.0, babl_format ("R'G'B'A u8"), priv->buf);
gtk_widget_queue_draw (priv->drawing_area);
......
......@@ -55,29 +55,10 @@ process (GeglOperation *operation,
* include both input buffers
*/
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", result->x,
"y", result->y,
"width", result->width,
"height", result->height,
NULL);
temp_aux = g_object_new (GEGL_TYPE_BUFFER,
"source", aux,
"x", result->x,
"y", result->y,
"width", result->width,
"height", result->height,
"shift-x", -(input->width + input->x),
"shift-y", -(input->y),
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", result->x,
"y", result->y,
"width", result->width,
"height", result->height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, result);
temp_aux = gegl_buffer_create_sub_buffer (aux, result);
output = gegl_buffer_new (result, babl_format ("RGBA float"));
{
gfloat *buf = g_malloc0 (result->width * result->height * 4 * 4);
gfloat *bufB = g_malloc0 (result->width * result->height * 4 * 4);
......
......@@ -59,34 +59,15 @@ process (GeglOperation *operation,
GeglBuffer *temp_in;
GeglRectangle compute = gegl_operation_compute_input_request (operation, "inputt", gegl_operation_need_rect (operation, context_id));
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
kuwahara (temp_in, output, self->radius);
g_object_unref (temp_in);
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -58,34 +58,15 @@ process (GeglOperation *operation,
GeglBuffer *temp_in;
GeglRectangle compute = gegl_operation_compute_input_request (operation, "inputt", gegl_operation_need_rect (operation, context_id));
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
kuwahara (temp_in, output, self->radius);
g_object_unref (temp_in);
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -59,34 +59,17 @@ process (GeglOperation *operation,
GeglBuffer *temp_in;
GeglRectangle compute = gegl_operation_compute_input_request (operation, "inputt", gegl_operation_need_rect (operation, context_id));
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width ,
"height", compute.height ,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
kuwahara (temp_in, output, self->radius);
g_object_unref (temp_in);
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -74,34 +74,15 @@ process (GeglOperation *operation,
}
else
{
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
max_envelope (temp_in, output, self->radius, self->samples, self->iterations, self->same_spray, self->rgamma);
g_object_unref (temp_in);
}
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -78,23 +78,9 @@ process (GeglOperation *operation,
GeglRectangle *result = gegl_operation_result_rect (operation, context_id);
GeglBuffer *temp_in;
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height ,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height ,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, result);
output = gegl_buffer_new (result, babl_format ("RGBA float"));
{
gint pixels = result->width*result->height;
gint bufsize = pixels*4*sizeof(gfloat);
......
......@@ -74,34 +74,15 @@ process (GeglOperation *operation,
}
else
{
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
min_envelope (temp_in, output, self->radius, self->samples, self->iterations, self->same_spray, self->rgamma);
g_object_unref (temp_in);
}
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -70,34 +70,15 @@ process (GeglOperation *operation,
}
else
{
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
snn_mean (temp_in, output, self->radius, self->pairs);
g_object_unref (temp_in);
}
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
gegl_operation_set_data (operation, context_id, "output", G_OBJECT (cropped));
g_object_unref (output);
}
......
......@@ -76,34 +76,14 @@ process (GeglOperation *operation,
}
else
{
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", compute.x,
"y", compute.y,
"width", compute.width,
"height", compute.height,
NULL);
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
snn_percentile (temp_in, output, self->radius, self->percentile, self->pairs);
g_object_unref (temp_in);
}
{
GeglBuffer *cropped = g_object_new (GEGL_TYPE_BUFFER,
"source", output,
"x", result->x,
"y", result->y,
"width", result->width ,
"height", result->height,
NULL);
GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);