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

Stores a set of subimages originating from a single image. More...

#include <imageset.h>

Inheritance diagram for ImageSet:
Resource Tileset

Public Member Functions

 ImageSet (Image *img, int w, int h, int margin=0, int spacing=0)
 Cuts the passed image in a grid of sub images.
 
 ImageSet (const ImageSet &)=delete
 
ImageSetoperator= (const ImageSet &)=delete
 
 ~ImageSet () override
 
int getWidth () const
 Returns the width of the images in the image set.
 
int getHeight () const
 Returns the height of the images in the image set.
 
Imageget (size_t i) const
 
size_t size () const
 
int getOffsetX () const
 
void setOffsetX (int n)
 
int getOffsetY () const
 
void setOffsetY (int n)
 
- 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

std::vector< Image * > mImages
 
int mWidth
 Width of the images in the image set.
 
int mHeight
 Height of the images in the image set.
 
int mOffsetX = 0
 
int mOffsetY = 0
 

Additional Inherited Members

- Public Types inherited from Resource
enum  OrphanPolicy { DeleteLater , DeleteImmediately }
 
- Protected Member Functions inherited from Resource
virtual ~Resource ()=default
 

Detailed Description

Stores a set of subimages originating from a single image.

Definition at line 33 of file imageset.h.

Constructor & Destructor Documentation

◆ ImageSet() [1/2]

ImageSet::ImageSet ( Image img,
int  w,
int  h,
int  margin = 0,
int  spacing = 0 
)

Cuts the passed image in a grid of sub images.

Definition at line 30 of file imageset.cpp.

◆ ImageSet() [2/2]

ImageSet::ImageSet ( const ImageSet )
delete

◆ ~ImageSet()

ImageSet::~ImageSet ( )
override

Definition at line 44 of file imageset.cpp.

Member Function Documentation

◆ get()

Image * ImageSet::get ( size_t  i) const

Definition at line 49 of file imageset.cpp.

◆ getHeight()

int ImageSet::getHeight ( ) const
inline

Returns the height of the images in the image set.

Definition at line 54 of file imageset.h.

◆ getOffsetX()

int ImageSet::getOffsetX ( ) const
inline

Definition at line 60 of file imageset.h.

◆ getOffsetY()

int ImageSet::getOffsetY ( ) const
inline

Definition at line 66 of file imageset.h.

◆ getWidth()

int ImageSet::getWidth ( ) const
inline

Returns the width of the images in the image set.

Definition at line 49 of file imageset.h.

◆ operator=()

ImageSet & ImageSet::operator= ( const ImageSet )
delete

◆ setOffsetX()

void ImageSet::setOffsetX ( int  n)
inline

Definition at line 63 of file imageset.h.

◆ setOffsetY()

void ImageSet::setOffsetY ( int  n)
inline

Definition at line 69 of file imageset.h.

◆ size()

size_t ImageSet::size ( ) const
inline

Definition at line 58 of file imageset.h.

Member Data Documentation

◆ mHeight

int ImageSet::mHeight
private

Height of the images in the image set.

Definition at line 76 of file imageset.h.

◆ mImages

std::vector<Image*> ImageSet::mImages
private

Definition at line 73 of file imageset.h.

◆ mOffsetX

int ImageSet::mOffsetX = 0
private

Definition at line 77 of file imageset.h.

◆ mOffsetY

int ImageSet::mOffsetY = 0
private

Definition at line 78 of file imageset.h.

◆ mWidth

int ImageSet::mWidth
private

Width of the images in the image set.

Definition at line 75 of file imageset.h.


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