last update 20 Sep 2009 |
#include <cvrChannel32.h>
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 channel32 * | clone () const |
virtual channel32 * | newInstance () const |
int | computeSumOfElements () const |
channel32 & | castFrom (const channel &other, const bool minToBlack=false, const bool maxToWhite=false) |
template<class U > | |
channel32 & | castFrom (const matrix< U > &other) |
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).
cvr::channel32::channel32 | ( | ) |
Default constructor creates an empty channel32.
cvr::channel32::channel32 | ( | const int | rows, | |
const int | cols | |||
) |
cvr::channel32::channel32 | ( | const ipoint & | size | ) |
Create a connected size.y
x size.x
channel32 and leave all elements uninitialized.
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 size.y
x size.x
Channel32 and initializes all elements with iniValue.
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.
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.
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 |
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 the other matrix by casting each of its elements.
other | The matrix to be cast |
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..
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. |
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.
Reimplemented from cvr::matrix< int32 >.
int cvr::channel32::computeSumOfElements | ( | ) | const |
virtual const std::string& cvr::channel32::name | ( | ) | const [virtual] |
virtual channel32* cvr::channel32::newInstance | ( | ) | const [virtual] |
Create a new empty channel32.
Reimplemented from cvr::matrix< int32 >.