iso::img::Buffer< Type > Class Template Reference

#include <iso_img_buffer.h>

Collaboration diagram for iso::img::Buffer< Type >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Buffer ()
 default constructor
 Buffer (const math::Vector2< unsigned int > &pSize, unsigned int pChannelCount)
 create buffer
 Buffer (const Buffer &pBuffer)
 copy constructor
virtual ~Buffer ()
 destructor
unsigned int width () const
 return buffer width
unsigned int height () const
 return buffer height
const math::Vector2< unsigned
int > & 
size () const
 return buffer size
unsigned int channelCount () const
 returns number of channels
Type * data ()
 return buffer values
const Type * data () const
 return buffer values
Type * data (unsigned int pChannel) throw (ImgException)
 return single channel data
Type data (const math::Vector2< unsigned int > &pPos, int pChannel) throw (ImgException)
 return single buffer value
void setChannel (unsigned int pChannel, Type pValue) throw (ImgException)
 set all values within a channel to the same value
virtual void setSize (const math::Vector2< unsigned int > &pSize, unsigned int pChannelCount)
 change buffer size
virtual void setSize (const math::Vector2< unsigned int > &pSize)
 change number of frames
virtual void setChannelCount (unsigned int pChannelCount)
 change number of channels
virtual const Bufferoperator= (const Buffer &pBuffer) throw (ImgException)
 assignment operator
virtual Type operator= (Type pValue)
 set content of buffer to one value
virtual bool operator== (const Buffer &pBuffer) const
 comparison operator
virtual const Bufferoperator+= (Type pValue)
 += operator
virtual const Bufferoperator *= (Type pValue)
 *= operator
virtual const Bufferoperator+= (const Buffer &pBuffer) throw (ImgException)
 += operator
virtual const Bufferoperator *= (const Buffer &pBuffer) throw (ImgException)
 *= operator
virtual base::String info () const
 obtain textual buffer information

Protected Member Functions

virtual void setDim (unsigned int p_dim)
 set dimension of vector

Protected Attributes

math::Vector2< unsigned int > mSize
 buffer size
unsigned int mChannelCount
 channel count
unsigned int & mCount
 total data count
Type * mData
 buffer data

Static Protected Attributes

static math::Vector2< unsigned
int > 
sSize
 default buffer size
static unsigned int sChannelCount
 default channel count

Friends

std::ostream & operator<< (std::ostream &pOstream, const Buffer &pBuffer)
 print buffer information

template<class Type>
class iso::img::Buffer< Type >


Constructor & Destructor Documentation

template<class Type>
iso::img::Buffer< Type >::Buffer (  ) 

default constructor

template<class Type>
iso::img::Buffer< Type >::Buffer ( const math::Vector2< unsigned int > &  pSize,
unsigned int  pChannelCount 
)

create buffer

Parameters:
pSize size of buffer
pChannelCount number of channels

template<class Type>
iso::img::Buffer< Type >::Buffer ( const Buffer< Type > &  pBuffer  ) 

copy constructor

Parameters:
pBuffer buffer

template<class Type>
iso::img::Buffer< Type >::~Buffer (  )  [virtual]

destructor


Member Function Documentation

template<class Type>
unsigned int iso::img::Buffer< Type >::width (  )  const

return buffer width

Returns:
buffer width

template<class Type>
unsigned int iso::img::Buffer< Type >::height (  )  const

return buffer height

template<class Type>
const math::Vector2< unsigned int > & iso::img::Buffer< Type >::size (  )  const

return buffer size

Returns:
buffer size

template<class Type>
unsigned int iso::img::Buffer< Type >::channelCount (  )  const

returns number of channels

Returns:
number of channels

template<class Type>
Type * iso::img::Buffer< Type >::data (  ) 

return buffer values

Returns:
buffer values

template<class Type>
const Type * iso::img::Buffer< Type >::data (  )  const

return buffer values

Returns:
buffer values

template<class Type>
Type * iso::img::Buffer< Type >::data ( unsigned int  pChannel  )  throw (ImgException)

return single channel data

Parameters:
pChannel channel index
Exceptions:
ImgException channel index out of bounds

template<class Type>
Type iso::img::Buffer< Type >::data ( const math::Vector2< unsigned int > &  pPos,
int  pChannel 
) throw (ImgException)

return single buffer value

Parameters:
pPos pixel position
pChannel channel index
Exceptions:
ImgException pixel position or channel index out of bouhnds

template<class Type>
void iso::img::Buffer< Type >::setChannel ( unsigned int  pChannel,
Type  pValue 
) throw (ImgException)

set all values within a channel to the same value

Parameters:
pChannel channel
pValue value
Exceptions:
ImgException channel out of bounds

template<class Type>
void iso::img::Buffer< Type >::setSize ( const math::Vector2< unsigned int > &  pSize,
unsigned int  pChannelCount 
) [virtual]

change buffer size

Parameters:
pSize new buffer size
pChannelCount new channel count

template<class Type>
void iso::img::Buffer< Type >::setSize ( const math::Vector2< unsigned int > &  pSize  )  [virtual]

change number of frames

Parameters:
pSize new buffer size

template<class Type>
void iso::img::Buffer< Type >::setChannelCount ( unsigned int  pChannelCount  )  [virtual]

change number of channels

Parameters:
pChannelCount new channelCount

template<class Type>
const Buffer< Type > & iso::img::Buffer< Type >::operator= ( const Buffer< Type > &  pBuffer  )  throw (ImgException) [virtual]

assignment operator

Parameters:
pBuffer buffer to copy properties from
Returns:
buffer
Exceptions:
ImgException size or channelCount doesn't match

template<class Type>
Type iso::img::Buffer< Type >::operator= ( Type  pValue  )  [virtual]

set content of buffer to one value

Parameters:
pValue value to fill the buffer with

template<class Type>
bool iso::img::Buffer< Type >::operator== ( const Buffer< Type > &  pBuffer  )  const [virtual]

comparison operator

Parameters:
pBuffer buffer to which the comparison is made to
Returns:
true, if ChannelCount and FrameCount of both buffers are identical, otherwise false

template<class Type>
const Buffer< Type > & iso::img::Buffer< Type >::operator+= ( Type  pValue  )  [virtual]

+= operator

Parameters:
pValue value to be added
Returns:
resulting buffer

template<class Type>
const Buffer< Type > & iso::img::Buffer< Type >::operator *= ( Type  pValue  )  [virtual]

*= operator

Parameters:
pValue value to be multiplied
Returns:
resulting buffer

template<class Type>
const Buffer< Type > & iso::img::Buffer< Type >::operator+= ( const Buffer< Type > &  pBuffer  )  throw (ImgException) [virtual]

+= operator

Parameters:
pBuffer buffer to be added
Returns:
resulting buffer
Exceptions:
ImgException buffers don't possess same dimensions

template<class Type>
const Buffer< Type > & iso::img::Buffer< Type >::operator *= ( const Buffer< Type > &  pBuffer  )  throw (ImgException) [virtual]

*= operator

Parameters:
pBuffer buffer to be multiplied
Returns:
resulting buffer
Exceptions:
ImgException buffers don't possess same dimensions

template<class Type>
base::String iso::img::Buffer< Type >::info (  )  const [virtual]

obtain textual buffer information

Returns:
String containing buffer information

template<class Type>
void iso::img::Buffer< Type >::setDim ( unsigned int  p_dim  )  [protected, virtual]

set dimension of vector

Parameters:
p_dim new vector dimension
original values are preserved as far as possible. when vector dimension increases, new elements contain zero when vector dimension decreases, previous values at positions that are beyond new dimension


Friends And Related Function Documentation

template<class Type>
std::ostream& operator<< ( std::ostream &  pOstream,
const Buffer< Type > &  pBuffer 
) [friend]

print buffer information


Member Data Documentation

template<class Type>
math::Vector2< unsigned int > iso::img::Buffer< Type >::sSize [static, protected]

default buffer size

template<class Type>
unsigned int iso::img::Buffer< Type >::sChannelCount [static, protected]

default channel count

template<class Type>
math::Vector2<unsigned int> iso::img::Buffer< Type >::mSize [protected]

buffer size

template<class Type>
unsigned int iso::img::Buffer< Type >::mChannelCount [protected]

channel count

template<class Type>
unsigned int& iso::img::Buffer< Type >::mCount [protected]

total data count

template<class Type>
Type* iso::img::Buffer< Type >::mData [protected]

buffer data


The documentation for this class was generated from the following file:
Generated on Thu Jul 8 12:45:56 2010 for iso_img by  doxygen 1.5.1