File: conversions.c

package info (click to toggle)
babl 0.0.22-1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 2,848 kB
  • ctags: 1,229
  • sloc: ansic: 13,365; sh: 9,103; makefile: 321; ruby: 90
file content (36 lines) | stat: -rw-r--r-- 627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* perform a symmetricality of conversion test on a set of randomized
 * RGBA data */

#include <stdlib.h>
#include <math.h>
#include "babl-internal.h"

#define ERROR_TOLERANCE    0.5

static int OK = 1;

static int
each_conversion (Babl *babl,
                 void *userdata)
{
  double error = babl->conversion.error;

  if (error >= ERROR_TOLERANCE)
    {
      babl_log ("%s\terror:%f", babl->instance.name, error);
      OK = 0;
    }
  return 0;
}

int main (void)
{
  babl_init ();

  babl_set_extender (babl_extension_quiet_log ());
  babl_conversion_each (each_conversion, NULL);

  babl_destroy ();

  return !OK;
}