Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SubImage Class Reference

A clipped version of a larger image. More...

#include <image.h>

Inheritance diagram for SubImage:
Image Resource

Public Member Functions

 SubImage (Image *parent, SDL_Texture *texture, int x, int y, int width, int height)
 
 ~SubImage () override
 
- Public Member Functions inherited from Image
 ~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.
 
ImagegetSubImage (int x, int y, int width, int height)
 Creates a new image with the desired clipping rectangle.
 
- Public Member Functions inherited from Resource
 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.
 

Private Attributes

ResourceRef< ImagemParent
 

Additional Inherited Members

- Public Types inherited from Resource
enum  OrphanPolicy { DeleteLater , DeleteImmediately }
 
- Static Public Member Functions inherited from Image
static Resourceload (SDL_RWops *rw)
 Loads an image from an SDL_RWops structure.
 
static Resourceload (SDL_RWops *rw, const Dye &dye)
 Loads an image from an SDL_RWops structure and recolors it.
 
static Imageload (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)
 
- Protected Member Functions inherited from Image
 Image (SDL_Texture *texture, int width, int height)
 SDL Constructor.
 
- Protected Member Functions inherited from Resource
virtual ~Resource ()=default
 
- Static Protected Member Functions inherited from Image
static Image_SDLload (SDL_Surface *tmpImage)
 SDL_Surface to SDL_Texture Image loader.
 
- Protected Attributes inherited from Image
SDL_Rect mBounds
 
float mAlpha = 1.0f
 
SDL_Texture * mTexture = nullptr
 
- Static Protected Attributes inherited from Image
static bool mDisableTransparency = false
 Stores whether the transparency is disabled.
 
static SDL_Renderer * mRenderer
 

Detailed Description

A clipped version of a larger image.

Definition at line 203 of file image.h.

Constructor & Destructor Documentation

◆ SubImage()

SubImage::SubImage ( Image parent,
SDL_Texture *  texture,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 353 of file image.cpp.

◆ ~SubImage()

SubImage::~SubImage ( )
override

Definition at line 380 of file image.cpp.

Member Data Documentation

◆ mParent

ResourceRef<Image> SubImage::mParent
private

Definition at line 216 of file image.h.


The documentation for this class was generated from the following files: