rgba_buffer Class Reference

#include <texture.hpp>

Collaboration diagram for rgba_buffer:

Collaboration graph
[legend]

List of all members.


Detailed Description

Encapsulates a 32-bit RGBA buffer (possibly memory-mapped).

Definition at line 55 of file texture.hpp.


Public Member Functions

void clear (const color &c)
int get_height () const
unsigned char * get_pointer ()
int get_width () const
 rgba_buffer (int width, int height, const color &c=color::WHITE)
 Creates a blank buffer in memory.
 rgba_buffer (SDL_Surface *surface)
 Creates a buffer from an SDL surface.
 rgba_buffer (const gsgl::string &fname)
 Creates a memory-mapped buffer from an existing file.
void save (const gsgl::string &fname)
 Saves to a file to be memory-mapped.
 ~rgba_buffer ()

Private Member Functions

void flip_vertical ()

Private Attributes

unsigned char * buffer
int height
mapped_filemf
int width

Constructor & Destructor Documentation

rgba_buffer ( const gsgl::string fname  ) 

rgba_buffer ( SDL_Surface *  surface  ) 

Creates a buffer from an SDL surface.

Definition at line 78 of file texture.cpp.

References rgba_buffer::buffer, and rgba_buffer::flip_vertical().

rgba_buffer ( int  width,
int  height,
const color c = color::WHITE 
)

Creates a blank buffer in memory.

Definition at line 132 of file texture.cpp.

References rgba_buffer::buffer, and rgba_buffer::clear().

~rgba_buffer (  ) 

Definition at line 141 of file texture.cpp.

References rgba_buffer::buffer, and rgba_buffer::mf.


Member Function Documentation

void clear ( const color c  ) 

void flip_vertical (  )  [private]

Definition at line 187 of file texture.cpp.

References rgba_buffer::buffer, rgba_buffer::height, and rgba_buffer::width.

Referenced by rgba_buffer::rgba_buffer().

int get_height (  )  const [inline]

Definition at line 69 of file texture.hpp.

Referenced by texture_impl::bind(), and texture_impl::update().

unsigned char* get_pointer (  )  [inline]

Definition at line 70 of file texture.hpp.

Referenced by texture_impl::bind(), and texture_impl::update().

int get_width (  )  const [inline]

Definition at line 68 of file texture.hpp.

Referenced by texture_impl::bind(), and texture_impl::update().

void save ( const gsgl::string fname  ) 

Saves to a file to be memory-mapped.

Definition at line 154 of file texture.cpp.

References rgba_buffer::buffer, gsgl::io::FILE_OPEN_BINARY, gsgl::io::FILE_OPEN_WRITE, rgba_buffer::height, rgba_buffer::width, and fd_stream::write().


Member Data Documentation

unsigned char* buffer [private]

int height [private]

mapped_file* mf [private]

Definition at line 60 of file texture.hpp.

Referenced by rgba_buffer::rgba_buffer(), and rgba_buffer::~rgba_buffer().

int width [private]


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

Generated on Sat Mar 1 13:50:07 2008 for Periapsis Project by  doxygen 1.5.5