Commit 280876c2 authored by Øyvind Kolås's avatar Øyvind Kolås

renamed gegl_buffer_extent to gegl_buffer_get_extent. Made marked

* gegl/buffer/gegl-buffer.[ch]: renamed gegl_buffer_extent to
gegl_buffer_get_extent. Made marked GeglRectangle parameters of
GeglRectangle methods as const. renamed gegl_buffer_x gegl_buffer_y
gegl_buffer_width gegl_buffer_height and gegl_buffer_pixel_count to
to containt _get_ as well.
* operations/affine/affine.c:
* operations/blur/box-blur.c: 
* operations/blur/gaussian-blur.c:
* operations/color/stretch-contrast.c:
* operations/io/exr-load.cpp:
* operations/io/load-buffer.c:
* operations/io/raw-load.c: 
* operations/render/introspect.c:
* operations/workshop/bilateral-filter.c:
* operations/workshop/box-max.c:
* operations/workshop/box-min.c:
* operations/workshop/box-percentile.c: 
* operations/workshop/c2g.c: 
* operations/workshop/demosaic-simple.c:
* operations/workshop/disc-percentile.c:
* operations/workshop/hstack.c:
* operations/workshop/kuwahara-max.c:
* operations/workshop/kuwahara-min.c:
* operations/workshop/kuwahara.c: 
* operations/workshop/max-envelope.c:
* operations/workshop/min-envelope.c:
* operations/workshop/rawbayer-load.c: 
* operations/workshop/snn-mean.c: 
* operations/workshop/snn-percentile.c: 
* operations/workshop/stress.c: 

svn path=/trunk/; revision=1703
parent 488e1125
2007-11-13 Øyvind Kolås <pippin@gimp.org>
* gegl/buffer/gegl-buffer.[ch]: renamed gegl_buffer_extent to
gegl_buffer_get_extent. Made marked GeglRectangle parameters of
GeglRectangle methods as const. renamed gegl_buffer_x gegl_buffer_y
gegl_buffer_width gegl_buffer_height and gegl_buffer_pixel_count to
to containt _get_ as well.
* operations/affine/affine.c:
* operations/blur/box-blur.c:
* operations/blur/gaussian-blur.c:
* operations/color/stretch-contrast.c:
* operations/io/exr-load.cpp:
* operations/io/load-buffer.c:
* operations/io/raw-load.c:
* operations/render/introspect.c:
* operations/workshop/bilateral-filter.c:
* operations/workshop/box-max.c:
* operations/workshop/box-min.c:
* operations/workshop/box-percentile.c:
* operations/workshop/c2g.c:
* operations/workshop/demosaic-simple.c:
* operations/workshop/disc-percentile.c:
* operations/workshop/hstack.c:
* operations/workshop/kuwahara-max.c:
* operations/workshop/kuwahara-min.c:
* operations/workshop/kuwahara.c:
* operations/workshop/max-envelope.c:
* operations/workshop/min-envelope.c:
* operations/workshop/rawbayer-load.c:
* operations/workshop/snn-mean.c:
* operations/workshop/snn-percentile.c:
* operations/workshop/stress.c:
2007-11-13 Øyvind Kolås <pippin@gimp.org>
* tools/create-reference.rb: modified to write a gegl.devhelp file
......
......@@ -1210,10 +1210,10 @@ gegl_buffer_iterate (GeglBuffer *buffer,
}
void
gegl_buffer_set (GeglBuffer *buffer,
GeglRectangle *rect,
Babl *format,
void *src)
gegl_buffer_set (GeglBuffer *buffer,
const GeglRectangle *rect,
Babl *format,
void *src)
{
GeglBuffer *sub_buf;
......@@ -1250,12 +1250,12 @@ gegl_buffer_set (GeglBuffer *buffer,
* level: halving levels 0 = 1:1 1=1:2 2=1:4 3=1:8 ..
*
*/
static void gegl_buffer_get_scaled (GeglBuffer *buffer,
GeglRectangle *rect,
void *dst,
gint rowstride,
void *format,
gint level)
static void gegl_buffer_get_scaled (GeglBuffer *buffer,
const GeglRectangle *rect,
void *dst,
gint rowstride,
void *format,
gint level)
{
GeglBuffer *sub_buf = gegl_buffer_create_sub_buffer (buffer, rect);
gegl_buffer_iterate (sub_buf, dst, rowstride, FALSE, format, level);
......@@ -1559,12 +1559,12 @@ static void resample_boxfilter_u8 (void *dest_buf,
#include <math.h>
void
gegl_buffer_get (GeglBuffer *buffer,
gdouble scale,
GeglRectangle *rect,
Babl *format,
gpointer dest_buf,
gint rowstride)
gegl_buffer_get (GeglBuffer *buffer,
gdouble scale,
const GeglRectangle *rect,
Babl *format,
gpointer dest_buf,
gint rowstride)
{
if (format == NULL)
......@@ -1738,8 +1738,8 @@ gegl_buffer_sample_cleanup (GeglBuffer *buffer)
}
}
G_GNUC_CONST GeglRectangle *
gegl_buffer_extent (GeglBuffer *buffer)
const GeglRectangle *
gegl_buffer_get_extent (GeglBuffer *buffer)
{
return &(buffer->extent);
}
......@@ -1766,8 +1766,8 @@ gegl_buffer_new (const GeglRectangle *extent,
}
GeglBuffer*
gegl_buffer_create_sub_buffer (GeglBuffer *buffer,
GeglRectangle *extent)
gegl_buffer_create_sub_buffer (GeglBuffer *buffer,
const GeglRectangle *extent)
{
return g_object_new (GEGL_TYPE_BUFFER,
"provider", buffer,
......@@ -1781,10 +1781,10 @@ gegl_buffer_create_sub_buffer (GeglBuffer *buffer,
}
void
gegl_buffer_copy (GeglBuffer *src,
GeglRectangle *src_rect,
GeglBuffer *dst,
GeglRectangle *dst_rect)
gegl_buffer_copy (GeglBuffer *src,
const GeglRectangle *src_rect,
GeglBuffer *dst,
const GeglRectangle *dst_rect)
{
/* FIXME: make gegl_buffer_copy work with COW shared tiles when possible */
......@@ -1799,7 +1799,7 @@ gegl_buffer_copy (GeglBuffer *src,
g_assert (dst);
if (!src_rect)
{
src_rect = gegl_buffer_extent (src);
src_rect = gegl_buffer_get_extent (src);
}
if (!dst_rect)
......@@ -1835,9 +1835,9 @@ gegl_buffer_dup (GeglBuffer *buffer)
GeglBuffer *new;
g_assert (buffer);
new = gegl_buffer_new (gegl_buffer_extent (buffer), buffer->format);
gegl_buffer_copy (buffer, gegl_buffer_extent (buffer),
new, gegl_buffer_extent (buffer));
new = gegl_buffer_new (gegl_buffer_get_extent (buffer), buffer->format);
gegl_buffer_copy (buffer, gegl_buffer_get_extent (buffer),
new, gegl_buffer_get_extent (buffer));
return new;
}
......
......@@ -63,7 +63,7 @@ GeglBuffer* gegl_buffer_new (const GeglRectangle *extent,
* Create a new sub GeglBuffer, that is a view on a larger buffer.
*/
GeglBuffer* gegl_buffer_create_sub_buffer (GeglBuffer *buffer,
GeglRectangle *extent);
const GeglRectangle *extent);
/**
* gegl_buffer_destroy:
......@@ -76,21 +76,21 @@ GeglBuffer* gegl_buffer_create_sub_buffer (GeglBuffer *buffer,
void gegl_buffer_destroy (GeglBuffer *buffer);
/**
* gegl_buffer_extent:
* gegl_buffer_get_extent:
* @buffer: the buffer to operate on.
*
* Returns a pointer to a GeglRectangle structure defining the geometry of a
* specific GeglBuffer, this is also the default width/height of buffers passed
* in to gegl_buffer_set and gegl_buffer_get (with a scale of 1.0 at least).
*/
G_GNUC_CONST GeglRectangle * gegl_buffer_extent (GeglBuffer *buffer);
const GeglRectangle * gegl_buffer_get_extent (GeglBuffer *buffer);
/* convenience access macros */
#define gegl_buffer_x(buffer) (gegl_buffer_extent(buffer)->x)
#define gegl_buffer_y(buffer) (gegl_buffer_extent(buffer)->y)
#define gegl_buffer_width(buffer) (gegl_buffer_extent(buffer)->width)
#define gegl_buffer_height(buffer) (gegl_buffer_extent(buffer)->height)
#define gegl_buffer_pixel_count(buffer) (gegl_buffer_width(buffer) * gegl_buffer_height(buffer))
#define gegl_buffer_get_x(buffer) (gegl_buffer_get_extent(buffer)->x)
#define gegl_buffer_get_y(buffer) (gegl_buffer_get_extent(buffer)->y)
#define gegl_buffer_get_width(buffer) (gegl_buffer_get_extent(buffer)->width)
#define gegl_buffer_get_height(buffer) (gegl_buffer_get_extent(buffer)->height)
#define gegl_buffer_get_pixel_count(buffer) (gegl_buffer_get_width(buffer) * gegl_buffer_get_height(buffer))
#ifndef GEGL_AUTO_ROWSTRIDE
#define GEGL_AUTO_ROWSTRIDE 0
......@@ -114,12 +114,12 @@ G_GNUC_CONST GeglRectangle * gegl_buffer_extent (GeglBuffer *buffer);
* same this amounts to a series of memcpy's aligned to demux the tile structure into
* a linear buffer.
*/
void gegl_buffer_get (GeglBuffer *buffer,
gdouble scale,
GeglRectangle *rect,
Babl *format,
gpointer dest,
gint rowstride);
void gegl_buffer_get (GeglBuffer *buffer,
gdouble scale,
const GeglRectangle *rect,
Babl *format,
gpointer dest,
gint rowstride);
/**
* gegl_buffer_set:
......@@ -130,10 +130,10 @@ void gegl_buffer_get (GeglBuffer *buffer,
*
* Store a linear raster buffer into the GeglBuffer.
*/
void gegl_buffer_set (GeglBuffer *buffer,
GeglRectangle *rect,
Babl *format,
void *src);
void gegl_buffer_set (GeglBuffer *buffer,
const GeglRectangle *rect,
Babl *format,
void *src);
/**
......@@ -150,10 +150,10 @@ void gegl_buffer_set (GeglBuffer *buffer,
* align, this should optimally lead to shared tiles that are copy on write,
* this functionality is not implemented yet.
*/
void gegl_buffer_copy (GeglBuffer *src,
GeglRectangle *src_rect,
GeglBuffer *dst,
GeglRectangle *dst_rect);
void gegl_buffer_copy (GeglBuffer *src,
const GeglRectangle *src_rect,
GeglBuffer *dst,
const GeglRectangle *dst_rect);
/**
......
......@@ -583,19 +583,19 @@ affine_generic (GeglBuffer *dest,
Matrix3 matrix,
GeglInterpolation interpolation)
{
GeglRectangle *dest_extent;
gint x, y;
gfloat *dest_buf,
*dest_ptr;
Matrix3 inverse;
gdouble u_start,
v_start,
u_float,
v_float;
Babl *format;
const GeglRectangle *dest_extent;
gint x, y;
gfloat *dest_buf,
*dest_ptr;
Matrix3 inverse;
gdouble u_start,
v_start,
u_float,
v_float;
Babl *format;
gint dest_pixels;
gint dest_pixels;
format = babl_format ("RaGaBaA float");
......@@ -604,7 +604,7 @@ affine_generic (GeglBuffer *dest,
* the generic code.
*/
g_object_get (dest, "pixels", &dest_pixels, NULL);
dest_extent = gegl_buffer_extent (dest);
dest_extent = gegl_buffer_get_extent (dest);
dest_buf = g_new (gfloat, dest_pixels * 4);
......
......@@ -55,7 +55,7 @@ process (GeglOperation *operation,
input = gegl_operation_get_source (operation, context_id, "input");
output = gegl_operation_get_target (operation, context_id, "output");
temp = gegl_buffer_new (gegl_buffer_extent (input),
temp = gegl_buffer_new (gegl_buffer_get_extent (input),
babl_format ("RaGaBaA float"));
hor_blur (input, temp, self->radius);
......@@ -162,21 +162,21 @@ hor_blur (GeglBuffer *src,
gfloat *dst_buf;
/* src == dst for hor blur */
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
src_buf = g_malloc0 (gegl_buffer_get_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_get_pixel_count (dst) * 4 * 4);
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++)
for (u=0; u<gegl_buffer_width (dst); u++)
for (v=0; v<gegl_buffer_get_height (dst); v++)
for (u=0; u<gegl_buffer_get_width (dst); u++)
{
gint i;
gfloat components[4];
get_mean_components (src_buf,
gegl_buffer_width (src),
gegl_buffer_height (src),
gegl_buffer_get_width (src),
gegl_buffer_get_height (src),
u - radius,
v,
1 + radius*2,
......@@ -204,21 +204,21 @@ ver_blur (GeglBuffer *src,
gfloat *src_buf;
gfloat *dst_buf;
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);
src_buf = g_malloc0 (gegl_buffer_get_width (src) * gegl_buffer_get_height (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_get_width (dst) * gegl_buffer_get_height (dst) * 4 * 4);
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++)
for (u=0; u<gegl_buffer_width (dst); u++)
for (v=0; v<gegl_buffer_get_height (dst); v++)
for (u=0; u<gegl_buffer_get_width (dst); u++)
{
gfloat components[4];
gint c;
get_mean_components (src_buf,
gegl_buffer_width (src),
gegl_buffer_height (src),
gegl_buffer_get_width (src),
gegl_buffer_get_height (src),
u + radius, /* 1x radius is the offset between the bufs */
v - radius + radius, /* 1x radius is the offset between the bufs */
1,
......
......@@ -93,7 +93,7 @@ process (GeglOperation *operation,
self = GEGL_CHANT_OPERATION (operation);
input = gegl_operation_get_source (operation, context_id, "input");
output = gegl_operation_get_target (operation, context_id, "output");
temp = gegl_buffer_new (gegl_buffer_extent (input),
temp = gegl_buffer_new (gegl_buffer_get_extent (input),
babl_format ("RaGaBaA float"));
{
......@@ -224,18 +224,18 @@ iir_young_hor_blur (GeglBuffer *src,
gfloat *buf;
gfloat *w;
buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
w = g_malloc0 (gegl_buffer_width (src) * 4);
buf = g_malloc0 (gegl_buffer_get_pixel_count (src) * 4 * 4);
w = g_malloc0 (gegl_buffer_get_width (src) * 4);
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++)
w_len = gegl_buffer_get_width (src);
for (v=0; v<gegl_buffer_get_height (src); v++)
{
for (c = 0; c < 4; c++)
{
iir_young_blur_1D (buf,
v*gegl_buffer_width (src)*4+c,
v*gegl_buffer_get_width (src)*4+c,
4,
B,
b,
......@@ -262,20 +262,20 @@ iir_young_ver_blur (GeglBuffer *src,
gfloat *buf;
gfloat *w;
buf = g_malloc0 (gegl_buffer_width (src) * gegl_buffer_height (src) * 4 * 4);
w = g_malloc0 (gegl_buffer_height (src) * 4);
buf = g_malloc0 (gegl_buffer_get_width (src) * gegl_buffer_get_height (src) * 4 * 4);
w = g_malloc0 (gegl_buffer_get_height (src) * 4);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
w_len = gegl_buffer_height (src);
w_len = gegl_buffer_get_height (src);
for (v=0; v<gegl_buffer_width (dst); v++)
for (v=0; v<gegl_buffer_get_width (dst); v++)
{
for (c = 0; c < 4; c++)
{
iir_young_blur_1D (buf,
(v+offset)*4 + c,
gegl_buffer_width (src)*4,
gegl_buffer_get_width (src)*4,
B,
b,
w,
......@@ -283,7 +283,7 @@ iir_young_ver_blur (GeglBuffer *src,
}
}
gegl_buffer_set (dst, gegl_buffer_extent (src), babl_format ("RaGaBaA float"), buf);
gegl_buffer_set (dst, gegl_buffer_get_extent (src), babl_format ("RaGaBaA float"), buf);
g_free (buf);
g_free (w);
}
......@@ -378,21 +378,21 @@ fir_hor_blur (GeglBuffer *src,
gfloat *src_buf;
gfloat *dst_buf;
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);
src_buf = g_malloc0 (gegl_buffer_get_width (src) * gegl_buffer_get_height (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_get_width (dst) * gegl_buffer_get_height (dst) * 4 * 4);
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++)
for (u=0; u<gegl_buffer_width (dst); u++)
for (v=0; v<gegl_buffer_get_height (dst); v++)
for (u=0; u<gegl_buffer_get_width (dst); u++)
{
gint i;
for (i=0; i<4; i++)
dst_buf [offset++] = fir_get_mean_component (src_buf,
gegl_buffer_width (src),
gegl_buffer_height (src),
gegl_buffer_get_width (src),
gegl_buffer_get_height (src),
u - (matrix_length/2),
v,
matrix_length,
......@@ -419,21 +419,21 @@ fir_ver_blur (GeglBuffer *src,
gfloat *src_buf;
gfloat *dst_buf;
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);
src_buf = g_malloc0 (gegl_buffer_get_width (src) * gegl_buffer_get_height (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_get_width (dst) * gegl_buffer_get_height (dst) * 4 * 4);
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++)
for (u=0; u<gegl_buffer_width (dst); u++)
for (v=0; v<gegl_buffer_get_height (dst); v++)
for (u=0; u<gegl_buffer_get_width (dst); u++)
{
gint c;
for (c=0; c<4; c++)
dst_buf [offset++] = fir_get_mean_component (src_buf,
gegl_buffer_width (src),
gegl_buffer_height (src),
gegl_buffer_get_width (src),
gegl_buffer_get_height (src),
u + skipoffsetX,
v - (matrix_length/2) + skipoffsetY,
1,
......
......@@ -57,10 +57,10 @@ buffer_get_min_max (GeglBuffer *buffer,
gfloat tmin = 9000000.0;
gfloat tmax =-9000000.0;
gfloat *buf = g_malloc0 (sizeof (gfloat) * 4 * gegl_buffer_pixel_count (buffer));
gfloat *buf = g_malloc0 (sizeof (gfloat) * 4 * gegl_buffer_get_pixel_count (buffer));
gint i;
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++)
for (i=0;i< gegl_buffer_get_pixel_count (buffer);i++)
{
gint component;
for (component=0; component<3; component++)
......
......@@ -235,25 +235,25 @@ fix_saturation (GeglBuffer *buf,
g_object_get (buf, "px-size", &pxsize, NULL);
for (y=0; y<3; y++)
row[y] = (gfloat*) g_malloc0 (pxsize * gegl_buffer_width (buf));
row[y] = (gfloat*) g_malloc0 (pxsize * gegl_buffer_get_width (buf));
for (y=0; y<2; y++)
{
gegl_rectangle_set (&rect, 0,y, gegl_buffer_width (buf), 1);
gegl_rectangle_set (&rect, 0,y, gegl_buffer_get_width (buf), 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);
fix_saturation_row (row[1], row[1], row[2], yw, gegl_buffer_get_width (buf), nc);
for (y=1; y<gegl_buffer_height (buf)-1; y++)
for (y=1; y<gegl_buffer_get_height (buf)-1; y++)
{
if (y>1)
{
gegl_rectangle_set (&rect, 0, y-2, gegl_buffer_width (buf), 1);
gegl_rectangle_set (&rect, 0, y-2, gegl_buffer_get_width (buf), 1);
gegl_buffer_set (buf, &rect, buf->format, row[0]);
}
gegl_rectangle_set (&rect, 0,y+1, gegl_buffer_width (buf), 1);
gegl_rectangle_set (&rect, 0,y+1, gegl_buffer_get_width (buf), 1);
gegl_buffer_get (buf, 1.0, &rect, buf->format, row[0], GEGL_AUTO_ROWSTRIDE);
tmp = row[0];
......@@ -261,15 +261,15 @@ fix_saturation (GeglBuffer *buf,
row[1] = row[2];
row[2] = tmp;
fix_saturation_row (row[0], row[1], row[2], yw, gegl_buffer_width (buf), nc);
fix_saturation_row (row[0], row[1], row[2], yw, gegl_buffer_get_width (buf), nc);
}
fix_saturation_row (row[1], row[2], row[2], yw, gegl_buffer_width (buf), nc);
fix_saturation_row (row[1], row[2], row[2], yw, gegl_buffer_get_width (buf), nc);
for (y=gegl_buffer_height (buf)-2; y<gegl_buffer_height (buf); y++)
for (y=gegl_buffer_get_height (buf)-2; y<gegl_buffer_get_height (buf); y++)
{
gegl_rectangle_set (&rect, 0, y, gegl_buffer_width (buf), 1);
gegl_buffer_set (buf, &rect, buf->format, row[y-gegl_buffer_height (buf)+2]);
gegl_rectangle_set (&rect, 0, y, gegl_buffer_get_width (buf), 1);
gegl_buffer_set (buf, &rect, buf->format, row[y-gegl_buffer_get_height (buf)+2]);
}
for (y=0; y<3; y++)
......@@ -329,24 +329,24 @@ reconstruct_chroma (GeglBuffer *buf,
gint pxsize;
g_object_get (buf, "px-size", &pxsize, NULL);
pixels = (gfloat*) g_malloc0 (MAX(gegl_buffer_width (buf), gegl_buffer_height (buf))*pxsize);
tmp = (gfloat*) g_malloc0 (MAX(gegl_buffer_width (buf), gegl_buffer_height (buf))*2*sizeof(gfloat));
pixels = (gfloat*) g_malloc0 (MAX(gegl_buffer_get_width (buf), gegl_buffer_get_height (buf))*pxsize);
tmp = (gfloat*) g_malloc0 (MAX(gegl_buffer_get_width (buf), gegl_buffer_get_height (buf))*2*sizeof(gfloat));
for (i=0; i<gegl_buffer_height (buf); i+=2)
for (i=0; i<gegl_buffer_get_height (buf); i+=2)
{
gegl_rectangle_set (&rect, 0, i, gegl_buffer_width (buf), 1);
gegl_rectangle_set (&rect, 0, i, gegl_buffer_get_width (buf), 1);
gegl_buffer_get (buf, 1.0, &rect, buf->format, pixels, GEGL_AUTO_ROWSTRIDE);
reconstruct_chroma_row (pixels, gegl_buffer_width (buf), has_alpha, tmp);
reconstruct_chroma_row (pixels, gegl_buffer_get_width (buf), has_alpha, tmp);
gegl_buffer_set (buf, &rect, buf->format, pixels);
}
for (i=0; i<gegl_buffer_width (buf); i++)
for (i=0; i<gegl_buffer_get_width (buf); i++)
{
gegl_rectangle_set (&rect, i, 0, 1, gegl_buffer_height (buf));
gegl_rectangle_set (&rect, i, 0, 1, gegl_buffer_get_height (buf));
gegl_buffer_get (buf, 1.0, &rect, buf->format, pixels, GEGL_AUTO_ROWSTRIDE);
reconstruct_chroma_row (pixels, gegl_buffer_height (buf), has_alpha, tmp);
reconstruct_chroma_row (pixels, gegl_buffer_get_height (buf), has_alpha, tmp);
gegl_buffer_set (buf, &rect, buf->format, pixels);
}
......@@ -367,15 +367,15 @@ convert_yca_to_rgba (GeglBuffer *buf,
gint pxsize;
g_object_get (buf, "px-size", &pxsize, NULL);
pixels = (gchar*) g_malloc0 (gegl_buffer_width (buf) * pxsize);
pixels = (gchar*) g_malloc0 (gegl_buffer_get_width (buf) * pxsize);
for (row=0; row<gegl_buffer_height (buf); row++)
for (row=0; row<gegl_buffer_get_height (buf); row++)
{
gegl_rectangle_set (&rect, 0, row, gegl_buffer_width (buf), 1);
gegl_rectangle_set (&rect, 0, row, gegl_buffer_get_width (buf), 1);
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++)
for (i=0; i<gegl_buffer_get_width (buf); i++)
{
y = pxl[0];
ry = pxl[1];
......@@ -453,7 +453,7 @@ import_exr (GeglBuffer *gegl_buffer,
g_object_get (gegl_buffer, "px-size", &pxsize, NULL);
char *pixels = (char*) g_malloc0 (gegl_buffer_width (gegl_buffer) * pxsize);
char *pixels = (char*) g_malloc0 (gegl_buffer_get_width (gegl_buffer) * pxsize);
char *base = pixels;
......@@ -470,7 +470,7 @@ import_exr (GeglBuffer *gegl_buffer,
insert_channels (frameBuffer,
file.header(),
base,
gegl_buffer_width (gegl_buffer),
gegl_buffer_get_width (gegl_buffer),
format_flags,
pxsize);
......@@ -482,7 +482,7 @@ import_exr (GeglBuffer *gegl_buffer,
for (i=dw.min.y; i<=dw.max.y; i++)
{
gegl_rectangle_set (&rect, 0, i-dw.min.y,gegl_buffer_width (gegl_buffer), 1);
gegl_rectangle_set (&rect, 0, i-dw.min.y,gegl_buffer_get_width (gegl_buffer), 1);
file.readPixels (i);
gegl_buffer_set (gegl_buffer, &rect, gegl_buffer->format, pixels);
}
......
......@@ -67,7 +67,7 @@ get_defined_region (GeglOperation *operation)
{
return result;
}
result = *gegl_buffer_extent (GEGL_BUFFER (self->buffer));
result = *gegl_buffer_get_extent (GEGL_BUFFER (self->buffer));
return result;
}
......
......@@ -62,8 +62,8 @@ get_defined_region (GeglOperation *operation)
load_buffer (self);
result.width = gegl_buffer_width (GEGL_BUFFER (self->priv));
result.height = gegl_buffer_height (GEGL_BUFFER (self->priv));
result.width = gegl_buffer_get_width (GEGL_BUFFER (self->priv));
result.height = gegl_buffer_get_height (GEGL_BUFFER (self->priv));
return result;
}
......
......@@ -106,7 +106,7 @@ get_defined_region (GeglOperation *operation)
if (self->buf)
{
GeglBuffer *buffer = GEGL_BUFFER (self->buf);
result = *gegl_buffer_extent (buffer);
result = *gegl_buffer_get_extent (buffer);
}
return result;
}
......
......@@ -100,8 +100,8 @@ bilateral_filter (GeglBuffer *src,
gfloat *src_buf;
gfloat *dst_buf;
src_buf = g_malloc0 (gegl_buffer_pixel_count(src) * 4 *4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count(dst) * 4 * 4);
src_buf = g_malloc0 (gegl_buffer_get_pixel_count(src) * 4 *4);
dst_buf = g_malloc0 (gegl_buffer_get_pixel_count(dst) * 4 * 4);
gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
......@@ -114,23 +114,23 @@ bilateral_filter (GeglBuffer *src,
gauss[x+(int)radius][y+(int)radius] = exp(- 0.5*(POW2(x)+POW2(y))/radius );
}
for (y=0; y<gegl_buffer_height (dst); y++)
for (x=0; x<gegl_buffer_width (dst); x++)
for (y=0; y<gegl_buffer_get_height (dst); y++)
for (x=0; x<gegl_buffer_get_width (dst); x++)
{
gint u,v;
gfloat *center_pix = src_buf + (x+(y * gegl_buffer_width (src))) * 4;
gfloat *center_pix = src_buf + (x+(y * gegl_buffer_get_width (src))) * 4;
gfloat accumulated[4]={0,0,0,0};
gfloat count=0.0;
for (v=-radius;v<=radius;v++)
for (u=-radius;u<=radius;u++)
{
if (x+u >= 0 && x+u < gegl_buffer_width (dst) &&
y+v >= 0 && y+v < gegl_buffer_height (dst))
if (x+u >= 0 && x+u < gegl_buffer_get_width (dst) &&
y+v >= 0 && y+v < gegl_buffer_get_height (dst))
{
gint c;
gfloat *src_pix = src_buf + ((x+u)+((y+v) * gegl_buffer_width (src))) * 4;
gfloat *src_pix = src_buf + ((x+u)+((y+v) * gegl_buffer_get_width (src))) * 4;
gfloat diff_map = exp (- (POW2(center_pix[0] - src_pix[0])+
POW2(center_pix[1] - src_pix[1])+
......
......@@ -125,21 +125,21 @@ hor_max (GeglBuffer *src,
gfloat *src_buf;
gfloat *dst_buf;
src_buf = g_malloc0 (gegl_buffer_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_pixel_count (dst) * 4 * 4);
src_buf = g_malloc0 (gegl_buffer_get_pixel_count (src) * 4 * 4);
dst_buf = g_malloc0 (gegl_buffer_get_pixel_count (dst) * 4 * 4);
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++)
for (u=0; u<gegl_buffer_width (dst); u++)
for (v=0; v<gegl_buffer_get_height (dst); v++)
for (u=0; u<gegl_buffer_get_width (dst); u++)
{
gint i;
for (i=0; i<4; i++)