]> mj.ucw.cz Git - libucw.git/commitdiff
more MJ's corrections... to be continue
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Mon, 2 Oct 2006 13:55:26 +0000 (15:55 +0200)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Mon, 2 Oct 2006 13:55:26 +0000 (15:55 +0200)
images/Makefile
images/color.c
images/color.t
images/context.c
images/image-test.c
images/image-tool.c
images/image.c
images/images.h

index a4a2fb2687c2f332ae506c00c8cb56f8cf6ad5af..0b4b27de14e04ca9a936e0299942d5110fbe82e6 100644 (file)
@@ -65,7 +65,7 @@ $(o)/images/image-sim-test: LIBS+=$(LIBIMAGES_LIBS)
 
 TESTS+=$(o)/images/image-test.test
 $(o)/images/image-test: $(o)/images/image-test.o $(LIBIMAGES) $(LIBUCW)
 
 TESTS+=$(o)/images/image-test.test
 $(o)/images/image-test: $(o)/images/image-test.o $(LIBIMAGES) $(LIBUCW)
-$(o)/images/image-test: LIBS+=$(LIBIMAGES_LIBS) -lpthread
+$(o)/images/image-test: LIBS+=$(LIBIMAGES_LIBS)
 $(o)/images/image-test.test: $(o)/images/image-test
 
 TESTS+=$(o)/images/hilbert-test.test
 $(o)/images/image-test.test: $(o)/images/image-test
 
 TESTS+=$(o)/images/hilbert-test.test
index ee4e8b8b70404f428ad032a2fec1dfaf5291ddee..8ea6022819cbefc49403ed0826b01e4029e03866 100644 (file)
@@ -208,7 +208,7 @@ color_compute_color_space_to_xyz_matrix(double matrix[9], const struct color_spa
   matrix[8] = a[8] * rc;
 }
 
   matrix[8] = a[8] * rc;
 }
 
-/* computes matrix to join transofmations with different reference whites */
+/* computes matrix to join transformations with different reference whites */
 void
 color_compute_bradford_matrix(double matrix[9], const double source[2], const double dest[2])
 {
 void
 color_compute_bradford_matrix(double matrix[9], const double source[2], const double dest[2])
 {
@@ -429,7 +429,7 @@ interpolation_table_init(void)
       for (p[0] = 0; p[0] < (1 << COLOR_CONV_OFS); p[0]++)
         {
          uns index;
       for (p[0] = 0; p[0] < (1 << COLOR_CONV_OFS); p[0]++)
         {
          uns index;
-          static const uns tetrahedrons[5][4] = {
+          static const uns tetrahedra[5][4] = {
             {0000, 0001, 0010, 0100},
             {0110, 0111, 0100, 0010},
             {0101, 0100, 0111, 0001},
             {0000, 0001, 0010, 0100},
             {0110, 0111, 0100, 0010},
             {0101, 0100, 0111, 0001},
@@ -445,7 +445,7 @@ interpolation_table_init(void)
            index = 3;
          else
            index = 4;
            index = 3;
          else
            index = 4;
-         interpolate_tetrahedron(n, p, tetrahedrons[index]);
+         interpolate_tetrahedron(n, p, tetrahedra[index]);
          n++;
        }
 }
          n++;
        }
 }
index 42596089dc631e4bf4ab620f62a2d38bc0bead44..acae30f4b760d6336f288dcbb7a2f81e17d7488f 100644 (file)
@@ -1,4 +1,3 @@
 # Tests for color conversion module
 
 Run:   obj/images/color-t
 # Tests for color conversion module
 
 Run:   obj/images/color-t
-
index bcabc520d656158abf7f37858b38fc4ac28c7334..6281ba3cb0974874b0974383b45de2a2b1972820 100644 (file)
@@ -46,12 +46,10 @@ image_context_msg_silent(struct image_context *ctx UNUSED)
 void
 image_context_msg(struct image_context *ctx, uns code, char *msg, ...)
 {
 void
 image_context_msg(struct image_context *ctx, uns code, char *msg, ...)
 {
-  ctx->msg_code = code;
   va_list args;
   va_start(args, msg);
   va_list args;
   va_start(args, msg);
-  ctx->msg = bb_vprintf(&ctx->msg_buf, msg, args);
+  image_context_vmsg(ctx, code, msg, args);
   va_end(args);
   va_end(args);
-  ctx->msg_callback(ctx);
 }
 
 void
 }
 
 void
index de47695d611f841dd35cc7e8c1e791bb8ce7ae49..b046672f9e1959aec7a3eb3df05a07d6ac0b54fd 100644 (file)
@@ -1,3 +1,12 @@
+/*
+ *     Image Library -- Simple automatic tests
+ *
+ *     (c) 2006 Pavel Charvat <pchar@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
+ */
+
 #undef LOCAL_DEBUG
 
 #include "lib/lib.h"
 #undef LOCAL_DEBUG
 
 #include "lib/lib.h"
index e37f44969ce3b5c3645805e00ce3f36a28da90d0..fedd9f1a1b0a3412fe8800e57fbdf8ea2e49fbf8 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- *     Simple image manupulation utility
+ *     Image Library -- Simple image manipulation utility
  *
  *     (c) 2006 Pavel Charvat <pchar@ucw.cz>
  *
  *
  *     (c) 2006 Pavel Charvat <pchar@ucw.cz>
  *
index 2bdcd189be011ec9f1b41a308589c7b2a6b61c3e..e6111ab8e995d98819f090bfc45cc854266ff0e6 100644 (file)
@@ -238,8 +238,8 @@ image_name_to_channels_format(byte *name)
   if (!strcasecmp(name, "rgb"))
     return COLOR_SPACE_RGB;
   if (!strcasecmp(name, "rgbalpha"))
   if (!strcasecmp(name, "rgb"))
     return COLOR_SPACE_RGB;
   if (!strcasecmp(name, "rgbalpha"))
-    return COLOR_SPACE_RGB + IMAGE_ALPHA;
+    return COLOR_SPACE_RGB | IMAGE_ALPHA;
   if (!strcasecmp(name, "rgba"))
   if (!strcasecmp(name, "rgba"))
-    return COLOR_SPACE_RGB + IMAGE_ALPHA;
+    return COLOR_SPACE_RGB | IMAGE_ALPHA;
   return 0;
 }
   return 0;
 }
index 46370f65cd15f2f7fec7abd0f3e272cf8b321518..616c17b3cd8c6e1430ab76ba8bd02d18d498a41a 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- *     Image Library -- Main hearer file
+ *     Image Library -- Main header file
  *
  *     (c) 2006 Pavel Charvat <pchar@ucw.cz>
  *
  *
  *     (c) 2006 Pavel Charvat <pchar@ucw.cz>
  *
@@ -18,7 +18,7 @@ struct fastbuf;
 
 /* context.c
  * - contexts with error/message handling
 
 /* context.c
  * - contexts with error/message handling
- * - imagelib is thread-safe until each context is bounded to a single thread */
+ * - imagelib is thread-safe as long as threads work in different contexts */
 
 struct image_context {
   byte *msg;                           /* last message */
 
 struct image_context {
   byte *msg;                           /* last message */
@@ -52,7 +52,7 @@ extern uns image_max_dim;             /* ImageLib.ImageMaxDim */
 extern uns image_max_bytes;            /* ImageLib.ImageMaxBytes */
 
 /* SSE aligning size, see IMAGE_SSE_ALIGNED */
 extern uns image_max_bytes;            /* ImageLib.ImageMaxBytes */
 
 /* SSE aligning size, see IMAGE_SSE_ALIGNED */
-#define IMAGE_SSE_ALIGN_SIZE (MAX(16, sizeof(uns)))
+#define IMAGE_SSE_ALIGN_SIZE 16
 
 enum image_flag {
   IMAGE_COLOR_SPACE = 0x7,             /* mask for enum color_space */
 
 enum image_flag {
   IMAGE_COLOR_SPACE = 0x7,             /* mask for enum color_space */
@@ -70,10 +70,10 @@ enum image_flag {
 
 struct image {
   byte *pixels;                        /* aligned top left pixel, there are at least sizeof(uns)
 
 struct image {
   byte *pixels;                        /* aligned top left pixel, there are at least sizeof(uns)
-                                  unsed bytes after the buffer (possible optimizations) */
+                                  unused bytes after the buffer (possible optimizations) */
   u32 cols;                    /* number of columns */
   u32 rows;                    /* number of rows */
   u32 cols;                    /* number of columns */
   u32 rows;                    /* number of rows */
-  u32 pixel_size;              /* size of pixel (1, 2, 3 or 4) */
+  u32 pixel_size;              /* size of pixel in bytes (1, 2, 3 or 4) */
   u32 row_size;                        /* scanline size in bytes */
   u32 row_pixels_size;         /* scanline size in bytes excluding rows gaps */
   u32 image_size;              /* rows * row_size */
   u32 row_size;                        /* scanline size in bytes */
   u32 row_pixels_size;         /* scanline size in bytes excluding rows gaps */
   u32 image_size;              /* rows * row_size */