babl r281 - in trunk: . babl
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: babl r281 - in trunk: . babl
- Date: Tue, 19 Feb 2008 13:01:26 +0000 (GMT)
Author: neo
Date: Tue Feb 19 13:01:25 2008
New Revision: 281
URL: http://svn.gnome.org/viewvc/babl?rev=281&view=rev
Log:
2008-02-19 Sven Neumann <sven gimp org>
* babl/babl-fish-path.c: renamed test_pixels to num_test_pixels.
Modified:
trunk/ChangeLog
trunk/babl/babl-fish-path.c
Modified: trunk/babl/babl-fish-path.c
==============================================================================
--- trunk/babl/babl-fish-path.c (original)
+++ trunk/babl/babl-fish-path.c Tue Feb 19 13:01:25 2008
@@ -424,7 +424,7 @@
}
-#define test_pixels 128
+#define num_test_pixels 128
static double *
test_create (void)
@@ -434,9 +434,9 @@
srandom (20050728);
- test = babl_malloc (sizeof (double) * test_pixels * 4);
+ test = babl_malloc (sizeof (double) * num_test_pixels * 4);
- for (i = 0; i < test_pixels * 4; i++)
+ for (i = 0; i < num_test_pixels * 4; i++)
test [i] = (double) random () / RAND_MAX;
return test;
@@ -466,49 +466,56 @@
void *ref_destination;
double *ref_destination_rgba_double;
- Babl *fish_rgba_to_source = babl_fish_reference (fmt_rgba_double, fmt_source);
- Babl *fish_reference = babl_fish_reference (fmt_source, fmt_destination);
- Babl *fish_destination_to_rgba = babl_fish_reference (fmt_destination, fmt_rgba_double);
+ Babl *fish_rgba_to_source = babl_fish_reference (fmt_rgba_double,
+ fmt_source);
+ Babl *fish_reference = babl_fish_reference (fmt_source,
+ fmt_destination);
+ Babl *fish_destination_to_rgba = babl_fish_reference (fmt_destination,
+ fmt_rgba_double);
test = test_create ();
-
- source = babl_calloc (test_pixels, fmt_source->format.bytes_per_pixel);
- destination = babl_calloc (test_pixels, fmt_destination->format.bytes_per_pixel);
- ref_destination = babl_calloc (test_pixels, fmt_destination->format.bytes_per_pixel);
- destination_rgba_double = babl_calloc (test_pixels, fmt_rgba_double->format.bytes_per_pixel);
- ref_destination_rgba_double = babl_calloc (test_pixels, fmt_rgba_double->format.bytes_per_pixel);
+ source = babl_calloc (num_test_pixels,
+ fmt_source->format.bytes_per_pixel);
+ destination = babl_calloc (num_test_pixels,
+ fmt_destination->format.bytes_per_pixel);
+ ref_destination = babl_calloc (num_test_pixels,
+ fmt_destination->format.bytes_per_pixel);
+ destination_rgba_double = babl_calloc (num_test_pixels,
+ fmt_rgba_double->format.bytes_per_pixel);
+ ref_destination_rgba_double = babl_calloc (num_test_pixels,
+ fmt_rgba_double->format.bytes_per_pixel);
/* create sourcebuffer from testbuffer in the correct format */
babl_process (fish_rgba_to_source,
- test, source, test_pixels);
+ test, source, num_test_pixels);
/* calculate the reference buffer of how it should be */
babl_process (fish_reference,
- source, ref_destination, test_pixels);
+ source, ref_destination, num_test_pixels);
/* calculate this chains view of what the result should be */
- chain_process (chain, conversions, source, destination, test_pixels);
+ chain_process (chain, conversions, source, destination, num_test_pixels);
/* transform the reference and the actual destination buffers to RGBA
* for comparison with each other
*/
babl_process (fish_destination_to_rgba,
- ref_destination, ref_destination_rgba_double, test_pixels);
+ ref_destination, ref_destination_rgba_double, num_test_pixels);
babl_process (fish_destination_to_rgba,
- destination, destination_rgba_double, test_pixels);
+ destination, destination_rgba_double, num_test_pixels);
error = babl_rel_avg_error (destination_rgba_double,
ref_destination_rgba_double,
- test_pixels * 4);
+ num_test_pixels * 4);
fish_rgba_to_source->fish.processings--;
fish_reference->fish.processings--;
fish_destination_to_rgba->fish.processings -= 2;
- fish_rgba_to_source->fish.pixels -= test_pixels;
- fish_reference->fish.pixels -= test_pixels;
- fish_destination_to_rgba->fish.pixels -= 2 * test_pixels;
+ fish_rgba_to_source->fish.pixels -= num_test_pixels;
+ fish_reference->fish.pixels -= num_test_pixels;
+ fish_destination_to_rgba->fish.pixels -= 2 * num_test_pixels;
babl_free (source);
babl_free (destination);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]