diff options
Diffstat (limited to 'src/dicache.h')
-rw-r--r-- | src/dicache.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/dicache.h b/src/dicache.h index 6cbcf3a5..70adb6c0 100644 --- a/src/dicache.h +++ b/src/dicache.h @@ -10,6 +10,10 @@ extern "C" { #include "image.hh" #include "cache.h" +/* Symbolic name to request the last version of an image */ +#define DIC_Last -1 + + /* These will reflect the entry's "state" */ typedef enum { DIC_Empty, /* Just created the entry */ @@ -27,10 +31,8 @@ struct _DICacheEntry { uint_t width, height; /* As taken from image data */ DilloImgType type; /* Image type */ uchar_t *cmap; /* Color map */ - uchar_t *linebuf; /* Decompressed RGB buffer for one line */ void *v_imgbuf; /* Void pointer to an Imgbuf object */ - size_t TotalSize; /* Amount of memory the image takes up */ - int Y; /* Current decoding row */ + uint_t TotalSize; /* Amount of memory the image takes up */ uint_t ScanNumber; /* Current decoding scan */ bitvec_t *BitVec; /* Bit vector for decoded rows */ DicEntryState State; /* Current status for this entry */ @@ -38,15 +40,24 @@ struct _DICacheEntry { int version; /* Version number, used for different versions of the same URL image */ + CA_Callback_t Decoder; /* Client function */ + void *DecoderData; /* Client function data */ + uint_t DecodedSize; /* Size of already decoded data */ + DICacheEntry *next; /* Link to the next "newer" version */ }; void a_Dicache_init (void); -DICacheEntry *a_Dicache_get_entry(const DilloUrl *Url); -DICacheEntry *a_Dicache_add_entry(const DilloUrl *Url); +DICacheEntry *a_Dicache_get_entry(const DilloUrl *Url, int version); +void *a_Dicache_png_image(const char *Type, void *Ptr, CA_Callback_t *Call, + void **Data); +void *a_Dicache_gif_image(const char *Type, void *Ptr, CA_Callback_t *Call, + void **Data); +void *a_Dicache_jpeg_image(const char *Type, void *Ptr, CA_Callback_t *Call, + void **Data); void a_Dicache_callback(int Op, CacheClient_t *Client); void a_Dicache_set_parms(DilloUrl *url, int version, DilloImage *Image, @@ -54,9 +65,8 @@ void a_Dicache_set_parms(DilloUrl *url, int version, DilloImage *Image, void a_Dicache_set_cmap(DilloUrl *url, int version, DilloImage *Image, const uchar_t *cmap, uint_t num_colors, int num_colors_max, int bg_index); -void a_Dicache_new_scan(DilloImage *image, const DilloUrl *url, int version); -void a_Dicache_write(DilloImage *Image, DilloUrl *url, int version, - const uchar_t *buf, uint_t Y); +void a_Dicache_new_scan(const DilloUrl *url, int version); +void a_Dicache_write(DilloUrl *url, int version, const uchar_t *buf, uint_t Y); void a_Dicache_close(DilloUrl *url, int version, CacheClient_t *Client); void a_Dicache_invalidate_entry(const DilloUrl *Url); |