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
9
namespace
PhWidgets
10
{
11
namespace
Drawing
12
{
14
23
struct
BitmapImageType
24
{
28
enum
eBitmapImageType
29
{
30
BitmapBackfill
= Pg_BITMAP_BACKFILL,
31
BitmapTransparent
= Pg_BITMAP_TRANSPARENT
34
};
35
};
36
38
47
struct
DirectImageType
48
{
52
enum
eDirectImageType
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
80
struct
GradientImageType
81
{
85
enum
eGradientImageType
86
{
87
ImageGradientByte
= Pg_IMAGE_GRADIENT_BYTE,
90
ImageGradientNibble
= Pg_IMAGE_GRADIENT_NIBBLE
94
95
};
96
};
97
99
108
struct
PaletteImageType
109
{
113
enum
ePaletteImageType
114
{
115
ImagePaletteByte
= Pg_IMAGE_PALETTE_BYTE,
118
ImagePaletteNibble
= Pg_IMAGE_PALETTE_NIBBLE
122
};
123
};
124
126
135
struct
ImageType
:
136
BitmapImageType
,
137
DirectImageType
,
138
GradientImageType
,
139
PaletteImageType
140
{
142
143
147
using
BitmapImageType::eBitmapImageType
;
156
using
DirectImageType::eDirectImageType
;
161
using
GradientImageType::eGradientImageType
;
166
using
PaletteImageType::ePaletteImageType
;
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
235
const
PhDim_t
Size
;
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
PhWidgets::Drawing::Image
An abstract base class that provides functionality for the Drawing::Bitmap class.
Definition:
Image.h:185
PhWidgets::Drawing::Image::FromFile
static Image FromFile(std::string filename)
Creates an Image from the specified file.
PhWidgets::Drawing::Image::Size
const PhDim_t Size
Gets the width and height, in pixels, of this Image.
Definition:
Image.h:235
PhWidgets::Drawing::Image::Image
Image(const Image &other)
(copy constructor)
PhWidgets::Drawing::Image::Width
const unsigned short Width
Gets the width, in pixels, of this Image.
Definition:
Image.h:249
PhWidgets::Drawing::Image::Image
Image(const PhImage_t &image)
(copy constructor)
PhWidgets::Drawing::Image::Height
const unsigned short Height
Gets the height, in pixels, of this Image.
Definition:
Image.h:263
PhWidgets
The main namespace for all widgets.
Definition:
Basic.h:11
PhDim_t
PhImage_t
PhWidgets::Drawing::BitmapImageType
Provides a collection of bitmap image types for use by a Photon microGUI application.
Definition:
Image.h:24
PhWidgets::Drawing::BitmapImageType::eBitmapImageType
eBitmapImageType
Definition:
Image.h:29
PhWidgets::Drawing::BitmapImageType::BitmapBackfill
@ BitmapBackfill
A bitonal image; the two colors are specified in the color palette.
Definition:
Image.h:30
PhWidgets::Drawing::BitmapImageType::BitmapTransparent
@ BitmapTransparent
Definition:
Image.h:31
PhWidgets::Drawing::DirectImageType
Provides a collection of direct image types for use by a Photon microGUI application.
Definition:
Image.h:48
PhWidgets::Drawing::DirectImageType::eDirectImageType
eDirectImageType
Definition:
Image.h:53
PhWidgets::Drawing::DirectImageType::ImageDirect8888
@ ImageDirect8888
Definition:
Image.h:62
PhWidgets::Drawing::DirectImageType::ImageDirect444
@ ImageDirect444
Definition:
Image.h:56
PhWidgets::Drawing::DirectImageType::ImageDirect4444
@ ImageDirect4444
This format has 4 bits of alpha, and 4 bits each of red, green, and blue.
Definition:
Image.h:55
PhWidgets::Drawing::DirectImageType::ImageDirect888
@ ImageDirect888
Definition:
Image.h:65
PhWidgets::Drawing::DirectImageType::ImageDirect565
@ ImageDirect565
Definition:
Image.h:60
PhWidgets::Drawing::DirectImageType::ImageDirect1555
@ ImageDirect1555
This format has, for each pixel, one bit of alpha, and 5 bits each of red, green, and blue.
Definition:
Image.h:54
PhWidgets::Drawing::GradientImageType
Provides a collection of gradient image types for use by a Photon microGUI application.
Definition:
Image.h:81
PhWidgets::Drawing::GradientImageType::eGradientImageType
eGradientImageType
Definition:
Image.h:86
PhWidgets::Drawing::GradientImageType::ImageGradientNibble
@ ImageGradientNibble
Definition:
Image.h:90
PhWidgets::Drawing::GradientImageType::ImageGradientByte
@ ImageGradientByte
Definition:
Image.h:87
PhWidgets::Drawing::ImageType
Provides a collection of all image types for use by a Photon microGUI application.
Definition:
Image.h:140
PhWidgets::Drawing::PaletteImageType
Provides a collection of palette image types for use by a Photon microGUI application.
Definition:
Image.h:109
PhWidgets::Drawing::PaletteImageType::ePaletteImageType
ePaletteImageType
Definition:
Image.h:114
PhWidgets::Drawing::PaletteImageType::ImagePaletteNibble
@ ImagePaletteNibble
Definition:
Image.h:118
PhWidgets::Drawing::PaletteImageType::ImagePaletteByte
@ ImagePaletteByte
Definition:
Image.h:115
src
Drawing
Image.h
Generated by
1.9.4