#include <imgclass.hpp>
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 |
The base data type, for convenience.
You can use this typedef
to extract the type of the elements from the derived classes.
Example:
bild16::data_t temp;
Definition at line 123 of file imgclass.hpp.
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().
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().
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().
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()().
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.
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().
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.
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.
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.
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.
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.
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.
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.
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.
save the s_x template parameter
Definition at line 126 of file imgclass.hpp.
Referenced by interpol::interpol(), valleyborder::operator()(), maxborder::operator()(), minborder::operator()(), QRfit::QRfit(), QRfit::read(), interpol::read(), QRfit::write(), and interpol::write().
save the s_y template parameter
Definition at line 129 of file imgclass.hpp.
Referenced by interpol::interpol(), valleyborder::operator()(), maxborder::operator()(), minborder::operator()(), QRfit::QRfit(), QRfit::read(), interpol::read(), QRfit::write(), and interpol::write().
The real data storage. Should not be used by derived classes
Definition at line 161 of file imgclass.hpp.
Referenced by imgbase< s_x, s_y, T >::imgbase(), imgbase< 512, 512, unsigned short >::operator()(), imgbase< s_x, s_y, T >::operator*=(), imgbase< s_x, s_y, T >::operator+=(), imgbase< s_x, s_y, T >::operator-=(), imgbase< s_x, s_y, T >::operator/=(), imgbase< s_x, s_y, T >::operator=(), and imgbase< s_x, s_y, T >::~imgbase().