+/* initialization/cleanup */
+void image_context_init(struct image_context *ctx);
+void image_context_cleanup(struct image_context *ctx);
+
+/* message handling, see images/error.h for useful macros */
+void image_context_msg(struct image_context *ctx, uint code, char *msg, ...);
+void image_context_vmsg(struct image_context *ctx, uint code, char *msg, va_list args);
+
+/* default callback, displays messages with standard libucw's log() routine */
+void image_context_msg_default(struct image_context *ctx);
+
+/* empty callback */
+void image_context_msg_silent(struct image_context *ctx);
+
+
+/* image.c
+ * - basic manipulation with images
+ * - image structure is not directly connected to a single context
+ * but manipulation routines are (user must synchronize the access himself)! */
+
+extern uint image_max_dim; /* ImageLib.ImageMaxDim */
+extern uint image_max_bytes; /* ImageLib.ImageMaxBytes */
+
+/* SSE aligning size, see IMAGE_SSE_ALIGNED */
+#define IMAGE_SSE_ALIGN_SIZE 16
+
+enum image_flag {
+ IMAGE_COLOR_SPACE = 0xf, /* mask for enum color_space */
+ IMAGE_ALPHA = 0x10, /* alpha channel */
+ IMAGE_PIXELS_ALIGNED = 0x20, /* align pixel size to the nearest power of two */
+ IMAGE_SSE_ALIGNED = 0x40, /* align scanlines to multiples of 16 bytes (both start and size) */
+ IMAGE_NEED_DESTROY = 0x80, /* image is allocated with xmalloc */
+ IMAGE_GAPS_PROTECTED = 0x100, /* cannot access gaps between rows */
+ IMAGE_CHANNELS_FORMAT = IMAGE_COLOR_SPACE | IMAGE_ALPHA,
+ IMAGE_PIXEL_FORMAT = IMAGE_CHANNELS_FORMAT | IMAGE_PIXELS_ALIGNED,
+ IMAGE_ALIGNED = IMAGE_PIXELS_ALIGNED | IMAGE_SSE_ALIGNED,
+ IMAGE_NEW_FLAGS = IMAGE_PIXEL_FORMAT | IMAGE_SSE_ALIGNED,
+ IMAGE_INTERNAL_FLAGS = IMAGE_NEED_DESTROY | IMAGE_GAPS_PROTECTED,