Blame tests/buffer/tests/dup_linear_from_data.c
|
Packit Service |
2781ba |
TEST ()
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
GeglBuffer *buffer, *buffer2;
|
|
Packit Service |
2781ba |
GeglRectangle extent = {0,0, 10, 10};
|
|
Packit Service |
2781ba |
gfloat *buf;
|
|
Packit Service |
2781ba |
gint i;
|
|
Packit Service |
2781ba |
test_start();
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
buf = g_malloc (sizeof (float) * 10 * 10);
|
|
Packit Service |
2781ba |
for (i=0;i<100;i++)
|
|
Packit Service |
2781ba |
buf[i]=i/100.0;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
buffer = gegl_buffer_linear_new_from_data (buf, babl_format ("Y float"),
|
|
Packit Service |
2781ba |
&extent,
|
|
Packit Service |
2781ba |
10 * 4,
|
|
Packit Service |
2781ba |
(GDestroyNotify) g_free, /* destroy_notify */
|
|
Packit Service |
2781ba |
NULL /* destroy_notify_data */);
|
|
Packit Service |
2781ba |
buffer2 = gegl_buffer_dup (buffer);
|
|
Packit Service |
2781ba |
g_object_unref (buffer2);
|
|
Packit Service |
2781ba |
buffer2 = gegl_buffer_dup (buffer);
|
|
Packit Service |
2781ba |
vgrad (buffer);
|
|
Packit Service |
2781ba |
print_buffer (buffer);
|
|
Packit Service |
2781ba |
g_object_unref (buffer);
|
|
Packit Service |
2781ba |
g_object_unref (buffer2);
|
|
Packit Service |
2781ba |
test_end ();
|
|
Packit Service |
2781ba |
}
|