Classes | Public Member Functions | Friends

a5::Atlas Class Reference
[Atlas]

Texture atlas. More...

#include <Atlas.hpp>

List of all members.

Classes

class  Not_Child
 Thrown when trying to free a bitmap that isn't a child of the atlas. More...
class  Too_Big
 Thrown when trying to allocate a too-large section of the atlas. More...

Public Member Functions

 Atlas (int width_, int height_, int x_res_=16, int y_res_=16)
 Creates a texture atlas with the specified dimensions and resolution.
void NewPage ()
 Creates a new page on the atlas.
std::auto_ptr< BitmapAdd (Bitmap &bitmap)
 Allocates room for and copies an existing bitmap in to the atlas.
std::auto_ptr< BitmapAlloc (int width, int height)
 Allocates an image to the atlas with the specified width/height.
int Pages () const
 Returns the number of pages in the atlas.
a5::BitmapGetPage (int page) const
 Returns the atlas bitmap for the given page.
void Clear (bool delete_pages=false)
 Frees all of the allocated bitmaps in the atlas.
 ~Atlas ()
 Destroys all of the atlas pages and references.

Friends

class a5::Atlas_Bitmap

Detailed Description

Texture atlas.


Constructor & Destructor Documentation

a5::Atlas::Atlas ( int  width_,
int  height_,
int  x_res_ = 16,
int  y_res_ = 16 
)

Creates a texture atlas with the specified dimensions and resolution.

a5::Atlas::~Atlas (  ) 

Destroys all of the atlas pages and references.


Member Function Documentation

void a5::Atlas::NewPage (  ) 

Creates a new page on the atlas.

std::auto_ptr< Bitmap > a5::Atlas::Add ( Bitmap bitmap  ) 

Allocates room for and copies an existing bitmap in to the atlas.

Exceptions:
Atlas::Too_Big 
std::auto_ptr< Bitmap > a5::Atlas::Alloc ( int  width,
int  height 
)

Allocates an image to the atlas with the specified width/height.

Exceptions:
Atlas::Not_Child 
int a5::Atlas::Pages (  )  const

Returns the number of pages in the atlas.

a5::Bitmap& a5::Atlas::GetPage ( int  page  )  const

Returns the atlas bitmap for the given page.

Exceptions:
std::out_of_range 
void a5::Atlas::Clear ( bool  delete_pages = false  ) 

Frees all of the allocated bitmaps in the atlas.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines