| 1 | // This file is part of SmallBASIC |
| 2 | // |
| 3 | // Copyright(C) 2001-2014 Chris Warren-Smith. |
| 4 | // |
| 5 | // This program is distributed under the terms of the GPL v2.0 or later |
| 6 | // Download the GNU Public License (GPL) from www.gnu.org |
| 7 | // |
| 8 | |
| 9 | #ifndef IMAGE_H |
| 10 | #define IMAGE_H |
| 11 | |
| 12 | #include "common/var.h" |
| 13 | #include "ui/shape.h" |
| 14 | |
| 15 | struct ImageBuffer { |
| 16 | ImageBuffer(); |
| 17 | ImageBuffer(ImageBuffer &imageBuffer); |
| 18 | virtual ~ImageBuffer(); |
| 19 | |
| 20 | char *_filename; |
| 21 | unsigned char *_image; |
| 22 | unsigned _bid; |
| 23 | unsigned _width; |
| 24 | unsigned _height; |
| 25 | }; |
| 26 | |
| 27 | struct ImageDisplay : public Shape { |
| 28 | ImageDisplay(); |
| 29 | ImageDisplay(ImageDisplay &imageDisplay); |
| 30 | virtual ~ImageDisplay() {} |
| 31 | |
| 32 | void copyImage(ImageDisplay &imageDisplay); |
| 33 | void draw(int x, int y, int bw, int bh, int cw); |
| 34 | |
| 35 | int _offsetLeft; |
| 36 | int _offsetTop; |
| 37 | int _zIndex; |
| 38 | int _opacity; |
| 39 | unsigned _id; |
| 40 | unsigned _bid; |
| 41 | ImageBuffer *_buffer; |
| 42 | }; |
| 43 | |
| 44 | ImageDisplay *create_display_image(var_p_t var, const char *name); |
| 45 | void reset_image_cache(); |
| 46 | void screen_dump(); |
| 47 | |
| 48 | #endif |
| 49 | |