+ return pixel_size;
+}
+
+struct image *
+image_new(struct image_thread *it, uns cols, uns rows, uns flags, struct mempool *pool)
+{
+ DBG("image_new(cols=%u rows=%u flags=0x%x pool=%p)", cols, rows, flags, pool);
+ flags &= IMAGE_NEW_FLAGS;
+ if (unlikely(!image_dimensions_valid(cols, rows)))
+ {
+ image_thread_err_format(it, IMAGE_ERR_INVALID_DIMENSIONS, "Invalid image dimensions (%ux%u)", cols, rows);
+ return NULL;
+ }
+ struct image *img;
+ uns pixel_size, row_size, align;
+ pixel_size = flags_to_pixel_size(flags);