Go to the documentation of this file.
37 void savePNG(
const std::string& fileName);
42 void resize(
const Size& size) { m_size = size; m_pixels.resize(size.
area() * m_bpp, 0); }
45 void setPixel(
int x,
int y,
uint8 *pixel) { memcpy(&m_pixels[(y * m_size.
width() + x) * m_bpp], pixel, m_bpp);}
48 std::vector<uint8>&
getPixels() {
return m_pixels; }
58 std::vector<uint8> m_pixels;
static ImagePtr load(std::string file)
void blit(const Point &dest, const ImagePtr &other)
std::vector< uint8 > & getPixels()
void paste(const ImagePtr &other)
void setPixel(int x, int y, uint8 *pixel)
void resize(const Size &size)
uint8 * getPixel(int x, int y)
void overwriteMask(const Color &maskedColor, const Color &insideColor=Color::white, const Color &outsideColor=Color::alpha)
static ImagePtr loadPNG(const std::string &file)
void setPixel(int x, int y, const Color &color)
Image(const Size &size, int bpp=4, uint8 *pixels=nullptr)
void savePNG(const std::string &fileName)