63 void operator=(
const CImage &other) {}
107 bool Load(
const std::string &fileName);
110 bool SavePNG(
const std::string &fileName);
123 void BlitToNewRGBASurface(
int width,
int height);
void PadToNearestPowerOfTwo()
Pads the image to nearest power of 2 dimensions.
Definition: image.cpp:215
void SetPixelInt(Math::IntPoint pixel, Gfx::IntColor color)
Sets the precise color at given pixel.
Definition: image.cpp:317
Gfx::IntColor GetPixelInt(Math::IntPoint pixel)
Returns the precise color at given pixel.
Definition: image.cpp:257
Color with integer values.
Definition: color.h:100
void flipVertically()
Flips the image vertically.
Definition: image.cpp:447
void ConvertToRGBA()
Convert the image to RGBA surface.
Definition: image.cpp:228
void Fill(Gfx::IntColor color)
Fills the whole image with given color.
Definition: image.cpp:201
void Free()
Frees the allocated image data.
Definition: image.cpp:173
bool IsEmpty() const
Returns whether the image is empty (has null data)
Definition: image.cpp:168
Gfx::Color GetPixel(Math::IntPoint pixel)
Returns the color at given pixel.
Definition: image.cpp:305
void SetDataPixels(void *pixels)
sets/replaces the pixels from the surface
Definition: image.cpp:434
SDL_Surface * surface
SDL surface with image data.
Definition: image.h:45
Math::IntPoint GetSize() const
Returns the image size.
Definition: image.cpp:192
Color structs and related functions.
bool Load(const std::string &fileName)
Loads an image from the specified file.
Definition: image.cpp:379
Image loaded from file.
Definition: image.h:57
Implementation-specific image data.
Definition: image.h:42
ImageData * GetData()
Returns the image data; if empty - returns nullptr.
Definition: image.cpp:187
bool SavePNG(const std::string &fileName)
Saves the image to the specified file in PNG format.
Definition: image.cpp:415
void SetPixel(Math::IntPoint pixel, Gfx::Color color)
Sets the color at given pixel.
Definition: image.cpp:369
CImage()
Constructs empty image (with NULL data)
Definition: image.cpp:151
2D Point with integer coords
Definition: intpoint.h:38
RGBA color.
Definition: color.h:38
std::string GetError()
Returns the last error.
Definition: image.cpp:374
virtual ~CImage()
Destroys image, calling Free()
Definition: image.cpp:163