|
ShishGL
1.0
A simple modular cross-platform graphics library
|
|
Go to the documentation of this file.
2 #ifndef SHISHGL_IMAGE_HPP
3 #define SHISHGL_IMAGE_HPP
33 pixels.assign(
size().x *
size().y, color);
37 pixels[pos.
y * img_size.
x + pos.
x] = color;
47 return reinterpret_cast<const uint8_t*
>(pixels.data());
52 return pixels[y * img_size.
x + x];
63 context->
update(pixels.data());
70 std::vector<Color> pixels;
76 #endif //SHISHGL_IMAGE_HPP
Image(const Vector2< size_t > &size, const Color &color=Color::WHITE)
Definition: Image.hpp:25
std::vector< Color > Pixels
Definition: Image.hpp:23
T x
Definition: Vector2.hpp:10
const Vector2< size_t > & size() const
Definition: Image.hpp:56
T y
Definition: Vector2.hpp:10
void paste(IPlatform::IContext *context)
Definition: Image.hpp:62
static const Color WHITE
Definition: Color.hpp:97
Definition: CoreApplication.hpp:10
Color getPixel(size_t x, size_t y) const
Definition: Image.hpp:51
const Color * getPixels() const
Definition: Image.hpp:41
const uint8_t * getData() const
Definition: Image.hpp:46
void blend(const Image &other)
Definition: Image.cpp:9
Definition: IPlatform.hpp:32
void setPixel(const Vector2< size_t > &pos, const Color &color)
Definition: Image.hpp:36
virtual void update(const Color *data)=0
void fill(const Color &color)
Definition: Image.hpp:32