+#include "ucw/bbuf.h"
+
+struct mempool;
+struct fastbuf;
+
+
+/* context.c
+ * - contexts with error/message handling
+ * - imagelib is thread-safe as long as threads work in different contexts */
+
+struct image_context {
+ byte *msg; /* last message */
+ uns msg_code; /* last message code (see images/error.h for details) */
+ bb_t msg_buf; /* message buffer */
+ void (*msg_callback)(struct image_context *ctx); /* called for each message (in msg_{str,code}) */
+ uns tracing_level; /* tracing level (zero to disable) */
+};
+
+/* 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, uns code, char *msg, ...);
+void image_context_vmsg(struct image_context *ctx, uns 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 uns image_max_dim; /* ImageLib.ImageMaxDim */
+extern uns image_max_bytes; /* ImageLib.ImageMaxBytes */
+
+/* SSE aligning size, see IMAGE_SSE_ALIGNED */
+#define IMAGE_SSE_ALIGN_SIZE 16
+