equal
deleted
inserted
replaced
|
1 from libc.stdio cimport ( |
|
2 FILE, |
|
3 ) |
|
4 |
|
5 cdef extern from "pngtile.h" : |
|
6 struct pt_ctx : |
|
7 pass |
|
8 |
|
9 struct pt_image : |
|
10 pass |
|
11 |
|
12 enum pt_open_mode : |
|
13 PT_OPEN_READ # 0 |
|
14 PT_OPEN_UPDATE |
|
15 |
|
16 enum pt_cache_status : |
|
17 PT_CACHE_ERROR # -1 |
|
18 PT_CACHE_FRESH |
|
19 PT_CACHE_NONE |
|
20 PT_CACHE_STALE |
|
21 PT_CACHE_INCOMPAT |
|
22 |
|
23 struct pt_image_info : |
|
24 size_t img_width, img_height, img_bpp |
|
25 int image_mtime, cache_mtime, cache_version |
|
26 size_t image_bytes, cache_bytes |
|
27 size_t cache_blocks |
|
28 |
|
29 struct pt_image_params : |
|
30 int background_color[4] |
|
31 |
|
32 struct pt_tile_info : |
|
33 size_t width, height |
|
34 size_t x, y |
|
35 int zoom |
|
36 |
|
37 ctypedef pt_image_info* const_image_info_ptr "const struct pt_image_info *" |
|
38 |
|
39 ## functions |
|
40 int pt_image_open (pt_image **image_ptr, pt_ctx *ctx, char *png_path, int cache_mode) nogil |
|
41 int pt_image_info_ "pt_image_info" (pt_image *image, pt_image_info **info_ptr) nogil |
|
42 int pt_image_status (pt_image *image) nogil |
|
43 int pt_image_load (pt_image *image) nogil |
|
44 int pt_image_update (pt_image *image, pt_image_params *params) nogil |
|
45 int pt_image_tile_file (pt_image *image, pt_tile_info *info, FILE *out) nogil |
|
46 int pt_image_tile_mem (pt_image *image, pt_tile_info *info, char **buf_ptr, size_t *len_ptr) nogil |
|
47 void pt_image_destroy (pt_image *image) nogil |
|
48 |
|
49 # error code -> name |
|
50 char* pt_strerror (int err) |