[wip] slave_render_image(), slave_hide_image_region(): Accept struct box as a parameter
[elinks/images.git] / src / osdep / image.h
blob23d3df10437156050090cf58ffa5fa271336217e
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 #include "util/box.h"
11 /* This is the slave-side image rendering context. */
12 struct image_ctx {
13 /* Screen resolution in pixels. */
14 int xres, yres;
16 /* Cached per-image information. */
17 struct image_data {
18 /* Bounding box of the image. */
19 struct box box;
20 unsigned char *file;
21 int visible;
22 } images[MAX_IMAGES];
24 /* Pipe to the image drawing helper. */
25 int pipe_to[2];
26 int pipe_from[2];
29 extern struct image_ctx *init_images(); // NULL if N/A
30 extern void done_images(struct image_ctx *img);
32 extern void slave_images_getres(struct image_ctx *img, int *xres, int *yres);
33 extern void slave_render_image(struct image_ctx *img, int imgid, struct box *box, unsigned char *file);
34 extern void slave_move_image(struct image_ctx *img, int imgid, int x, int y);
35 extern void slave_hide_image(struct image_ctx *img, int imgid);
36 extern void slave_hide_image_region(struct image_ctx *img, struct box *region);
37 extern void slave_sync_images(struct image_ctx *img);
39 /* This function does not require the slave-specific context and it is
40 * called directly from the master. */
41 extern void image_size(unsigned char *file, int *w, int *h);
43 #endif