annotate src/image.hh @ 1055:6fcb2fa90e23

Regression fix: make scaled multiscan images work again.
author corvid <corvid@lavabit.com>
date Tue, 28 Apr 2009 08:45:47 -0400
parents cb6c6a8a5e6c
children 4d3828de8290
rev   line source
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
1 #ifndef __IMAGE_HH__
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
2 #define __IMAGE_HH__
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
3
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
4 // The DilloImage data-structure and methods
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
5
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
6
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
7 #ifdef __cplusplus
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
8 extern "C" {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
9 #endif /* __cplusplus */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
10
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
11
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
12 #include "bitvec.h"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
13 #include "url.h"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
14
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
15 typedef struct _DilloImage DilloImage;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
16
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
17 typedef enum {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
18 DILLO_IMG_TYPE_INDEXED,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
19 DILLO_IMG_TYPE_RGB,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
20 DILLO_IMG_TYPE_GRAY,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
21 DILLO_IMG_TYPE_NOTSET /* Initial value */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
22 } DilloImgType;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
23
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
24 /* These will reflect the Image's "state" */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
25 typedef enum {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
26 IMG_Empty, /* Just created the entry */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
27 IMG_SetParms, /* Parameters set */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
28 IMG_SetCmap, /* Color map set */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
29 IMG_Write, /* Feeding the entry */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
30 IMG_Close, /* Whole image got! */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
31 IMG_Abort /* Image transfer aborted */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
32 } ImageState;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
33
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
34 struct _DilloImage {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
35 void *dw;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
36
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
37 /* Parameters as told by image data */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
38 uint_t width;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
39 uint_t height;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
40
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
41 int32_t bg_color; /* Background color */
80
17f7b0db59ca Updated doc/Images.txt
jcid
parents: 0
diff changeset
42 bitvec_t *BitVec; /* Bit vector for decoded rows */
104
ed71c7b5ea92 - Added support for progressive display of progressive jpegs.
jcid
parents: 80
diff changeset
43 uint_t ScanNumber; /* Current decoding scan */
80
17f7b0db59ca Updated doc/Images.txt
jcid
parents: 0
diff changeset
44 ImageState State; /* Processing status */
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
45
80
17f7b0db59ca Updated doc/Images.txt
jcid
parents: 0
diff changeset
46 int RefCount; /* Reference counter */
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
47 };
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
48
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
49
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
50 /*
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
51 * Function prototypes
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
52 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
53 DilloImage *a_Image_new(int width, int height,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
54 const char *alt_text, int32_t bg_color);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
55 void a_Image_ref(DilloImage *Image);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
56 void a_Image_unref(DilloImage *Image);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
57
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
58 void a_Image_set_parms(DilloImage *Image, void *v_imgbuf, DilloUrl *url,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
59 int version, uint_t width, uint_t height,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
60 DilloImgType type);
708
697145062347 imported patch dicache-cleanup3
Jorge Arellano Cid <jcid@dillo.org>
parents: 703
diff changeset
61 void a_Image_write(DilloImage *Image, uint_t y);
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
62 void a_Image_close(DilloImage *Image);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
63
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
64
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
65 #ifdef __cplusplus
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
66 }
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
67 #endif /* __cplusplus */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
68
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
69 #endif /* __IMAGE_HH__ */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
70