30 #ifndef PT_GFX_IMAGE_H
31 #define PT_GFX_IMAGE_H
33 #include <Pt/Gfx/Api.h>
34 #include <Pt/Gfx/ImageView.h>
48 typedef ImageView::PixelIterator PixelIterator;
49 typedef ImageView::ConstPixelIterator ConstPixelIterator;
58 const Size& size,
size_t padding = 0);
67 const Size& size, Pt::ssize_t padding = 0);
70 const Size& size, Pt::ssize_t padding = 0);
72 PixelIterator pixel(Pt::ssize_t x, Pt::ssize_t y)
73 {
return PixelIterator(view(), x, y); }
76 {
return PixelIterator(view(), 0, 0); }
79 {
return PixelIterator(view(), 0, height()); }
81 ConstPixelIterator pixel(Pt::ssize_t x, Pt::ssize_t y)
const
82 {
return ConstPixelIterator(view(), x, y); }
84 ConstPixelIterator begin()
const
85 {
return ConstPixelIterator(view(), 0, 0); }
87 ConstPixelIterator end()
const
88 {
return ConstPixelIterator(view(), 0, height()); }
108 return _view.format();
118 Pt::ssize_t width()
const
120 return _view.
width();
123 Pt::ssize_t height()
const
125 return _view.height();
128 Pt::ssize_t padding()
const
130 return _view.padding();
145 return _view.empty();
149 std::vector<Pt::uint8_t> _buffer;
T width() const
Returns the width.
Definition: Size.h:65
ImageView & view()
Returns a view on the image data.
Definition: Image.h:99
View on image data.
Definition: ImageView.h:192
Pixel in an image.
Definition: ImageView.h:48
const Size & size() const
Returns the size of the image.
Definition: Image.h:113
const ImageFormat & format() const
Returns the format of the image.
Definition: Image.h:106
Const pixel in an image.
Definition: ImageView.h:135
uint_type uint8_t
Unsigned 8-bit integer type.
Definition: Types.h:18
const ImageView & view() const
Returns a view on the image data.
Definition: Image.h:92
Generic image.
Definition: Image.h:43