5#ifndef INCLUDE_FIFECHAN_BACKENDS_SDL_SDLIMAGE_HPP_
6#define INCLUDE_FIFECHAN_BACKENDS_SDL_SDLIMAGE_HPP_
12#include "fifechan/color.hpp"
13#include "fifechan/image.hpp"
14#include "fifechan/platform.hpp"
36 Image(SDL_Surface* surface,
bool autoFree, SDL_Renderer* renderer =
nullptr);
Abstract holder for image data.
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).
Image(SDL_Surface *surface, bool autoFree, SDL_Renderer *renderer=nullptr)
Constructor.
virtual SDL_Texture * getTexture() const
Gets the SDL texture for the image.
bool mAutoFree
Whether the transient surface should be freed on destruction.
int getWidth() const override
Gets the width of the image.
void free() override
Frees an image.
SDL_Texture * mTexture
SDL texture for accelerated rendering (primary storage).
void convertToDisplayFormat() override
Converts the image, if possible, to display format.
int getHeight() const override
Gets the height of the image.
virtual SDL_Surface * getSurface() const
Gets the SDL surface for the image.
Color getPixel(int x, int y) override
Gets the color of a pixel at coordinate (x, y) in the image.
SDL_Renderer * mRenderer
SDL renderer associated with the texture.
Unified header for the SDL backend.