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
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])
{
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},
index = 3;
else
index = 4;
- interpolate_tetrahedron(n, p, tetrahedrons[index]);
+ interpolate_tetrahedron(n, p, tetrahedra[index]);
n++;
}
}
# Tests for color conversion module
Run: obj/images/color-t
-
void
image_context_msg(struct image_context *ctx, uns code, char *msg, ...)
{
- ctx->msg_code = code;
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);
- ctx->msg_callback(ctx);
}
void
+/*
+ * 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"
/*
- * Simple image manupulation utility
+ * Image Library -- Simple image manipulation utility
*
* (c) 2006 Pavel Charvat <pchar@ucw.cz>
*
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"))
- return COLOR_SPACE_RGB + IMAGE_ALPHA;
+ return COLOR_SPACE_RGB | IMAGE_ALPHA;
return 0;
}
/*
- * Image Library -- Main hearer file
+ * Image Library -- Main header file
*
* (c) 2006 Pavel Charvat <pchar@ucw.cz>
*
/* 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 */
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 */
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 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 */