24 #ifndef RESOURCES_IMAGE_H
25 #define RESOURCES_IMAGE_H
39 #define GL_GLEXT_PROTOTYPES 1
45 PRAGMA48(GCC diagnostic ignored
"-Wshadow")
48 PRAGMA45(GCC diagnostic ignored
"-Wredundant-decls")
49 #include <SDL_opengl.h>
54 PRAGMA45(GCC diagnostic ignored
"-Wredundant-decls")
62 PRAGMA48(GCC diagnostic ignored
"-Wshadow")
64 #include <SDL_render.h>
66 #include <SDL_video.h>
84 friend class SDL2SoftwareGraphics;
85 friend class SDL2SoftwareImageHelper;
96 friend class SafeOpenGLGraphics;
105 Image(
const int width,
131 {
return mBounds.w; }
137 {
return mBounds.h; }
148 virtual void setAlpha(
const float alpha);
171 Image* SDLgetScaledImage(
const int width,
178 {
return mAlphaChannel; }
180 void SDLCleanCache();
182 void SDLTerminateAlphaCache();
186 {
return mTexWidth; }
189 {
return mTexHeight; }
194 void decRef()
override;
202 {
return mHasAlphaChannel; }
205 {
return mIsAlphaVisible; }
207 void setAlphaVisible(
const bool b)
208 { mIsAlphaVisible = b; }
211 {
return mIsAlphaCalculated; }
213 void setAlphaCalculated(
const bool b)
noexcept2
214 { mIsAlphaCalculated = b; }
217 {
return mSDLSurface; }
235 const bool hasAlphaChannel,
236 uint8_t *
restrict const alphaChannel);
240 const int width,
const int height);
245 SDL_Surface *mSDLSurface;
247 SDL_Texture *mTexture;
251 uint8_t *mAlphaChannel;
253 std::map<float, SDL_Surface*> mAlphaCache;
256 bool mHasAlphaChannel;
258 bool mIsAlphaVisible;
259 bool mIsAlphaCalculated;
268 Image(
const GLuint glimage,
const int width,
const int height,
269 const int texWidth,
const int texHeight);
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wredundant-decls") PRAGMA45(GCC diagnostic pop) class TestMain
#define A_DELETE_COPY(func)
Image * getSubImage(Image *const parent, const int x, const int y, const int width, const int height)
#define SurfaceImageHelper