Defines a class for loading and storing images.
More...
#include <image.h>
|
| ~Image () override |
|
int | getWidth () const |
| Returns the width of the image.
|
|
int | getHeight () const |
| Returns the height of the image.
|
|
void | setAlpha (float alpha) |
| Sets the alpha value of this image.
|
|
float | getAlpha () const |
| Returns the alpha value of this image.
|
|
Image * | getSubImage (int x, int y, int width, int height) |
| Creates a new image with the desired clipping rectangle.
|
|
| Resource ()=default |
|
void | incRef () |
| Increments the internal reference count.
|
|
void | decRef (OrphanPolicy orphanPolicy=DeleteLater) |
| Decrements the reference count.
|
|
const std::string & | getIdPath () const |
| Return the path identifying this resource.
|
|
|
static Resource * | load (SDL_RWops *rw) |
| Loads an image from an SDL_RWops structure.
|
|
static Resource * | load (SDL_RWops *rw, const Dye &dye) |
| Loads an image from an SDL_RWops structure and recolors it.
|
|
static Image * | load (SDL_Surface *) |
| Loads an image from an SDL surface.
|
|
static bool | useOpenGL () |
| Tells if the system is using OpenGL or SDL.
|
|
static void | SDLdisableTransparency () |
| Disable the transparency handling (for low CPUs in SDL Mode)
|
|
static bool | SDLisTransparencyDisabled () |
|
static void | setRenderer (SDL_Renderer *renderer) |
|
|
| Image (SDL_Texture *texture, int width, int height) |
| SDL Constructor.
|
|
virtual | ~Resource ()=default |
|
Defines a class for loading and storing images.
Definition at line 44 of file image.h.
◆ ~Image()
◆ Image()
Image::Image |
( |
SDL_Texture * |
texture, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
protected |
SDL Constructor.
Definition at line 49 of file image.cpp.
◆ _SDLload()
Image * Image::_SDLload |
( |
SDL_Surface * |
tmpImage | ) |
|
|
staticprotected |
◆ getAlpha()
float Image::getAlpha |
( |
| ) |
const |
|
inline |
Returns the alpha value of this image.
Definition at line 106 of file image.h.
◆ getHeight()
int Image::getHeight |
( |
| ) |
const |
|
inline |
Returns the height of the image.
Definition at line 89 of file image.h.
◆ getSubImage()
Image * Image::getSubImage |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Creates a new image with the desired clipping rectangle.
- Returns
NULL
if creation failed and a valid object otherwise.
Definition at line 331 of file image.cpp.
◆ getWidth()
int Image::getWidth |
( |
| ) |
const |
|
inline |
Returns the width of the image.
Definition at line 83 of file image.h.
◆ load() [1/3]
Resource * Image::load |
( |
SDL_RWops * |
rw | ) |
|
|
static |
Loads an image from an SDL_RWops structure.
- Parameters
-
rw | The SDL_RWops to load the image from. |
- Returns
NULL
if an error occurred, a valid pointer otherwise.
Definition at line 98 of file image.cpp.
◆ load() [2/3]
Resource * Image::load |
( |
SDL_RWops * |
rw, |
|
|
const Dye & |
dye |
|
) |
| |
|
static |
Loads an image from an SDL_RWops structure and recolors it.
- Parameters
-
rw | The SDL_RWops to load the image from. |
dye | The dye used to recolor the image. |
- Returns
NULL
if an error occurred, a valid pointer otherwise.
Definition at line 114 of file image.cpp.
◆ load() [3/3]
Image * Image::load |
( |
SDL_Surface * |
tmpImage | ) |
|
|
static |
Loads an image from an SDL surface.
Definition at line 158 of file image.cpp.
◆ SDLdisableTransparency()
static void Image::SDLdisableTransparency |
( |
| ) |
|
|
inlinestatic |
Disable the transparency handling (for low CPUs in SDL Mode)
Definition at line 122 of file image.h.
◆ SDLisTransparencyDisabled()
static bool Image::SDLisTransparencyDisabled |
( |
| ) |
|
|
inlinestatic |
◆ setAlpha()
void Image::setAlpha |
( |
float |
alpha | ) |
|
Sets the alpha value of this image.
Definition at line 176 of file image.cpp.
◆ setRenderer()
void Image::setRenderer |
( |
SDL_Renderer * |
renderer | ) |
|
|
static |
◆ useOpenGL()
bool Image::useOpenGL |
( |
| ) |
|
|
static |
Tells if the system is using OpenGL or SDL.
- Returns
- true if OpenGL, false if SDL.
Definition at line 167 of file image.cpp.
◆ SDLGraphics
◆ mAlpha
float Image::mAlpha = 1.0f |
|
protected |
◆ mBounds
◆ mDisableTransparency
bool Image::mDisableTransparency = false |
|
staticprotected |
Stores whether the transparency is disabled.
Definition at line 169 of file image.h.
◆ mRenderer
SDL_Renderer * Image::mRenderer |
|
staticprotected |
◆ mTexture
SDL_Texture* Image::mTexture = nullptr |
|
protected |
The documentation for this class was generated from the following files: