Photon microGUI widgets library 0.6.0
Image.h
1#ifndef PHWIDGETS_IMAGE_H
2#define PHWIDGETS_IMAGE_H
3
4#include <photon/PhT.h>
5#include <photon/PtT.h>
6
7#include <string>
8
9namespace PhWidgets
10{
11 namespace Drawing
12 {
14
24 {
29 {
30 BitmapBackfill = Pg_BITMAP_BACKFILL,
31 BitmapTransparent = Pg_BITMAP_TRANSPARENT
34 };
35 };
36
38
48 {
53 {
54 ImageDirect1555 = Pg_IMAGE_DIRECT_1555,
55 ImageDirect4444 = Pg_IMAGE_DIRECT_4444,
56 ImageDirect444 = Pg_IMAGE_DIRECT_444,
60 ImageDirect565 = Pg_IMAGE_DIRECT_565,
62 ImageDirect8888 = Pg_IMAGE_DIRECT_8888,
65 ImageDirect888 = Pg_IMAGE_DIRECT_888
67 };
68 };
69
71
81 {
86 {
87 ImageGradientByte = Pg_IMAGE_GRADIENT_BYTE,
90 ImageGradientNibble = Pg_IMAGE_GRADIENT_NIBBLE
94
95 };
96 };
97
99
109 {
114 {
115 ImagePaletteByte = Pg_IMAGE_PALETTE_BYTE,
118 ImagePaletteNibble = Pg_IMAGE_PALETTE_NIBBLE
122 };
123 };
124
126
135 struct ImageType:
140 {
142
143
168 };
169 } // namespace Drawing
170
171 namespace Drawing
172 {
174
184 class Image
185 {
186 public:
188
203 Image(const PhImage_t &image);
204
206
218 Image(const Image &other);
219
222
224
236
238
249 const unsigned short Width;
250
252
263 const unsigned short Height;
264
266
267
269
292 static Image FromFile(std::string filename);
293
295
298 operator PhImage_t* () const;
299
300 private:
301 PhImage_t *_image;
302
303 struct ImageInfo;
304
305 Image(const ImageInfo&);
306 };
307 }
308} // namespace PhWidgets
309
310#endif // PHWIDGETS_IMAGE_H
An abstract base class that provides functionality for the Drawing::Bitmap class.
Definition: Image.h:185
static Image FromFile(std::string filename)
Creates an Image from the specified file.
const PhDim_t Size
Gets the width and height, in pixels, of this Image.
Definition: Image.h:235
Image(const Image &other)
(copy constructor)
const unsigned short Width
Gets the width, in pixels, of this Image.
Definition: Image.h:249
Image(const PhImage_t &image)
(copy constructor)
const unsigned short Height
Gets the height, in pixels, of this Image.
Definition: Image.h:263
The main namespace for all widgets.
Definition: Basic.h:11
Provides a collection of bitmap image types for use by a Photon microGUI application.
Definition: Image.h:24
eBitmapImageType
Definition: Image.h:29
@ BitmapBackfill
A bitonal image; the two colors are specified in the color palette.
Definition: Image.h:30
@ BitmapTransparent
Definition: Image.h:31
Provides a collection of direct image types for use by a Photon microGUI application.
Definition: Image.h:48
eDirectImageType
Definition: Image.h:53
@ ImageDirect8888
Definition: Image.h:62
@ ImageDirect444
Definition: Image.h:56
@ ImageDirect4444
This format has 4 bits of alpha, and 4 bits each of red, green, and blue.
Definition: Image.h:55
@ ImageDirect888
Definition: Image.h:65
@ ImageDirect565
Definition: Image.h:60
@ ImageDirect1555
This format has, for each pixel, one bit of alpha, and 5 bits each of red, green, and blue.
Definition: Image.h:54
Provides a collection of gradient image types for use by a Photon microGUI application.
Definition: Image.h:81
eGradientImageType
Definition: Image.h:86
@ ImageGradientNibble
Definition: Image.h:90
@ ImageGradientByte
Definition: Image.h:87
Provides a collection of all image types for use by a Photon microGUI application.
Definition: Image.h:140
Provides a collection of palette image types for use by a Photon microGUI application.
Definition: Image.h:109
ePaletteImageType
Definition: Image.h:114
@ ImagePaletteNibble
Definition: Image.h:118
@ ImagePaletteByte
Definition: Image.h:115