ContRap-Libraries
Data Structures | Public Member Functions | Protected Attributes

crp::Image< T > Class Template Reference

Class Image encapsulates (two-dimensional) images. More...

#include <image.h>

Inheritance diagram for crp::Image< T >:
crp::Array< T > Object

Data Structures

class  LineIterator
 Class LineIterator iterates over a line. More...
class  PrimitiveIterator
 PrimitiveIterator iterates over the pixels of a primitive. More...
class  RectIterator
 Class RectIterator iterates over a rectangle. More...

Public Member Functions

 Image (int width=0, int height=0)
 Constructs a new image.
 Image (const Image< T > &image)
 Copy constructor.
virtual ~Image ()
 Destructor clears memory.
virtual void destroy ()
 Destroys the current instance.
virtual Objectclone ()
 Returns a pointer to a semantical copy of the current object.
virtual const std::string get_type ()
 Returns the type of the object.
void subimage (int from_x, int from_y, Image< T > &image)
 Computes a subimage with respect to a rectangular area.
Image< T > & operator= (const Image< T > &a)
 Assignment operator.
PrimitiveIteratoriterator (Primitive2D *primitive)
 Returns a primitive iterator corresponding to the to the given primitive or zero if no such iterator exists.

Protected Attributes

int width
 Width of the image.
int height
 Height of the image.
T * data
 Data of the image.
bool own_data
 Ownerstate of data.
int size
 Size of data.

Detailed Description

template<class T>
class crp::Image< T >

Class Image encapsulates (two-dimensional) images.


Constructor & Destructor Documentation

template<class T >
crp::Image< T >::Image ( int  width = 0,
int  height = 0 
) [inline]

Constructs a new image.

Parameters:
widthWidth of the image
heightHeight of the image
template<class T >
crp::Image< T >::Image ( const Image< T > &  image) [inline]

Copy constructor.

template<class T >
virtual crp::Image< T >::~Image ( ) [inline, virtual]

Destructor clears memory.


Member Function Documentation

template<class T >
virtual Object* crp::Image< T >::clone ( ) [inline, virtual]

Returns a pointer to a semantical copy of the current object.

Returns:
Copy of the current object

Reimplemented from crp::Array< T >.

template<class T >
virtual void crp::Image< T >::destroy ( ) [inline, virtual]

Destroys the current instance.

Reimplemented from crp::Array< T >.

template<class T >
virtual const std::string crp::Image< T >::get_type ( ) [inline, virtual]

Returns the type of the object.

Returns:
Type of the object
template<class T >
PrimitiveIterator* crp::Image< T >::iterator ( Primitive2D primitive) [inline]

Returns a primitive iterator corresponding to the to the given primitive or zero if no such iterator exists.

Parameters:
primitivePrimitive
template<class T >
Image<T>& crp::Image< T >::operator= ( const Image< T > &  a) [inline]

Assignment operator.

template<class T >
void crp::Image< T >::subimage ( int  from_x,
int  from_y,
Image< T > &  image 
) [inline]

Computes a subimage with respect to a rectangular area.

Parameters:
from_xStart point X-Coordinate
from_yStart point X-Coordinate
imageTarget image

Field Documentation

template<class T >
T* crp::Image< T >::data [protected]

Data of the image.

Reimplemented from crp::Array< T >.

template<class T >
int crp::Image< T >::height [protected]

Height of the image.

Reimplemented from crp::Array< T >.

template<class T >
bool crp::Image< T >::own_data [protected]

Ownerstate of data.

Reimplemented from crp::Array< T >.

template<class T >
int crp::Image< T >::size [protected]

Size of data.

Reimplemented from crp::Array< T >.

template<class T >
int crp::Image< T >::width [protected]

Width of the image.

Reimplemented from crp::Array< T >.


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