0
|
1 |
#ifndef PNGTILE_CACHE_H
|
|
2 |
#define PNGTILE_CACHE_H
|
|
3 |
|
|
4 |
/**
|
|
5 |
* @file
|
|
6 |
*
|
|
7 |
* Internal image cache implementation
|
|
8 |
*/
|
|
9 |
#include "image.h"
|
|
10 |
|
|
11 |
/**
|
|
12 |
* State for cache access
|
|
13 |
*/
|
|
14 |
struct pt_cache {
|
|
15 |
|
|
16 |
};
|
|
17 |
|
|
18 |
/**
|
|
19 |
* On-disk header
|
|
20 |
*/
|
|
21 |
struct pt_cache_header {
|
|
22 |
/** Pixel dimensions of image */
|
|
23 |
uint32_t width, height;
|
|
24 |
|
|
25 |
/** Pixel format */
|
|
26 |
uint8_t bit_depth, color_type;
|
|
27 |
|
|
28 |
/** Convenience field for number of bytes per row */
|
|
29 |
uint32_t row_bytes;
|
|
30 |
};
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Construct the image cache info object associated with the given image.
|
|
34 |
*/
|
|
35 |
int pt_cache_open (struct pt_cache **cache_ptr, struct pt_image *img, int mode);
|
|
36 |
|
|
37 |
/**
|
|
38 |
* Verify if the cached data is still fresh compared to the original.
|
|
39 |
*/
|
|
40 |
bool pt_cache_fresh (struct pt_cache *cache);
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Update the cache data from the given PNG image.
|
|
44 |
*/
|
|
45 |
int pt_cache_update_png (struct pt_cache *cache, png_structp png, png_infop info);
|
|
46 |
|
|
47 |
#endif
|