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

Adapt to changes in previous commit.


	Adapt to changes in previous commit.

	* operations/blur/box-blur.c: (hor_blur), (ver_blur):
	* operations/blur/gaussian-blur.c: (iir_young_hor_blur),
	(iir_young_ver_blur), (fir_hor_blur), (fir_ver_blur):
	* operations/color/stretch-contrast.c: (buffer_get_min_max),
	(process):
	* operations/display/display.c: (process):
	* operations/file-io/jpg-load.c: (gegl_buffer_import_jpg):
	* operations/file-io/pixbuf.c: (process):
	* operations/file-io/png-load.c: (gegl_buffer_import_png):
	* operations/file-io/png-save.c: (gegl_buffer_export_png):
	* operations/file-io/raw-load.c: (load_buffer):
	* operations/file-io/svg-load.c: (gegl_buffer_import_svg):
	* operations/render/FractalExplorer.c: (process):
	* operations/render/checkerboard.c: (process):
	* operations/render/color.c: (process):
	* operations/render/noise.c: (process):
	* operations/render/text.c: (process):
	* operations/transform/interpolate-cubic.c: (affine_cubic):
	* operations/transform/interpolate-lanczos.c: (affine_lanczos):
	* operations/transform/linear.c: (affine_linear), (scale_linear):
	* operations/transform/module.c: (gegl_module_register):
	* operations/transform/nearest.c: (affine_nearest), (scale_nearest):
	* operations/workshop/demosaic-simple.c: (demosaic):
	* operations/workshop/gtk-display.c: (process):
	* operations/workshop/mandelbrot.c: (process):
	* operations/workshop/rawbayer-load.c: (load_buffer):
	* bin/export.c: (gegl_buffer_export_png):
	* bin/gegl-projection.c: (task_render):
	* bin/gegl-view.c: (expose_event):
parent 28f5a1c1
2006-11-28 Øyvind Kolås <pippin@gimp.org>
Adapt to changes in previous commit.
* operations/blur/box-blur.c: (hor_blur), (ver_blur):
* operations/blur/gaussian-blur.c: (iir_young_hor_blur),
(iir_young_ver_blur), (fir_hor_blur), (fir_ver_blur):
* operations/color/stretch-contrast.c: (buffer_get_min_max),
(process):
* operations/display/display.c: (process):
* operations/file-io/jpg-load.c: (gegl_buffer_import_jpg):
* operations/file-io/pixbuf.c: (process):
* operations/file-io/png-load.c: (gegl_buffer_import_png):
* operations/file-io/png-save.c: (gegl_buffer_export_png):
* operations/file-io/raw-load.c: (load_buffer):
* operations/file-io/svg-load.c: (gegl_buffer_import_svg):
* operations/render/FractalExplorer.c: (process):
* operations/render/checkerboard.c: (process):
* operations/render/color.c: (process):
* operations/render/noise.c: (process):
* operations/render/text.c: (process):
* operations/transform/interpolate-cubic.c: (affine_cubic):
* operations/transform/interpolate-lanczos.c: (affine_lanczos):
* operations/transform/linear.c: (affine_linear), (scale_linear):
* operations/transform/module.c: (gegl_module_register):
* operations/transform/nearest.c: (affine_nearest), (scale_nearest):
* operations/workshop/demosaic-simple.c: (demosaic):
* operations/workshop/gtk-display.c: (process):
* operations/workshop/mandelbrot.c: (process):
* operations/workshop/rawbayer-load.c: (load_buffer):
* bin/export.c: (gegl_buffer_export_png):
* bin/gegl-projection.c: (task_render):
* bin/gegl-view.c: (expose_event):
2006-11-28 Øyvind Kolås <pippin@gimp.org>
* gegl/buffer/gegl-buffer.[ch]: (gegl_buffer_set), (gegl_buffer_get):
......
......@@ -337,7 +337,7 @@ gegl_buffer_export_png (GeglBuffer *gegl_buffer,
"width", width,
"height", 1,
NULL);
gegl_buffer_get_fmt (rect, pixels, babl_format (format_string));
gegl_buffer_get (rect, NULL, pixels, babl_format (format_string), 1.0);
png_write_rows (png, &pixels, 1);
g_object_unref (rect);
......
......@@ -382,7 +382,7 @@ static gboolean task_render (gpointer foo)
g_assert (buf);
gegl_node_blit_buf (projection->node, dr, projection->format, 0, (gpointer*) buf);
gegl_buffer_set_rect_fmt (projection->buffer, dr, buf, projection->format);
gegl_buffer_set (projection->buffer, dr, buf, projection->format);
gdk_region_union_with_rect (projection->valid_region, (GdkRectangle*)dr);
......
......@@ -345,8 +345,8 @@ expose_event (GtkWidget *widget, GdkEventExpose * event)
buf = g_malloc ((roi.w+1) * (roi.h+1) * 3);
/* FIXME: this padding should not be needed, but it avoids some segfaults */
gegl_buffer_get_rect_fmt_scale (view->projection->buffer,
&roi, buf, babl_format ("R'G'B' u8"), view->scale);
gegl_buffer_get (view->projection->buffer,
&roi, buf, babl_format ("R'G'B' u8"), view->scale);
gdk_draw_rgb_image (widget->window,
widget->style->black_gc,
rectangles[i].x, rectangles[i].y,
......
......@@ -382,7 +382,7 @@ static gboolean task_render (gpointer foo)
g_assert (buf);
gegl_node_blit_buf (projection->node, dr, projection->format, 0, (gpointer*) buf);
gegl_buffer_set_rect_fmt (projection->buffer, dr, buf, projection->format);
gegl_buffer_set (projection->buffer, dr, buf, projection->format);
gdk_region_union_with_rect (projection->valid_region, (GdkRectangle*)dr);
......
......@@ -162,7 +162,7 @@ hor_blur (GeglBuffer *src,
src_buf = g_malloc0 (src->width * src->height * 4 * 4);
dst_buf = g_malloc0 (dst->width * dst->height * 4 * 4);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
offset = 0;
for (v=0; v<dst->height; v++)
......@@ -181,7 +181,7 @@ hor_blur (GeglBuffer *src,
i);
}
gegl_buffer_set_fmt (dst, dst_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dst, NULL, dst_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dst_buf);
}
......@@ -200,7 +200,7 @@ ver_blur (GeglBuffer *src,
src_buf = g_malloc0 (src->width * src->height * 4 * 4);
dst_buf = g_malloc0 (dst->width * dst->height * 4 * 4);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
offset=0;
for (v=0; v<dst->height; v++)
......@@ -220,7 +220,7 @@ ver_blur (GeglBuffer *src,
c);
}
gegl_buffer_set_fmt (dst, dst_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dst, NULL, dst_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dst_buf);
}
......
......@@ -290,7 +290,7 @@ iir_young_hor_blur (GeglBuffer *src,
buf = g_malloc0 (src->width * src->height * 4 * 4);
w = g_malloc0 (src->width * 4);
gegl_buffer_get_fmt (src, buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, buf, babl_format ("RaGaBaA float"), 1.0);
w_len = src->width;
for (v=0; v<src->height; v++)
......@@ -307,7 +307,7 @@ iir_young_hor_blur (GeglBuffer *src,
}
}
gegl_buffer_set_fmt (dst, buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dst, NULL, buf, babl_format ("RaGaBaA float"));
g_free (buf);
g_free (w);
}
......@@ -327,7 +327,7 @@ iir_young_ver_blur (GeglBuffer *src,
buf = g_malloc0 (src->width * src->height * 4 * 4);
w = g_malloc0 (src->height * 4);
gegl_buffer_get_fmt (src, buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, buf, babl_format ("RaGaBaA float"), 1.0);
w_len = src->height;
......@@ -345,7 +345,7 @@ iir_young_ver_blur (GeglBuffer *src,
}
}
gegl_buffer_set_fmt (dst, buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dst, NULL, buf, babl_format ("RaGaBaA float"));
g_free (buf);
g_free (w);
}
......@@ -443,7 +443,7 @@ fir_hor_blur (GeglBuffer *src,
src_buf = g_malloc0 (src->width * src->height * 4 * 4);
dst_buf = g_malloc0 (dst->width * dst->height * 4 * 4);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
offset = 0;
for (v=0; v<dst->height; v++)
......@@ -463,7 +463,7 @@ fir_hor_blur (GeglBuffer *src,
cmatrix);
}
gegl_buffer_set_fmt (dst, dst_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dst, NULL, dst_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dst_buf);
}
......@@ -482,7 +482,7 @@ fir_ver_blur (GeglBuffer *src,
src_buf = g_malloc0 (src->width * src->height * 4 * 4);
dst_buf = g_malloc0 (dst->width * dst->height * 4 * 4);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
offset=0;
for (v=0; v<dst->height; v++)
......@@ -503,7 +503,7 @@ fir_ver_blur (GeglBuffer *src,
}
gegl_buffer_set_fmt (dst, dst_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dst, NULL, dst_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dst_buf);
}
......
......@@ -60,7 +60,7 @@ buffer_get_min_max (GeglBuffer *buffer,
gfloat *buf = g_malloc0 (sizeof (gfloat) * 4 * buffer->width * buffer->height);
gint i;
gegl_buffer_get_fmt (buffer, buf, babl_format ("RGBA float"));
gegl_buffer_get (buffer, NULL, buf, babl_format ("RGBA float"), 1.0);
for (i=0;i<gegl_buffer_pixels (buffer);i++)
{
gint component;
......@@ -135,9 +135,9 @@ process (GeglOperation *operation)
"width", result->w,
"height", chunk,
NULL);
gegl_buffer_get_fmt (in_line, buf, babl_format ("RGBA float"));
gegl_buffer_get (in_line, NULL, buf, babl_format ("RGBA float"), 1.0);
inner_process (min, max, buf, result->w * chunk);
gegl_buffer_set_fmt (out_line, buf, babl_format ("RGBA float"));
gegl_buffer_set (out_line, NULL, buf, babl_format ("RGBA float"));
g_object_unref (in_line);
g_object_unref (out_line);
consumed+=chunk;
......
......@@ -142,14 +142,15 @@ process (GeglOperation *operation)
"width", need->w,
"height", need->h,
NULL);
gegl_buffer_get_fmt (source, ((SDL_Surface*)self->screen)->pixels,
gegl_buffer_get (source, NULL, ((SDL_Surface*)self->screen)->pixels,
babl_format_new (babl_model ("R'G'B'A"),
babl_type ("u8"),
babl_component ("B'"),
babl_component ("G'"),
babl_component ("R'"),
babl_component ("A"),
NULL));
NULL),
1.0);
g_object_unref (source);
if (!sdl_outwin)
......
......@@ -209,7 +209,7 @@ gegl_buffer_import_jpg (GeglBuffer *gegl_buffer,
NULL);
jpeg_read_scanlines (&cinfo, buffer, 1);
gegl_buffer_set_fmt (rect, buffer[0], babl_format ("R'G'B' u8"));
gegl_buffer_set (rect, NULL, buffer[0], babl_format ("R'G'B' u8"));
g_object_unref (rect);
}
jpeg_destroy_decompress (&cinfo);
......
......@@ -46,8 +46,8 @@ process (GeglOperation *operation)
"width", gdk_pixbuf_get_width (self->pixbuf),
"height", gdk_pixbuf_get_height (self->pixbuf),
NULL);
gegl_buffer_set_fmt (op_source->output, gdk_pixbuf_get_pixels (self->pixbuf),
babl_format(gdk_pixbuf_get_has_alpha(self->pixbuf)?"R'G'B'A u8":"R'G'B' u8"));
gegl_buffer_set (op_source->output, NULL, gdk_pixbuf_get_pixels (self->pixbuf),
babl_format(gdk_pixbuf_get_has_alpha(self->pixbuf)?"R'G'B'A u8":"R'G'B' u8"));
return TRUE;
}
......
......@@ -313,7 +313,7 @@ gegl_buffer_import_png (GeglBuffer *gegl_buffer,
for (i=0; i<number_of_passes; i++)
png_read_rows (load_png_ptr, rows, NULL, height);
gegl_buffer_set (gegl_buffer, pixels);
gegl_buffer_set (gegl_buffer, NULL, pixels, format);
png_read_end (load_png_ptr, NULL);
png_destroy_read_struct (&load_png_ptr, &load_info_ptr, NULL);
......
......@@ -153,7 +153,7 @@ gegl_buffer_export_png (GeglBuffer *gegl_buffer,
"width", width,
"height", 1,
NULL);
gegl_buffer_get_fmt (rect, pixels, babl_format (format_string));
gegl_buffer_get (rect, NULL, pixels, babl_format (format_string), 1.0);
png_write_rows (png, &pixels, 1);
g_object_unref (rect);
......
......@@ -120,7 +120,16 @@ load_buffer (GeglChantOperation *op_raw_load)
guchar *buf=g_malloc (width * height * 3 * 2);
fread (buf, 1, width * height * 3 * 2, pfp);
gegl_buffer_set (GEGL_BUFFER (op_raw_load->priv), buf);
gegl_buffer_set (GEGL_BUFFER (op_raw_load->priv),
NULL, buf,
babl_format_new (
babl_model ("RGB"),
babl_type ("u16"),
babl_component ("G"),
babl_component ("B"),
babl_component ("R"),
NULL)
);
g_free (buf);
}
fclose (pfp);
......
......@@ -191,7 +191,7 @@ instead.
"height", height,
NULL);
gegl_buffer_set_fmt (rect, pixeldata, babl_format ("R'G'B'A u8"));
gegl_buffer_set (rect, NULL, pixeldata, babl_format ("R'G'B'A u8"));
g_object_unref (rect);
}
......
......@@ -422,7 +422,7 @@ process (GeglOperation *operation)
}
}
gegl_buffer_set (op_source->output, buf);
gegl_buffer_set (op_source->output, NULL, buf, babl_format ("R'G'B' u8"));
g_free (buf);
}
return TRUE;
......
......@@ -92,7 +92,7 @@ process (GeglOperation *operation)
}
}
}
gegl_buffer_set (op_source->output, buf);
gegl_buffer_set (op_source->output, NULL, buf, babl_format ("RGBA float"));
g_free (buf);
}
return TRUE;
......
......@@ -67,7 +67,7 @@ process (GeglOperation *operation)
dst += 4;
}
}
gegl_buffer_set (op_source->output, buf);
gegl_buffer_set (op_source->output, NULL, buf, babl_format ("RGBA float"));
g_free (buf);
}
return TRUE;
......
......@@ -78,7 +78,7 @@ process (GeglOperation *operation)
}
}
}
gegl_buffer_set (op_source->output, buf);
gegl_buffer_set (op_source->output, NULL, buf, babl_format ("Y float"));
g_free (buf);
}
return TRUE;
......
......@@ -166,7 +166,7 @@ process (GeglOperation *operation)
cairo_translate (cr, -need->x, -need->y);
text_layout_text (self, cr, 0, NULL, NULL);
gegl_buffer_set_fmt (op_source->output, data,
gegl_buffer_set (op_source->output, NULL, data,
babl_format_new (babl_model ("R'aG'aB'aA"),
babl_type ("u8"),
babl_component ("B'a"),
......
......@@ -89,7 +89,7 @@ affine_cubic (GeglBuffer *dest,
src_buf = g_new (gfloat, gegl_buffer_pixels (src) << 2);
dest_buf = g_new (gfloat, gegl_buffer_pixels (dest) << 2);
g_assert (src_buf && dest_buf);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
matrix3_copy (inverse, matrix);
matrix3_invert (inverse);
......@@ -168,7 +168,7 @@ affine_cubic (GeglBuffer *dest,
fu = du;
fv = dv;
}
gegl_buffer_set_fmt (dest, dest_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dest, NULL, dest_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dest_buf);
......
......@@ -118,7 +118,7 @@ affine_lanczos (GeglBuffer *dest,
src_buf = g_new (gfloat, gegl_buffer_pixels (src) << 2);
dest_buf = g_new (gfloat, gegl_buffer_pixels (dest) << 2);
g_assert (src_buf && dest_buf);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
matrix3_copy (inverse, matrix);
matrix3_invert (inverse);
......@@ -210,7 +210,7 @@ affine_lanczos (GeglBuffer *dest,
fu = du;
fv = dv;
}
gegl_buffer_set_fmt (dest, dest_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dest, NULL, dest_buf, babl_format ("RaGaBaA float"));
g_free (lanczos);
g_free (src_buf);
......
......@@ -52,7 +52,7 @@ affine_linear (GeglBuffer *dest,
src_buf = g_new (gfloat, gegl_buffer_pixels (src) * 4);
dest_buf = g_new (gfloat, gegl_buffer_pixels (dest) * 4);
g_assert (src_buf && dest_buf);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
/* expand borders */
/* bottom row */
......@@ -194,7 +194,7 @@ affine_linear (GeglBuffer *dest,
v_start += inverse [1][1];
}
gegl_buffer_set_fmt (dest, dest_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dest, NULL, dest_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dest_buf);
......@@ -237,7 +237,7 @@ scale_linear (GeglBuffer *dest,
src_buf = g_new (gfloat, gegl_buffer_pixels (src) * 4);
dest_buf = g_new (gfloat, gegl_buffer_pixels (dest) * 4);
g_assert (src_buf && dest_buf);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
/* expand borders */
/* bottom row */
......@@ -566,7 +566,7 @@ scale_linear (GeglBuffer *dest,
dest_ptr += skip_left + skip_right;
}
gegl_buffer_set_fmt (dest, dest_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dest, NULL, dest_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dest_buf);
......
......@@ -55,14 +55,15 @@ GType reflect_get_type (void);
gboolean
gegl_module_register (GTypeModule *module)
{
GType sink;
affine_module = module;
op_affine_get_type ();
rotate_get_type ();
scale_get_type ();
shear_get_type ();
translate_get_type ();
reflect_get_type ();
sink = op_affine_get_type ();
sink = rotate_get_type ();
sink = scale_get_type ();
sink = shear_get_type ();
sink = translate_get_type ();
sink = reflect_get_type ();
return TRUE;
}
......@@ -46,7 +46,7 @@ affine_nearest (GeglBuffer *dest,
src_buf = g_new (gfloat, gegl_buffer_pixels (src) * 4);
dest_buf = g_new (gfloat, gegl_buffer_pixels (dest) * 4);
g_assert (src_buf && dest_buf);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
matrix3_copy (inverse, matrix);
matrix3_invert (inverse);
......@@ -100,7 +100,7 @@ affine_nearest (GeglBuffer *dest,
v_start += inverse [1][1];
}
gegl_buffer_set_fmt (dest, dest_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dest, NULL, dest_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dest_buf);
......@@ -134,7 +134,7 @@ scale_nearest (GeglBuffer *dest,
src_buf = g_new (gfloat, gegl_buffer_pixels (src) * 4);
dest_buf = g_new (gfloat, gegl_buffer_pixels (dest) * 4);
g_assert (src_buf && dest_buf);
gegl_buffer_get_fmt (src, src_buf, babl_format ("RaGaBaA float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("RaGaBaA float"), 1.0);
matrix3_copy (inverse, matrix);
matrix3_invert (inverse);
......@@ -208,7 +208,7 @@ scale_nearest (GeglBuffer *dest,
dest_ptr += dest_rowstride;
}
gegl_buffer_set_fmt (dest, dest_buf, babl_format ("RaGaBaA float"));
gegl_buffer_set (dest, NULL, dest_buf, babl_format ("RaGaBaA float"));
g_free (src_buf);
g_free (dest_buf);
......
......@@ -113,7 +113,7 @@ demosaic (GeglChantOperation *op,
src_buf = g_malloc0 (src->width * src->height * 4);
dst_buf = g_malloc0 (dst->width * dst->height * 4 * 3);
gegl_buffer_get_fmt (src, src_buf, babl_format ("Y float"));
gegl_buffer_get (src, NULL, src_buf, babl_format ("Y float"), 1.0);
offset=0;
for (y=src->y; y<dst->height + src->y; y++)
......@@ -165,7 +165,7 @@ demosaic (GeglChantOperation *op,
offset++;
}
gegl_buffer_set_fmt (dst, dst_buf, babl_format ("RGB float"));
gegl_buffer_set (dst, NULL, dst_buf, babl_format ("RGB float"));
g_free (src_buf);
g_free (dst_buf);
}
......
......@@ -127,8 +127,7 @@ process (GeglOperation *operation)
"height", requested->h,
NULL);
gegl_buffer_get_fmt (source, priv->buf,
babl_format ("R'G'B'A u8"));
gegl_buffer_get (source, NULL, priv->buf, babl_format ("R'G'B'A u8"), 1.0);
gtk_widget_queue_draw (priv->drawing_area);
if (priv->window)
......
......@@ -108,7 +108,7 @@ process (GeglOperation *operation)
}
}
}
gegl_buffer_set (op_source->output, buf);
gegl_buffer_set (op_source->output, NULL, buf, babl_format ("Y float"));
g_free (buf);
}
return TRUE;
......
......@@ -118,7 +118,7 @@ load_buffer (GeglChantOperation *op_raw_load)
buf[i*2+1] = tmp;
}
}
gegl_buffer_set_fmt (GEGL_BUFFER (op_raw_load->priv), buf,
gegl_buffer_set (GEGL_BUFFER (op_raw_load->priv), NULL, buf,
babl_format_new (
babl_model ("RGB"),
babl_type ("u16"),
......
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