]> mj.ucw.cz Git - libucw.git/blob - image-obj.h
95976bc8ce85412b3f2644486b1f093e3cfff81f
[libucw.git] / image-obj.h
1 /*
2  *      Image Library -- Image Cards Manipulations
3  *
4  *      (c) 2006 Pavel Charvat <pchar@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #ifndef _IMAGES_IMAGE_OBJ_H
11 #define _IMAGES_IMAGE_OBJ_H
12
13 #include "images/images.h"
14
15 struct mempool;
16 struct odes;
17
18 enum image_obj_format {
19   IMAGE_OBJ_FORMAT_JPEG,
20   IMAGE_OBJ_FORMAT_PNG
21 };
22
23 enum image_obj_flag {
24   IMAGE_OBJ_VALID_INFO = 0x1,
25   IMAGE_OBJ_VALID_DATA = 0x2,
26   IMAGE_OBJ_VALID_IMAGE = 0x4
27 };
28
29 struct image_obj {
30   struct odes *obj;
31   struct mempool *pool;
32   uns flags;
33   uns width;
34   uns height;
35   uns thumb_format;
36   byte *thumb_data;
37   uns thumb_size;
38   struct image thumb;
39 };
40
41 static inline void
42 imo_init(struct image_obj *imo, struct mempool *pool, struct odes *obj)
43 {
44   imo->obj = obj;
45   imo->pool = pool;
46   imo->flags = 0;
47 }
48
49 void imo_decompress_thumbnails_init(void);
50 void imo_decompress_thumbnails_done(void);
51 int imo_decompress_thumbnail(struct image_obj *imo);
52
53 #endif