]> mj.ucw.cz Git - libucw.git/blobdiff - images/images.h
align signature size
[libucw.git] / images / images.h
index 4ac9da6ee599c77a78b5f985727e4b1cc254b1c1..460f5881c9fa4e5f698fa927a044af6bd9d723f9 100644 (file)
@@ -70,7 +70,7 @@ enum image_flag {
   IMAGE_PIXELS_ALIGNED = 0x10, /* align pixel size to the nearest power of two  */
   IMAGE_SSE_ALIGNED = 0x20,    /* align scanlines to multiples of 16 bytes (both start and size) */
   IMAGE_NEED_DESTROY = 0x40,   /* image is allocated with xmalloc */
-  IMAGE_GAPS_PROTECTED = 0x80, /* cannot write to gaps between rows */
+  IMAGE_GAPS_PROTECTED = 0x80, /* 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,
@@ -93,8 +93,8 @@ struct image *image_new(struct image_thread *it, uns cols, uns rows, uns flags,
 struct image *image_clone(struct image_thread *it, struct image *src, uns flags, struct mempool *pool);
 void image_destroy(struct image *img);
 void image_clear(struct image_thread *it, struct image *img);
-int image_init_matrix(struct image_thread *it, struct image *img, byte *pixels, uns cols, uns rows, uns row_size, uns flags);
-int image_init_subimage(struct image_thread *it, struct image *img, struct image *src, uns left, uns top, uns cols, uns rows);
+struct image *image_init_matrix(struct image_thread *it, struct image *img, byte *pixels, uns cols, uns rows, uns row_size, uns flags);
+struct image *image_init_subimage(struct image_thread *it, struct image *img, struct image *src, uns left, uns top, uns cols, uns rows);
 
 static inline int
 image_dimensions_valid(uns cols, uns rows)
@@ -147,6 +147,10 @@ struct image_io {
   u32 jpeg_quality;                    /* [    W] - JPEG compression quality (1..100) */
   u32 number_of_colors;                        /* [ H   ] - number of image colors */
   struct color background_color;       /* [ HI  ] - background color, zero if undefined */
+#ifdef CONFIG_IMAGES_EXIF
+  u32 exif_size;                       /* [ H  W] - EXIF size in bytes (zero if not present) */
+  byte *exif_data;                     /* [ H  W] - EXIF data */
+#endif
 
   /* internals */
   struct image_thread *thread;
@@ -160,9 +164,12 @@ enum image_io_flags {
   IMAGE_IO_NEED_DESTROY = 0x10000,     /* [   O ] - enables automatic call of image_destroy */
   IMAGE_IO_HAS_PALETTE = 0x20000,      /* [ H   ] - true for image with indexed colors */
   IMAGE_IO_USE_BACKGROUND = 0x40000,   /* [  I  ] - merge transparent pixels with background_color */
+#ifdef CONFIG_IMAGES_EXIF
+  IMAGE_IO_WANT_EXIF = 0x80000,                /* [R    ] - read EXIF data if present */
+#endif
 };
 
-void image_io_init(struct image_thread *it, struct image_io *io);
+int image_io_init(struct image_thread *it, struct image_io *io);
 void image_io_cleanup(struct image_io *io);
 void image_io_reset(struct image_io *io);