14 static std::vector<std::string> paths;
23 EXPORT
static void add_path(std::string path);
50 EXPORT Image(std::string filename);
57 EXPORT Image(
unsigned int width,
77 EXPORT
bool load(
const std::string& filename);
98 EXPORT
bool save(
const std::string& filename);
108 EXPORT
static TTF_Font *open_font_file(
const std::string& font_file,
115 EXPORT
static void close_font_file(TTF_Font *font_file);
130 EXPORT
bool create_text(
const std::string& text,
132 Uint8 r, Uint8 g, Uint8 b, Uint8 a);
144 EXPORT
bool create_text(
const std::string& text,
145 const std::string& font_file,
147 Uint8 r, Uint8 g, Uint8 b, Uint8 a);
156 EXPORT
bool copy_from(
const Image& src,
int x,
int y);
162 EXPORT
bool copy_from(
const Image& src, SDL_Rect& dst_rect);
169 EXPORT
bool copy_from(
const Image& src, SDL_Rect& dst_rect,
170 const SDL_Rect& src_rect);
189 EXPORT
void set_color_key(
int r,
int g,
int b,
bool enable =
true);
void * data
The pixel data.
bool save(const std::string &filename)
Saves the image as a file.
bool copy_from(const Image &src, int x, int y)
Copies an image into the current image.
unsigned int height
The width of the image surface.
bool create_empty(unsigned int width, unsigned int height)
Creates an empty image.
SDL_Surface * image
The image surface.
void set_color_key(int r, int g, int b, bool enable=true)
Sets a color to be transparent.
static void add_path(std::string path)
Adds a path to the list of paths to be searched for image files.
void vertical_flip()
Flips the image along its x-axis.
bool load(const std::string &filename)
Loads a new image file.
void horizontal_flip()
Flips the image along its y-axis.
unsigned int bytes_per_pixel
The number of bytes that make up a single pixel.
unsigned int width
The width of the image surface.