imgbase< s_x, s_y, T > Class Template Reference

#include <imgclass.hpp>

Inheritance diagram for imgbase< s_x, s_y, T >:

Inheritance graph
base refererrect $classinterpol.html 428,8 577,32rect $classimgbase.html 397,60 608,84rect $classimgbase.html 424,122 581,146rect $classimgbase.html 417,185 588,209rect $classimgbase.html 386,248 618,272
[legend]

List of all members.


Detailed Description

template<int s_x, int s_y, typename T>
class imgbase< s_x, s_y, T >

Base class for images.

This class is the one true base for all classes that deal with two-dimensional x-ray data. In order to use common operations on different data types, it is implemented as a template abstraction for the data type and the size of the images. It features static memory management (no reference count) and some arithmetic operations, which are executed element by element. It is kind of superfluous with so many linear algebra packages around, but following the holy tradition of EP~V I implemented this class from scratch. It has to do with the outdated compiler, too (VC++ 6)

Definition at line 111 of file imgclass.hpp.


Public Types

typedef T data_t
 The base data type, for convenience.

Public Member Functions

 imgbase ()
 Standard constructor.
 imgbase (const imgbase &im)
 Copy constructor.
 ~imgbase ()
 Destructor.
T & operator() (int y, int x)
 Element extraction operator.
const T & operator() (int y, int x) const
 Constant element extraction operator.
imgbase< s_x, s_y, T > & operator= (const imgbase< s_x, s_y, T > &what)
 Assignment operator.
imgbase< s_x, s_y, T > & operator/= (const imgbase< s_x, s_y, T > &what)
 Arithmetic operator.
imgbase< s_x, s_y, T > & operator/= (const T &what)
 Arithmetic operator.
imgbase< s_x, s_y, T > & operator*= (const imgbase< s_x, s_y, T > &what)
 Arithmetic operator.
imgbase< s_x, s_y, T > & operator*= (const T &what)
 Arithmetic operator.
imgbase< s_x, s_y, T > & operator-= (const imgbase< s_x, s_y, T > &what)
 Arithmetic operator.
imgbase< s_x, s_y, T > & operator-= (const T &what)
 Arithmetic operator.
imgbase< s_x, s_y, T > & operator+= (const imgbase< s_x, s_y, T > &what)
 Arithmetic operator.
imgbase< s_x, s_y, T > & operator+= (const T &what)
 Arithmetic operator.

Public Attributes

const int SIZEX
 save the s_x template parameter
const int SIZEY
 save the s_y template parameter

Protected Attributes

data_t ** bild

Member Typedef Documentation

template<int s_x, int s_y, typename T>
typedef T imgbase< s_x, s_y, T >::data_t

The base data type, for convenience.

You can use this typedef to extract the type of the elements from the derived classes.

Example:

Definition at line 123 of file imgclass.hpp.


Constructor & Destructor Documentation

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T >::imgbase (  )  [inline]

Standard constructor.

The standard constructor reserves memory for the data storage

Definition at line 169 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and reserve_2D().

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T >::imgbase ( const imgbase< s_x, s_y, T > &  im  )  [inline]

Copy constructor.

The copy constructor first reserves memory the same way as the standard constructor, then calls operator = to copy the content from im to *self

Definition at line 181 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, imgbase< s_x, s_y, T >::operator=(), and reserve_2D().

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T >::~imgbase (  )  [inline]

Destructor.

The destructor releases the memory from the data storage

Definition at line 192 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and delete_2D().


Member Function Documentation

template<int s_x, int s_y, typename T>
T& imgbase< s_x, s_y, T >::operator() ( int  y,
int  x 
) [inline]

Element extraction operator.

Parenthesis are used to index a pixel of the image. This idea is borrowed from the octave C++ interface. The order of the arguments is y, x. This order should imitate the old C way in order not to confuse people from EP~V

Reimplemented in interpol, and QRfit.

Definition at line 138 of file imgclass.hpp.

Referenced by QRfit::operator()(), and interpol::operator()().

template<int s_x, int s_y, typename T>
const T& imgbase< s_x, s_y, T >::operator() ( int  y,
int  x 
) const [inline]

Constant element extraction operator.

Reimplemented in interpol, and QRfit.

Definition at line 140 of file imgclass.hpp.

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator= ( const imgbase< s_x, s_y, T > &  what  )  [inline]

Assignment operator.

The assignment operator assigns every element from the image what to the corresponding pixel in the image. It can only copy from an image of the same base type and size. So, each of the following code pieces is illegal:

        bild16 a;
        bildfloat b;
        b=a;  // illegal because of different type

        imgbase <100, 100, int> c;
        imgbase <150, 250, int> d;
        c=d; //illegal because of different sizes

Definition at line 212 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.

Referenced by imgbase< s_x, s_y, T >::imgbase().

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator/= ( const imgbase< s_x, s_y, T > &  what  )  [inline]

Arithmetic operator.

This operator divides every pixel of the image by the corresponding value in what. It leaves the value unchanged if the denominator is zero, thus avoiding division by zero

Definition at line 224 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator/= ( const T &  what  )  [inline]

Arithmetic operator.

This operator divides every pixel by the constant value what

Definition at line 261 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator*= ( const imgbase< s_x, s_y, T > &  what  )  [inline]

Arithmetic operator.

This operator multiplies every pixel of the image by the corresponding value in what.

Definition at line 236 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator*= ( const T &  what  )  [inline]

Arithmetic operator.

This operator multiplies every pixel by the constant value what

Definition at line 272 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator-= ( const imgbase< s_x, s_y, T > &  what  )  [inline]

Arithmetic operator.

This operator subtracts every pixel of what from the corresponding value in the image.

Definition at line 249 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator-= ( const T &  what  )  [inline]

Arithmetic operator.

This operator subtracts the constant value what from every pixel in the image

Definition at line 283 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator+= ( const imgbase< s_x, s_y, T > &  what  )  [inline]

Arithmetic operator.

This operator adds every pixel in what to the corresponding pixel value in the image

Definition at line 295 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.

template<int s_x, int s_y, typename T>
imgbase< s_x, s_y, T > & imgbase< s_x, s_y, T >::operator+= ( const T &  what  )  [inline]

Arithmetic operator.

This operator adds the constant value what to every pixel in the image

Definition at line 307 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild, and MAP.


Member Data Documentation

template<int s_x, int s_y, typename T>
const int imgbase< s_x, s_y, T >::SIZEX

template<int s_x, int s_y, typename T>
const int imgbase< s_x, s_y, T >::SIZEY

template<int s_x, int s_y, typename T>
data_t** imgbase< s_x, s_y, T >::bild [protected]


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

Generated on Fri Jul 24 12:49:18 2009 for Xgrayimg Library by  doxygen 1.5.5