5#ifndef INCLUDE_FIFECHAN_BACKENDS_SDL_SDLIMAGE_HPP_
6#define INCLUDE_FIFECHAN_BACKENDS_SDL_SDLIMAGE_HPP_
12#include "fifechan/platform.hpp"
18#include "fifechan/color.hpp"
19#include "fifechan/image.hpp"
42 Image(SDL_Surface* surface,
bool autoFree, SDL_Renderer* renderer =
nullptr);
Abstract holder for image data.
void convertToDisplayFormat() override
Converts the image, if possible, to display format.
Color getPixel(int x, int y) override
Gets the color of a pixel at coordinate (x, y) in the image.
virtual SDL_Surface * getSurface() const
Gets the SDL surface for the image.
Image(SDL_Surface *surface, bool autoFree, SDL_Renderer *renderer=nullptr)
Constructor.
int getWidth() const override
Gets the width of the image.
SDL_Texture * mTexture
SDL texture for accelerated rendering (primary storage).
int getHeight() const override
Gets the height of the image.
bool mAutoFree
Whether the transient surface should be freed on destruction.
SDL_Surface * mTransientSurface
Transient surface for pixel operations (getPixel/putPixel).
void putPixel(int x, int y, Color const &color) override
Puts a pixel with a certain color at coordinate (x, y).
void free() override
Frees an image.
virtual SDL_Texture * getTexture() const
Gets the SDL texture for the image.
SDL_Renderer * mRenderer
SDL renderer associated with the texture.