CVR-Lib last update 20 Sep 2009

cvr::channel32 Class Reference
[Aggregate Data TypesImage Processing and Analysis]

A format for 32-bit channels. More...

#include <cvrChannel32.h>

Inheritance diagram for cvr::channel32:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 channel32 ()
 channel32 (const int rows, const int cols)
 channel32 (const ipoint &size)
 channel32 (const int rows, const int cols, const int32 &iniValue)
 channel32 (const ipoint &size, const int32 &iniValue)
 channel32 (const int rows, const int cols, const int32 data[])
 channel32 (const channel32 &other, const int fromRow, const int fromCol=0, const int toRow=MaxIndex, const int toCol=MaxIndex)
 channel32 (const channel32 &other)
 channel32 (const channel32 &other, const ipoint &from, const ipoint &to)
virtual const std::string & name () const
virtual channel32clone () const
virtual channel32newInstance () const
int computeSumOfElements () const
channel32castFrom (const channel &other, const bool minToBlack=false, const bool maxToWhite=false)
template<class U >
channel32castFrom (const matrix< U > &other)


Detailed Description

A format for 32-bit channels.

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

The value range is between -(2^31) and (2^31-1) (see cvr::image for more information).

See also:
cvr::image, cvr::channel, cvr::channel8

Constructor & Destructor Documentation

cvr::channel32::channel32 (  ) 

Default constructor creates an empty channel32.

cvr::channel32::channel32 ( const int  rows,
const int  cols 
)

Create a connected rows x cols channel32 and leave all elements uninitialized.

Parameters:
rows number of rows of the channel32
cols number of columns of the channel32

cvr::channel32::channel32 ( const ipoint size  ) 

Create a connected size.y x size.x channel32 and leave all elements uninitialized.

Parameters:
size cvr::point with the size of the channel32 (size.x is the number of columns and size.y the number of rows)

cvr::channel32::channel32 ( const int  rows,
const int  cols,
const int32 iniValue 
)

Create 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

cvr::channel32::channel32 ( const ipoint size,
const int32 iniValue 
)

Create a connected size.y x size.x Channel32 and initializes all elements with iniValue.

Parameters:
size cvr::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

cvr::channel32::channel32 ( const int  rows,
const int  cols,
const int32  data[] 
)

Create 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.

cvr::channel32::channel32 ( const channel32 other,
const int  fromRow,
const int  fromCol = 0,
const int  toRow = MaxIndex,
const int  toCol = MaxIndex 
)

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
fromCol initial column of the other channel32 to be copied
toRow last row to be copied of the other channel32
toCol last column to be copied of the other channel32
Example:
 cvr::channel32 m(4,6,0); // channel32 with 24 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

 cvr::channel32 sm(m,1,3,0,2)  // last line will leat to
 //                              following contents in sm:
 //        1  2  3
 //        1  5  4
 //        2  1  2

cvr::channel32::channel32 ( const channel32 other  ) 

Copy constructor.

Parameters:
other the channel32 to be copied.

cvr::channel32::channel32 ( const channel32 other,
const ipoint from,
const ipoint to 
)

Copy constructor.

Copy a submatrix of another channel32

Parameters:
other the channel32 to be copied.
from initial point of the window to be copied
to final point (included) of the window to be copied.


Member Function Documentation

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

Copy the other matrix by casting each of its elements.

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

References castFrom().

channel32& cvr::channel32::castFrom ( const channel other,
const bool  minToBlack = false,
const bool  maxToWhite = false 
)

Copy the other channel by casting each of its elements.

The elements of the channel will be multiplied by 255 if no other parameter but the channel is given..

Parameters:
other the channel to be cast from
minToBlack if minToBlack is true, a linear gray-valued tranformation will be applied, which maps the minimal value in the channel to zero. If false, the value zero will be mapped to zero.
maxToWhite if maxToWhite is true, a linear gray-valued transformation will be applied, which maps the maximal value in the channel to 255. If false, the value 1.0f will be mapped to 255.
Returns:
a reference to this channel Example:
   cvr::channel matA(10,10,1); // a channel
   cvr::channel32  matB;       // a channel32

   matB.castFrom(matA);         // this will copy matA in matB!!
                                // and all elements will have 255

Referenced by castFrom().

virtual channel32* cvr::channel32::clone (  )  const [virtual]

Create a clone of this channel32.

Returns:
a pointer to a copy of this matrix

Reimplemented from cvr::matrix< int32 >.

int cvr::channel32::computeSumOfElements (  )  const

Compute the sum of all elements in the channel.

Reimplemented from cvr::matrix< int32 >.

virtual const std::string& cvr::channel32::name (  )  const [virtual]

Returns the name of this type.

Reimplemented from cvr::matrix< int32 >.

virtual channel32* cvr::channel32::newInstance (  )  const [virtual]

Create a new empty channel32.

Returns:
a pointer to a copy of this matrix

Reimplemented from cvr::matrix< int32 >.


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

Generated on Sun Sep 20 22:08:43 2009 for CVR-Lib by Doxygen 1.5.8