libtmx  0.4.0
an C++11 library for reading TMX files
Public Member Functions | List of all members
tmx::Image Class Reference

An image is an image file on the system. More...

#include <tmx/Image.h>

Public Member Functions

 Image (const std::string &format, const boost::filesystem::path &source, const std::string &trans, unsigned width, unsigned height)
 Image constructor. More...
 
const std::string & getFormat () const noexcept
 Get the format of the file (if provided). More...
 
const boost::filesystem::path & getSource () const noexcept
 Get the path to the image file. More...
 
const std::string getTransparent () const noexcept
 Get the transparent color (if provided) More...
 
unsigned getWidth () const noexcept
 Get the width of the image (if provided) More...
 
unsigned getHeight () const noexcept
 Get the height of the image (if provided) More...
 
bool hasSize () const noexcept
 Tell whether the width and height are set. More...
 
Size getSize () const noexcept
 Get the declared size of the image. More...
 

Detailed Description

An image is an image file on the system.

Constructor & Destructor Documentation

tmx::Image::Image ( const std::string &  format,
const boost::filesystem::path &  source,
const std::string &  trans,
unsigned  width,
unsigned  height 
)
inline

Image constructor.

Member Function Documentation

const std::string& tmx::Image::getFormat ( ) const
inlinenoexcept

Get the format of the file (if provided).

Returns
the format of the file or empty string.
unsigned tmx::Image::getHeight ( ) const
inlinenoexcept

Get the height of the image (if provided)

Returns
the height of the image
Size tmx::Image::getSize ( ) const
inlinenoexcept

Get the declared size of the image.

Returns
the size of the image.
const boost::filesystem::path& tmx::Image::getSource ( ) const
inlinenoexcept

Get the path to the image file.

Returns
the path to the image file
const std::string tmx::Image::getTransparent ( ) const
inlinenoexcept

Get the transparent color (if provided)

Returns
the transparent color
unsigned tmx::Image::getWidth ( ) const
inlinenoexcept

Get the width of the image (if provided)

Returns
the width of the image
bool tmx::Image::hasSize ( ) const
inlinenoexcept

Tell whether the width and height are set.

Returns
true if the image has a declared size