latest version v1.9 - last update 10 Apr 2010 |
a format for signed 32-bit-channels. More...
#include <ltiImage.h>
Public Member Functions | |
channel32 () | |
channel32 (const int &rows, const int &cols, const int &iniValue=int()) | |
channel32 (const int &rows, const int &cols, const int data[]) | |
channel32 (const ipoint &size, const int &iniValue=int()) | |
channel32 (const channel32 &other, const int &fromRow=0, const int &toRow=MaxInt32, const int &fromCol=0, const int &toCol=MaxInt32) | |
channel32 (const bool ©Data, channel32 &other, const int &fromRow=0, const int &toRow=MaxInt32, const int &fromCol=0, const int &toCol=MaxInt32) | |
channel32 (const bool &init, const int &rows, const int &cols) | |
channel32 (const bool &init, const ipoint &size) | |
virtual mathObject * | clone () const |
virtual const char * | getTypeName () const |
template<class U > | |
channel32 & | castFrom (const matrix< U > &other) |
a format for signed 32-bit-channels.
This class is identical to a matrix of integers except for the method castFrom(channel)
lti::channel32::channel32 | ( | ) |
default constructor creates an empty channel32
lti::channel32::channel32 | ( | const int & | rows, | |
const int & | cols, | |||
const int & | iniValue = int() | |||
) |
lti::channel32::channel32 | ( | const int & | rows, | |
const int & | cols, | |||
const int | data[] | |||
) |
this constructor creates a connected rows x cols
Channel32 and initializes all elements with the data pointed by data
.
The first cols
-elements of the data will be copied on the first row, the next ones on the second row and so on.
lti::channel32::channel32 | ( | const ipoint & | size, | |
const int & | iniValue = int() | |||
) |
this constructor creates a connected size.y x size.x
Channel32 and initializes all elements with iniValue
size | lti::point with the size of the channel32 (size.x is the number of columns and size.y the number of rows) | |
iniValue | all elements will be initialized with this value |
lti::channel32::channel32 | ( | const channel32 & | other, | |
const int & | fromRow = 0 , |
|||
const int & | toRow = MaxInt32 , |
|||
const int & | fromCol = 0 , |
|||
const int & | toCol = MaxInt32 | |||
) |
copy constructor.
create this channel32 as a connected copy of another channel32 for this const version, the data will be always copied! It is also possible to create a copy of a subchannel of another channel.
other | the channel32 to be copied. | |
fromRow | initial row of the other channel32 to be copied | |
toRow | last row to be copied of the other channel32 | |
fromCol | initial column of the other channel32 to be copied | |
toCol | last column to be copied of the other channel32 |
Example:
lti::channel32 m(4,6,0); // integer channel32 with 25 elements // ... // initialize Channel32 with: // 0 1 2 3 4 5 // 2 1 5 4 0 3 // 1 2 1 2 3 2 // 3 3 2 1 2 3 lti::channel32<int> sm(m,1,3,0,2) // last line will leat to // following contents in sm: // 1 2 3 // 1 5 4 // 2 1 2
lti::channel32::channel32 | ( | const bool & | copyData, | |
channel32 & | other, | |||
const int & | fromRow = 0 , |
|||
const int & | toRow = MaxInt32 , |
|||
const int & | fromCol = 0 , |
|||
const int & | toCol = MaxInt32 | |||
) |
copy constructor (reference to a subchannel32).
creates subchannel32 of another channel32.
if copyData == true
, the new object has its own data (equivalent to previous copy constructor).
if copyData == false
, the new object has references to the other channel32, which means that the data is not necessarily consecutive. (This will not be a connected but a lined channel32)
Those algorithms which use direct access to the channel32 memory block should check first if the memory lies in a consecutive block! (see getMode())
copyData | should the data of the other channel32 be copied or not | |
other | the channel with the original data | |
fromRow | initial row of the other channel32 to be copied | |
toRow | last row to be copied of the other channel32 | |
fromCol | initial column of the other channel32 to be copied | |
toCol | last column to be copied of the other channel32 |
lti::channel32::channel32 | ( | const bool & | init, | |
const int & | rows, | |||
const int & | cols | |||
) |
If init is true this constructor is equivalent to calling channel8(const int& rows, const int& cols), and thus initializing all elements with T().
However, in some cases the elements need not be initialized during construction, since complex initializion is required. Especially for large matrices, the unnecessary constructor initialization is very time consuming.
If init is false, memory is allocated but no initialization takes place. Thus the following is equivalent:
channel8 a(false,100,100); channel8 a; a.resize(100,100,0,false,false);
lti::channel32::channel32 | ( | const bool & | init, | |
const ipoint & | size | |||
) |
If init is true this constructor is equivalent to calling channel(const int& rows, const int& cols), and thus initializing all elements with T().
However, in some cases the elements need not be initialized during construction, since complex initializion is required. Especially for large matrices, the unnecessary constructor initialization is very time consuming.
If init is false, memory is allocated but no initialization takes place. Thus the following is equivalent:
channel a(false,point(100,100)); channel a; a.resize(100,100,0,false,false);
copy the other
matrix by casting each of its elements
other | The matrix to be casted |
Reimplemented from lti::matrix< int32 >.
virtual mathObject* lti::channel32::clone | ( | ) | const [virtual] |
create a clone of this channel
Reimplemented from lti::matrix< int32 >.
virtual const char* lti::channel32::getTypeName | ( | ) | const [virtual] |
return the name of this type
Reimplemented from lti::matrix< int32 >.