Dillo v3.1.1-91-g6d5b3ee3
Loading...
Searching...
No Matches
dicache.h
Go to the documentation of this file.
1#ifndef __DICACHE_H__
2#define __DICACHE_H__
3
4#ifdef __cplusplus
5extern "C" {
6#endif /* __cplusplus */
7
8
9#include "bitvec.h"
10#include "image.hh"
11#include "cache.h"
12
14#define DIC_Last -1
16#define DIF_Last 1
17#define DIF_Valid 2
18
19
20/* These will reflect the entry's "state" */
29
50
51
52void a_Dicache_init (void);
53
54DICacheEntry *a_Dicache_get_entry(const DilloUrl *Url, int version);
55
56void *a_Dicache_png_image(const char *Type, void *Ptr, CA_Callback_t *Call,
57 void **Data);
58void *a_Dicache_gif_image(const char *Type, void *Ptr, CA_Callback_t *Call,
59 void **Data);
60void *a_Dicache_jpeg_image(const char *Type, void *Ptr, CA_Callback_t *Call,
61 void **Data);
62void a_Dicache_callback(int Op, CacheClient_t *Client);
63
64void a_Dicache_set_parms(DilloUrl *url, int version, DilloImage *Image,
65 uint_t width, uint_t height, DilloImgType type,
66 double gamma);
67void a_Dicache_set_cmap(DilloUrl *url, int version, int bg_color,
68 const uchar_t *cmap, uint_t num_colors,
69 int num_colors_max, int bg_index);
70void a_Dicache_new_scan(const DilloUrl *url, int version);
71void a_Dicache_write(DilloUrl *url, int version, const uchar_t *buf, uint_t Y);
72void a_Dicache_close(DilloUrl *url, int version, CacheClient_t *Client);
73
75DICacheEntry* a_Dicache_ref(const DilloUrl *Url, int version);
76void a_Dicache_unref(const DilloUrl *Url, int version);
77void a_Dicache_cleanup(void);
78void a_Dicache_freeall(void);
79
80
81#ifdef __cplusplus
82}
83#endif /* __cplusplus */
84#endif /* __DICACHE_H__ */
void(* CA_Callback_t)(int Op, CacheClient_t *Client)
Callback type for cache clients.
Definition cache.h:43
unsigned char uchar_t
Definition d_size.h:17
unsigned int uint_t
Definition d_size.h:20
void a_Dicache_set_parms(DilloUrl *url, int version, DilloImage *Image, uint_t width, uint_t height, DilloImgType type, double gamma)
Set image's width, height & type.
Definition dicache.c:228
DICacheEntry * a_Dicache_get_entry(const DilloUrl *Url, int version)
Search a particular version of a URL in the Dicache.
Definition dicache.c:130
void a_Dicache_cleanup(void)
Free the imgbuf (RGB data) of unused entries.
Definition dicache.c:522
void a_Dicache_invalidate_entry(const DilloUrl *Url)
Invalidate this entry.
Definition dicache.c:212
DICacheEntry * a_Dicache_ref(const DilloUrl *Url, int version)
Refs the counter of a dicache entry.
Definition dicache.c:197
void a_Dicache_new_scan(const DilloUrl *url, int version)
Reset for a new scan from a multiple-scan image.
Definition dicache.c:286
void a_Dicache_close(DilloUrl *url, int version, CacheClient_t *Client)
Implement the close method of the decoding process.
Definition dicache.c:329
void a_Dicache_init(void)
Initialize dicache data.
Definition dicache.c:65
void a_Dicache_unref(const DilloUrl *Url, int version)
Unrefs the counter of a dicache entry (it counts cache clients).
Definition dicache.c:180
void a_Dicache_callback(int Op, CacheClient_t *Client)
This function is a cache client; (but feeds its clients from dicache)
Definition dicache.c:454
void a_Dicache_write(DilloUrl *url, int version, const uchar_t *buf, uint_t Y)
Implement the write method (Write a scan line into the Dicache entry) buf: row buffer Y : row number.
Definition dicache.c:309
void a_Dicache_freeall(void)
Deallocate memory used by dicache module (Call this one at exit time, with no cache clients queued)
Definition dicache.c:548
void a_Dicache_set_cmap(DilloUrl *url, int version, int bg_color, const uchar_t *cmap, uint_t num_colors, int num_colors_max, int bg_index)
Implement the set_cmap method for the Image.
Definition dicache.c:262
DicEntryState
Definition dicache.h:21
@ DIC_Close
Whole image got!
Definition dicache.h:26
@ DIC_Abort
Image transfer aborted.
Definition dicache.h:27
@ DIC_SetCmap
Color map set.
Definition dicache.h:24
@ DIC_SetParms
Parameters set.
Definition dicache.h:23
@ DIC_Write
Feeding the entry.
Definition dicache.h:25
@ DIC_Empty
Just created the entry.
Definition dicache.h:22
void * a_Dicache_jpeg_image(const char *Type, void *Ptr, CA_Callback_t *Call, void **Data)
JPEG wrapper for Dicache_image()
Definition dicache.c:436
void * a_Dicache_gif_image(const char *Type, void *Ptr, CA_Callback_t *Call, void **Data)
GIF wrapper for Dicache_image()
Definition dicache.c:427
void * a_Dicache_png_image(const char *Type, void *Ptr, CA_Callback_t *Call, void **Data)
PNG wrapper for Dicache_image()
Definition dicache.c:418
The DilloImage data-structure and methods.
DilloImgType
Definition image.hh:42
Data structure for cache clients.
Definition cache.h:48
int RefCount
Reference Counter.
Definition dicache.h:42
uint_t ScanNumber
Current decoding scan.
Definition dicache.h:39
int version
Version number, used for different versions of the same URL image.
Definition dicache.h:43
uchar_t * cmap
Color map.
Definition dicache.h:36
uint_t DecodedSize
Size of already decoded data.
Definition dicache.h:46
short SurvCleanup
Cleanup-pass survival for unused images.
Definition dicache.h:35
DilloImgType type
Image type.
Definition dicache.h:32
short Flags
See Flags.
Definition dicache.h:34
DicEntryState State
Current status for this entry.
Definition dicache.h:41
DilloUrl * url
Image URL for this entry.
Definition dicache.h:31
CA_Callback_t Decoder
Client function.
Definition dicache.h:47
uint_t TotalSize
Amount of memory the image takes up.
Definition dicache.h:38
uint_t width
Definition dicache.h:33
bitvec_t * BitVec
Bit vector for decoded rows.
Definition dicache.h:40
uint_t height
As taken from image data.
Definition dicache.h:33
void * DecoderData
Client function data.
Definition dicache.h:48
void * v_imgbuf
Void pointer to an Imgbuf object.
Definition dicache.h:37
Definition url.h:88