test-bcontrast-4x.c 1.18 KB
Newer Older
1 2
#include "test-common.h"

3 4
void bcontrast4x(GeglBuffer *buffer);

5 6 7 8
gint
main (gint    argc,
      gchar **argv)
{
9
  GeglBuffer *buffer;
10 11 12 13

  gegl_init (&argc, &argv);

  buffer = test_buffer (2048, 1024, babl_format ("RGBA float"));
14
  bench("bcontrast_4x", buffer, &bcontrast4x);
15 16 17

  return 0;
}
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

void bcontrast4x(GeglBuffer *buffer)
{
  GeglBuffer *buffer2;
  GeglNode   *gegl, *source, *node1, *node2, *node3, *node4, *sink;

  gegl = gegl_node_new ();
  source = gegl_node_new_child (gegl, "operation", "gegl:buffer-source", "buffer", buffer, NULL);
  node1 = gegl_node_new_child (gegl, "operation", "gegl:brightness-contrast", "contrast", 0.2, NULL);
  node2 = gegl_node_new_child (gegl, "operation", "gegl:brightness-contrast", "contrast", 0.2, NULL);
  node3 = gegl_node_new_child (gegl, "operation", "gegl:brightness-contrast", "contrast", 0.2, NULL);
  node4 = gegl_node_new_child (gegl, "operation", "gegl:brightness-contrast", "contrast", 0.2, NULL);
  sink = gegl_node_new_child (gegl, "operation", "gegl:buffer-sink", "buffer", &buffer2, NULL);

  gegl_node_link_many (source, node1, node2, node3, node4, sink, NULL);
  gegl_node_process (sink);
  g_object_unref (gegl);
  g_object_unref (buffer2);
}