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

modified order of arguments for gegl_node_blit (scale comes before

	* gegl/gegl.h: modified order of arguments for gegl_node_blit (scale
	comes before rectangle) as well as added GEGL_AUTO_ROWSTRIDE =0 define
	to be used for automatic computation of rowstride for gegl_node_blit
	and gegl_buffer_get
	* gegl/buffer/gegl-buffer.[ch]: modified order of arguments for
	gegl_buffer_get() as well as added a rowstride argument.

	These files in the gegl core needed changes to adapt:

	* bin/export.c:
	* bin/gegl-view.c:
	* gegl/buffer/gegl-cache.c:
	* gegl/buffer/gegl-interpolator.c:
	* gegl/graph/gegl-node.[ch]:
	* gegl/operation/gegl-operation-point-composer.c:
	* gegl/operation/gegl-operation-point-filter.c:
	* gegl/operation/gegl-operation.c:
	* gegl/process/gegl-processor.c:

	And all operations were touched as well.

	* operations/*/*.c:
	* operations/*/*/*.c:

svn path=/trunk/; revision=1651
parent d664e8de
2007-09-16 Øyvind Kolås <pippin@gimp.org>
* gegl/gegl.h: modified order of arguments for gegl_node_blit (scale
comes before rectangle) as well as added GEGL_AUTO_ROWSTRIDE =0 define
to be used for automatic computation of rowstride for gegl_node_blit
and gegl_buffer_get
* gegl/buffer/gegl-buffer.[ch]: modified order of arguments for
gegl_buffer_get() as well as added a rowstride argument.
These files in the gegl core needed changes to adapt:
* bin/export.c:
* bin/gegl-view.c:
* gegl/buffer/gegl-cache.c:
* gegl/buffer/gegl-interpolator.c:
* gegl/graph/gegl-node.[ch]:
* gegl/operation/gegl-operation-point-composer.c:
* gegl/operation/gegl-operation-point-filter.c:
* gegl/operation/gegl-operation.c:
* gegl/process/gegl-processor.c:
And all operations were touched as well.
* operations/*/*.c:
* operations/*/*/*.c:
2007-09-16 Øyvind Kolås <pippin@gimp.org>
* gegl/buffer/gegl-buffer.c: improved precision of rendering in
......
......@@ -328,7 +328,7 @@ gegl_buffer_export_png (GeglBuffer *gegl_buffer,
for (i=0; i< rect->height; i++)
{
GeglRectangle line = {rect->x, rect->y + i, rect->width , 1};
gegl_buffer_get (gegl_buffer, &line, 1.0, babl_format (format_string), pixels);
gegl_buffer_get (gegl_buffer, 1.0, &line, babl_format (format_string), pixels, GEGL_AUTO_ROWSTRIDE);
png_write_rows (png, &pixels, 1);
}
png_write_end (png, info);
......
......@@ -364,11 +364,11 @@ expose_event (GtkWidget *widget,
/* FIXME: this padding should not be needed, but it avoids some segfaults */
gegl_node_blit (view->node,
&roi,
view->scale,
&roi,
babl_format ("R'G'B' u8"),
0, /* rowstride, currently unused */
(gpointer)buf,
GEGL_AUTO_ROWSTRIDE,
GEGL_BLIT_CACHE|GEGL_BLIT_DIRTY);
gdk_draw_rgb_image (widget->window,
......
2007-09-16 Øyvind Kolås <pippin@gimp.org>
reviewed by: <delete if not using a buddy>
* Makefile.am:
2007-09-12 Øyvind Kolås <pippin@gimp.org>
* index-static.html.in: include UNCONFIRMED and NEEDINFO bug statuses
......
......@@ -105,3 +105,6 @@ website:
(mkdir -p $$WEBSITE_DESTINATION;\
cp --parents -rv $(WEBSITE_FILES) $$WEBSITE_DESTINATION;);\
fi
hello-world: hello-world.c
$(CC) $< -o $@ `pkg-config --cflags --libs gegl`
......@@ -40,7 +40,7 @@ struct _GeglBuffer
provider field which is used for chaining
sub buffers with their anchestors */
GeglRectangle extent; /* the dimensions of the buffer */
GeglRectangle extent; /* the dimensions of the buffer */
Babl *format; /* the pixel format used for pixels in this
buffer */
......
......@@ -1445,10 +1445,11 @@ static void resample_boxfilter_u8 (void *dest_buf,
void
gegl_buffer_get (GeglBuffer *buffer,
GeglRectangle *rect,
gdouble scale,
GeglRectangle *rect,
Babl *format,
void *dest_buf)
gpointer dest_buf,
gint rowstride)
{
if (format == NULL)
......@@ -1724,7 +1725,7 @@ gegl_buffer_copy (GeglBuffer *src,
for (i=0; i<src_rect->height; i++)
{
gegl_buffer_get (src, &src_line, 1.0, format, temp);
gegl_buffer_get (src, 1.0, &src_line, format, temp, GEGL_AUTO_ROWSTRIDE);
gegl_buffer_set (dst, &dst_line, format, temp);
src_line.y++;
dst_line.y++;
......
......@@ -94,16 +94,22 @@ G_GNUC_CONST GeglRectangle * gegl_buffer_extent (GeglBuffer *buffer);
#define gegl_buffer_height(buffer) (gegl_buffer_extent(buffer)->height)
#define gegl_buffer_pixel_count(buffer) (gegl_buffer_width(buffer) * gegl_buffer_height(buffer))
#ifndef GEGL_AUTO_ROWSTRIDE
#define GEGL_AUTO_ROWSTRIDE 0
#endif
/**
* gegl_buffer_get:
* @buffer: the buffer to retrieve data from.
* @scale: sampling scale, 1.0 = pixel for pixel 2.0 = magnify, 0.5 scale down.
* @rect: the coordinates we want to retrieve data from, and width/height of
* destination buffer, if NULL equal to the extent of the buffer. The
* coordinates and dimensions are after scale has been applied.
* @scale: sampling scale, 1.0 = pixel for pixel 2.0 = magnify, 0.5 scale down.
* @format: the BablFormat to store in the linear buffer @dest.
* @dest: the memory destination for a linear buffer for the pixels, the size needed
* depends on the requested BablFormat.
* @rowstride: rowstride in bytes, or GEGL_ROWSTRIDE_AUTO to compute the
* rowstride based on the width and bytes per pixel for the specified format.
*
* Fetch a rectangular linear buffer of pixel data from the GeglBuffer, the data is
* converted to the desired BablFormat, if the BablFormat stored and fetched is the
......@@ -111,10 +117,11 @@ G_GNUC_CONST GeglRectangle * gegl_buffer_extent (GeglBuffer *buffer);
* a linear buffer.
*/
void gegl_buffer_get (GeglBuffer *buffer,
GeglRectangle *rect,
gdouble scale,
GeglRectangle *rect,
Babl *format,
void *dest);
gpointer dest,
gint rowstride);
/**
* gegl_buffer_set:
......
......@@ -283,10 +283,42 @@ get_property (GObject *gobject,
}
}
#if 0
static void
gegl_buffer_clear (GeglBuffer *buffer,
GeglRectangle *rectangle)
{
gint pixels = rectangle->width * rectangle->height;
guchar *buf = g_malloc (pixels * 4);
gint i;
for (i=0;i<pixels;i++)
{
buf[i*4+0]=25;
buf[i*4+1]=0;
buf[i*4+2]=25;
buf[i*4+3]=40;
}
gegl_buffer_set (buffer, rectangle, babl_format ("RGBA u8"), buf);
g_free (buf);
}
#endif
void
gegl_cache_invalidate (GeglCache *self,
GeglRectangle *roi)
{
#if 0
if (roi)
{
g_print ("invalidate of %i,%i %i×%i\n", roi->x, roi->y, roi->width, roi->height);
gegl_buffer_clear (GEGL_BUFFER (self), roi);
}
else
{
g_print ("full invalidate of a GeglCache\n");
}
#endif
if (roi)
{
GeglRegion *temp_region;
......
......@@ -201,9 +201,9 @@ gegl_interpolator_fill_buffer (GeglInterpolator *interpolator,
interpolator->cache_rectangle = surround;
interpolator->interpolate_format = babl_format ("RaGaBaA float");
gegl_buffer_get (buffer, &surround, 1.0,
gegl_buffer_get (buffer, 1.0, &surround,
interpolator->interpolate_format,
interpolator->cache_buffer);
interpolator->cache_buffer, GEGL_AUTO_ROWSTRIDE);
}
static void
......
......@@ -22,7 +22,7 @@
#define __GEGL_H__
#include <glib-object.h>
#include <babl/babl.h>
/***
* The GEGL API:
......@@ -379,17 +379,22 @@ typedef enum
} GeglBlitFlags;
#endif
#ifndef GEGL_AUTO_ROWSTRIDE
#define GEGL_AUTO_ROWSTRIDE 0
#endif
/**
* gegl_node_blit:
* @node: a #GeglNode
* @roi: the rectangle to render from the node, the coordinate system used is
* coordinates after scale has been applied.
* @scale: the scale to render at 1.0 is default, other values changes the
* width/height of the sampled region.
* @roi: the rectangle to render from the node, the coordinate system used is
* coordinates after scale has been applied.
* @format: the #BablFormat desired.
* @rowstride: rowstride in bytes (currently ignored)
* @destination_buf: a memory buffer large enough to contain the data, can be
* left as NULL when forcing a rendering of a region.
* @rowstride: rowstride in bytes, or GEGL_AUTO_ROWSTRIDE to compute the
* rowstride based on the width and bytes per pixel for the specified format.
* @flags: an or'ed combination of GEGL_BLIT_DEFAULT, GEGL_BLIT_CACHE and
* GEGL_BLIT_DIRTY. if cache is enabled, a cache will be set up for subsequent
* requests of image data from this node. By passing in GEGL_BLIT_DIRTY the
......@@ -399,11 +404,11 @@ typedef enum
* Render a rectangular region from a node.
*/
void gegl_node_blit (GeglNode *node,
GeglRectangle *roi,
gdouble scale,
void *format,
GeglRectangle *roi,
Babl *format,
gpointer destination_buf,
gint rowstride,
gpointer *destination_buf,
GeglBlitFlags flags);
/**
......
......@@ -710,13 +710,14 @@ gegl_node_apply_roi (GeglNode *self,
return buffer;
}
void gegl_node_blit (GeglNode *node,
GeglRectangle *roi,
gdouble scale,
void *format,
gint rowstride,
gpointer *destination_buf,
GeglBlitFlags flags)
void
gegl_node_blit (GeglNode *node,
gdouble scale,
GeglRectangle *roi,
Babl *format,
gpointer destination_buf,
gint rowstride,
GeglBlitFlags flags)
{
if (flags == GEGL_BLIT_DEFAULT)
{
......@@ -727,7 +728,7 @@ void gegl_node_blit (GeglNode *node,
if (destination_buf)
{
gegl_buffer_get (roi_buf, NULL, 1.0, format, destination_buf);
gegl_buffer_get (roi_buf, 1.0, NULL, format, destination_buf, GEGL_AUTO_ROWSTRIDE);
}
g_object_unref (roi_buf);
if (scale != 1.0)
......@@ -751,7 +752,8 @@ void gegl_node_blit (GeglNode *node,
}
if (destination_buf)
{
gegl_buffer_get (GEGL_BUFFER (cache), roi, scale, format, destination_buf);
gegl_buffer_get (GEGL_BUFFER (cache), scale, roi,
format, destination_buf, rowstride);
}
}
}
......
......@@ -86,11 +86,11 @@ struct _GeglNodeClass
/* renders the desired region of interest to a buffer of the specified
* bablformat */
void gegl_node_blit (GeglNode *node,
GeglRectangle *roi,
gdouble scale,
void *format,
GeglRectangle *roi,
Babl *format,
gpointer destination_buf,
gint rowstride,
gpointer *destination_buf,
GeglBlitFlags flags);
GeglRectangle gegl_node_get_bounding_box (GeglNode *root);
......
......@@ -128,13 +128,13 @@ process_inner (GeglOperation *operation,
output->extent.width * output->extent.height);
}
gegl_buffer_get (input, result, 1.0, in_format, in_buf);
gegl_buffer_get (input, 1.0, result, in_format, in_buf, GEGL_AUTO_ROWSTRIDE);
if (aux)
{
aux_buf = g_malloc (aux_format->format.bytes_per_pixel *
output->extent.width * output->extent.height);
gegl_buffer_get (aux, result, 1.0, aux_format, aux_buf);
gegl_buffer_get (aux, 1.0, result, aux_format, aux_buf, GEGL_AUTO_ROWSTRIDE);
}
{
GEGL_OPERATION_POINT_COMPOSER_GET_CLASS (operation)->process (
......
......@@ -97,7 +97,7 @@ process_inner (GeglOperation *operation,
buf = g_malloc (in_format->format.bytes_per_pixel *
output->extent.width * output->extent.height);
gegl_buffer_get (input, result, 1.0, in_format, buf);
gegl_buffer_get (input, 1.0, result, in_format, buf, GEGL_AUTO_ROWSTRIDE);
GEGL_OPERATION_POINT_FILTER_GET_CLASS (operation)->process (
operation,
......@@ -117,7 +117,7 @@ process_inner (GeglOperation *operation,
out_buf = g_malloc (out_format->format.bytes_per_pixel *
output->extent.width * output->extent.height);
gegl_buffer_get (input, result, 1.0, in_format, in_buf);
gegl_buffer_get (input, 1.0, result, in_format, in_buf, GEGL_AUTO_ROWSTRIDE);
GEGL_OPERATION_POINT_FILTER_GET_CLASS (operation)->process (
operation,
......
......@@ -651,7 +651,7 @@ gegl_operation_get_target (GeglOperation *operation,
/* uncomment the following to enable the experimental per node
caching
*/
/* #define ENABLE_CACHE */
#define ENABLE_CACHE
#ifdef ENABLE_CACHE
/* FIXME: make the cache be of the format indicated by the format,.. */
if (GEGL_OPERATION_CLASS (G_OBJECT_GET_CLASS (operation))->no_cache)
......
......@@ -342,7 +342,7 @@ static gboolean render_rectangle (GeglProcessor *processor)
buf = g_malloc (dr->width * dr->height * pxsize);
g_assert (buf);
gegl_node_blit (cache->node, dr, 1.0, cache->format, 0, (gpointer *) buf, GEGL_BLIT_DEFAULT);
gegl_node_blit (cache->node, 1.0, dr, cache->format, buf, GEGL_AUTO_ROWSTRIDE, GEGL_BLIT_DEFAULT);
gegl_buffer_set (GEGL_BUFFER (cache), dr, cache->format, buf);
gegl_region_union_with_rect (cache->valid_region, (GeglRectangle *) dr);
......
......@@ -167,7 +167,7 @@ hor_blur (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RaGaBaA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset = 0;
for (v=0; v<gegl_buffer_height (dst); v++)
......@@ -209,7 +209,7 @@ ver_blur (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_width (src) * gegl_buffer_height (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_width (dst) * gegl_buffer_height (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RaGaBaA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset=0;
for (v=0; v<gegl_buffer_height (dst); v++)
......
......@@ -229,7 +229,7 @@ iir_young_hor_blur (GeglBuffer *src,
buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
w = g_malloc0 (gegl_buffer_width (src) * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RaGaBaA float"), buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
w_len = gegl_buffer_width (src);
for (v=0; v<gegl_buffer_height (src); v++)
......@@ -267,7 +267,7 @@ iir_young_ver_blur (GeglBuffer *src,
buf = g_malloc0 (gegl_buffer_width (src) * gegl_buffer_height (src) * 4 * 4);
w = g_malloc0 (gegl_buffer_height (src) * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RaGaBaA float"), buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
w_len = gegl_buffer_height (src);
......@@ -383,7 +383,7 @@ fir_hor_blur (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_width (src) * gegl_buffer_height (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_width (dst) * gegl_buffer_height (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RaGaBaA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset = 0;
for (v=0; v<gegl_buffer_height (dst); v++)
......@@ -424,7 +424,7 @@ fir_ver_blur (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_width (src) * gegl_buffer_height (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_width (dst) * gegl_buffer_height (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RaGaBaA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset=0;
for (v=0; v<gegl_buffer_height (dst); v++)
......
......@@ -156,9 +156,9 @@ process (GeglOperation *operation,
min = g_malloc (pixels * sizeof (gfloat) * 3);
max = g_malloc (pixels * sizeof (gfloat) * 3);
gegl_buffer_get (input, result, 1.0, babl_format ("RGBA float"), buf);
gegl_buffer_get (low, result, 1.0, babl_format ("RGB float"), min);
gegl_buffer_get (high, result, 1.0, babl_format ("RGB float"), max);
gegl_buffer_get (input, 1.0, result, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
gegl_buffer_get (low, 1.0, result, babl_format ("RGB float"), min, GEGL_AUTO_ROWSTRIDE);
gegl_buffer_get (high, 1.0, result, babl_format ("RGB float"), max, GEGL_AUTO_ROWSTRIDE);
output = gegl_operation_get_target (operation, context_id, "output");
......
......@@ -61,7 +61,7 @@ buffer_get_min_max (GeglBuffer *buffer,
gfloat *buf = g_malloc0 (sizeof (gfloat) * 4 * gegl_buffer_pixel_count (buffer));
gint i;
gegl_buffer_get (buffer, NULL, 1.0, babl_format ("RGBA float"), buf);
gegl_buffer_get (buffer, 1.0, NULL, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
for (i=0;i< gegl_buffer_pixel_count (buffer);i++)
{
gint component;
......@@ -114,7 +114,7 @@ process (GeglOperation *operation,
result->width ,
chunk};
gegl_buffer_get (input, &line, 1.0, babl_format ("RGBA float"), buf);
gegl_buffer_get (input, 1.0, &line, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
inner_process (min, max, buf, result->width * chunk);
gegl_buffer_set (output, &line, babl_format ("RGBA float"), buf);
consumed+=chunk;
......
......@@ -140,8 +140,8 @@ process (GeglOperation *operation,
*/
source = gegl_buffer_create_sub_buffer (input, result);
gegl_buffer_get (source,
NULL,
1.0,
NULL,
babl_format_new (babl_model ("R'G'B'A"),
babl_type ("u8"),
babl_component ("B'"),
......@@ -149,7 +149,7 @@ process (GeglOperation *operation,
babl_component ("R'"),
babl_component ("A"),
NULL),
((SDL_Surface*)self->screen)->pixels);
((SDL_Surface*)self->screen)->pixels, GEGL_AUTO_ROWSTRIDE);
g_object_unref (source);
if (!sdl_outwin)
......
......@@ -240,7 +240,7 @@ fix_saturation (GeglBuffer *buf,
for (y=0; y<2; y++)
{
gegl_rectangle_set (&rect, 0,y, gegl_buffer_width (buf), 1);
gegl_buffer_get (buf, &rect, 1.0, buf->format, row[y+1]);
gegl_buffer_get (buf, 1.0, &rect, buf->format, row[y+1], GEGL_AUTO_ROWSTRIDE);
}
fix_saturation_row (row[1], row[1], row[2], yw, gegl_buffer_width (buf), nc);
......@@ -254,7 +254,7 @@ fix_saturation (GeglBuffer *buf,
}
gegl_rectangle_set (&rect, 0,y+1, gegl_buffer_width (buf), 1);
gegl_buffer_get (buf, &rect, 1.0, buf->format, row[0]);
gegl_buffer_get (buf, 1.0, &rect, buf->format, row[0], GEGL_AUTO_ROWSTRIDE);
tmp = row[0];
row[0] = row[1];
......@@ -335,7 +335,7 @@ reconstruct_chroma (GeglBuffer *buf,
for (i=0; i<gegl_buffer_height (buf); i+=2)
{
gegl_rectangle_set (&rect, 0, i, gegl_buffer_width (buf), 1);
gegl_buffer_get (buf, &rect, 1.0, buf->format, pixels);
gegl_buffer_get (buf, 1.0, &rect, buf->format, pixels, GEGL_AUTO_ROWSTRIDE);
reconstruct_chroma_row (pixels, gegl_buffer_width (buf), has_alpha, tmp);
gegl_buffer_set (buf, &rect, buf->format, pixels);
......@@ -344,7 +344,7 @@ reconstruct_chroma (GeglBuffer *buf,
for (i=0; i<gegl_buffer_width (buf); i++)
{
gegl_rectangle_set (&rect, i, 0, 1, gegl_buffer_height (buf));
gegl_buffer_get (buf, &rect, 1.0, buf->format, pixels);
gegl_buffer_get (buf, 1.0, &rect, buf->format, pixels, GEGL_AUTO_ROWSTRIDE);
reconstruct_chroma_row (pixels, gegl_buffer_height (buf), has_alpha, tmp);
gegl_buffer_set (buf, &rect, buf->format, pixels);
......@@ -372,7 +372,7 @@ convert_yca_to_rgba (GeglBuffer *buf,
for (row=0; row<gegl_buffer_height (buf); row++)
{
gegl_rectangle_set (&rect, 0, row, gegl_buffer_width (buf), 1);
gegl_buffer_get (buf, &rect, 1.0, buf->format, pixels);
gegl_buffer_get (buf, 1.0, &rect, buf->format, pixels, GEGL_AUTO_ROWSTRIDE);
pxl = (gfloat*) pixels;
for (i=0; i<gegl_buffer_width (buf); i++)
......
......@@ -51,7 +51,7 @@ load_cache (GeglChantOperation *op_magick_load)
temp_gegl = gegl_parse_xml (xml, "/");
rect = gegl_node_get_bounding_box (temp_gegl);
gegl_node_blit (temp_gegl, &rect, 1.0, NULL, 0, NULL, GEGL_BLIT_CACHE); /* force a render
gegl_node_blit (temp_gegl, 1.0, &rect, NULL, NULL, 0, GEGL_BLIT_CACHE); /* force a render
of the cache,
passing in a NULL
buffer indicating that
......
......@@ -282,7 +282,7 @@ gegl_buffer_import_png (GeglBuffer *gegl_buffer,
gegl_rectangle_set (&rect, 0, i, width, 1);
if (pass != 0)
gegl_buffer_get (gegl_buffer, &rect, 1.0, format, pixels);
gegl_buffer_get (gegl_buffer, 1.0, &rect, format, pixels, GEGL_AUTO_ROWSTRIDE);
png_read_rows (load_png_ptr, &pixels, NULL, 1);
gegl_buffer_set (gegl_buffer, &rect, format, pixels);
......
......@@ -147,7 +147,7 @@ gegl_buffer_export_png (GeglBuffer *gegl_buffer,
for (i=0; i< height; i++)
{
GeglRectangle rect = {src_x, src_y+i, width, 1};
gegl_buffer_get (gegl_buffer, &rect, 1.0, babl_format (format_string), pixels);
gegl_buffer_get (gegl_buffer, 1.0, &rect, babl_format (format_string), pixels, GEGL_AUTO_ROWSTRIDE);
png_write_rows (png, &pixels, 1);
}
......
......@@ -69,7 +69,7 @@ process (GeglOperation *operation,
babl = babl_format (name);
temp = g_malloc (rect->width * rect->height * bps);
gegl_buffer_get (input, rect, 1., babl, temp);
gegl_buffer_get (input, 1.0, rect, babl, temp, GEGL_AUTO_ROWSTRIDE);
*pixbuf = gdk_pixbuf_new_from_data (temp,
GDK_COLORSPACE_RGB,
......
......@@ -105,7 +105,7 @@ bilateral_filter (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count(src) * 4 *4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count(dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset = 0;
......
......@@ -130,7 +130,7 @@ hor_max (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset = 0;
for (v=0; v<gegl_buffer_height (dst); v++)
......@@ -168,7 +168,7 @@ ver_max (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset=0;
for (v=0; v<gegl_buffer_height (dst); v++)
......
......@@ -132,7 +132,7 @@ hor_min (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset = 0;
for (v=0; v<gegl_buffer_height (dst); v++)
......@@ -170,7 +170,7 @@ ver_min (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset=0;
for (v=0; v<gegl_buffer_height (dst); v++)
......
......@@ -178,7 +178,7 @@ median (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset = 0;
for (y=0; y<gegl_buffer_height (dst); y++)
......
......@@ -110,7 +110,7 @@ static void c2g (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
for (y=radius; y<gegl_buffer_height (dst)-radius; y++)
{
gint offset = ((gegl_buffer_width (src)*y)+radius)*4;
......
......@@ -90,7 +90,7 @@ demosaic (GeglChantOperation *op,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 3);
gegl_buffer_get (src, NULL, 1.0, babl_format ("Y float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("Y float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset=0;
for (y=src_extent->y; y<dst_extent->height + src_extent->y; y++)
......
......@@ -177,7 +177,7 @@ median (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset = 0;
for (y=0; y<gegl_buffer_height (dst); y++)
......
......@@ -705,7 +705,7 @@ fill_yuv_image (GeglChantOperation *op,
op->input_pad[0]->width * op->input_pad[0]->height * 3);*/
GeglRectangle rect={0,0,width,height};
gegl_buffer_get (p->input, &rect, 1.0, babl_format ("R'G'B' u8"), pict->data[0]);
gegl_buffer_get (p->input, 1.0, &rect, babl_format ("R'G'B' u8"), pict->data[0], GEGL_AUTO_ROWSTRIDE);
}
static void
......
......@@ -126,7 +126,7 @@ process (GeglOperation *operation,
source = gegl_buffer_create_sub_buffer (input, requested);
gegl_buffer_get (source, NULL, 1.0, babl_format ("R'G'B'A u8"), priv->buf);
gegl_buffer_get (source, 1.0, NULL, babl_format ("R'G'B'A u8"), priv->buf, GEGL_AUTO_ROWSTRIDE);
gtk_widget_queue_draw (priv->drawing_area);
if (priv->window)
......
......@@ -63,8 +63,8 @@ process (GeglOperation *operation,
gfloat *buf = g_malloc0 (result->width * result->height * 4 * 4);
gfloat *bufB = g_malloc0 (result->width * result->height * 4 * 4);
gegl_buffer_get (temp_in, NULL, 1.0, babl_format ("RGBA float"), buf);
gegl_buffer_get (temp_aux, NULL, 1.0, babl_format ("RGBA float"), bufB);
gegl_buffer_get (temp_in, 1.0, NULL, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
gegl_buffer_get (temp_aux, 1.0, NULL, babl_format ("RGBA float"), bufB, GEGL_AUTO_ROWSTRIDE);
{
gint offset=0;
gint x,y;
......
......@@ -138,7 +138,7 @@ kuwahara (GeglBuffer *src,
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
offset = 0;