[wip] Initial stab on inline images support, with many problems
[elinks/images.git] / src / osdep / image.h
blobcb05c8172ca7eed910d3bf7613b80bf5e9abbbcb
1 /* Image drawing. These are the actual slave-side routines. */
3 #ifndef EL__OSDEP_IMAGE_H
4 #define EL__OSDEP_IMAGE_H
6 /* These routines are not directly available from "normal" code. To request
7 * image drawing, always use the terminal/image.h interface. */
9 /* This is the slave-side image rendering context. */
10 struct image_ctx {
11 /* Screen resolution in pixels. */
12 int xres, yres;
14 /* Cached per-image information. */
15 struct image_data {
16 int x, y, w, h;
17 unsigned char *file;
18 int visible;
19 } images[MAX_IMAGES];
21 /* Pipe to the image drawing helper. */
22 int pipe_to[2];
23 int pipe_from[2];
26 extern struct image_ctx *init_images(); // NULL if N/A
27 extern void done_images(struct image_ctx *img);
29 extern void slave_images_getres(struct image_ctx *img, int *xres, int *yres);
30 extern void slave_render_image(struct image_ctx *img, int imgid, int x, int y, unsigned char *file, int w, int h);
31 extern void slave_move_image(struct image_ctx *img, int imgid, int x, int y);
32 extern void slave_hide_image(struct image_ctx *img, int imgid);
33 extern void slave_hide_image_region(struct image_ctx *img, int x, int y, int w, int h);
34 extern void slave_sync_images(struct image_ctx *img);
36 /* This function does not require the slave-specific context and it is
37 * called directly from the master. */
38 extern void image_size(unsigned char *file, int *w, int *h);
40 #endif