LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::channel32 Class Reference
[Aggregate Data Types]

a format for signed 32-bit-channels. More...

#include <ltiImage.h>

Inheritance diagram for lti::channel32:
Inheritance graph
[legend]
Collaboration diagram for lti::channel32:
Collaboration graph
[legend]

List of all members.

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 &copyData, 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 mathObjectclone () const
virtual const char * getTypeName () const
template<class U >
channel32castFrom (const matrix< U > &other)

Detailed Description

a format for signed 32-bit-channels.

This class is identical to a matrix of integers except for the method castFrom(channel)

See also:
lti::image

Constructor & Destructor Documentation

lti::channel32::channel32 (  ) 

default constructor creates an empty channel32

lti::channel32::channel32 ( const int &  rows,
const int &  cols,
const int &  iniValue = int() 
)

this constructor creates a connected rows x cols Channel32 and initializes all elements with iniValue

Parameters:
rows number of rows of the channel32
cols number of columns of the channel32
iniValue all elements will be initialized with this value
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.

Parameters:
rows number of rows of the channel32
cols number of columns of the channel32
data pointer to the memory block with the data to be initialized with.
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

Parameters:
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.

Parameters:
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())

Parameters:
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);
Parameters:
init initialize channel8 or not
rows number of rows of the channel8
cols number of columns of the channel8
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);
Parameters:
init initialize channel or not
size new size for the matrix (size.x columns, size.y rows)

Member Function Documentation

template<class U >
channel32& lti::channel32::castFrom ( const matrix< U > &  other  )  [inline]

copy the other matrix by casting each of its elements

Parameters:
other The matrix to be casted
Returns:
a reference to this channel

Reimplemented from lti::matrix< int32 >.

virtual mathObject* lti::channel32::clone (  )  const [virtual]

create a clone of this channel

Returns:
a pointer to a copy of this matrix

Reimplemented from lti::matrix< int32 >.

virtual const char* lti::channel32::getTypeName (  )  const [virtual]

return the name of this type

Reimplemented from lti::matrix< int32 >.


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

Generated on Sat Apr 10 15:27:27 2010 for LTI-Lib by Doxygen 1.6.1