The ValueBoundaryTreatment class implements constant value border treatment when accessing Arrays.
More...
#include "libArrayToolbox/BoundaryTreatment.hh"
|
| ValueBoundaryTreatment (DataT const &value=traits< DataT >::zero) |
| Constructor. More...
|
|
| ValueBoundaryTreatment (ValueBoundaryTreatment< DataT, Dim > const &bt) |
| Copy Constructor. More...
|
|
| ~ValueBoundaryTreatment () |
| Destructor. More...
|
|
DataT const & | boundaryValue () const |
| Get the value, that is returned when out-of-Array positions are requested. More...
|
|
BoundaryTreatment< DataT, Dim > * | clone () const |
| Get a deep copy of this BoundaryTreatment object. More...
|
|
DataT | get (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< ptrdiff_t, Dim > pos) const |
| Get the Array value at the given position. More...
|
|
DataT | get (DataT const *data, ptrdiff_t pos, ptrdiff_t length) const |
| Get the C-array value at the given position. More...
|
|
blitz::TinyVector< ptrdiff_t, Dim > | getIndex (blitz::TinyVector< ptrdiff_t, Dim > pos, blitz::TinyVector< ptrdiff_t, Dim > const &shape) const |
| Get the in-Array-Index to the given position. More...
|
|
ptrdiff_t | getIndex (ptrdiff_t pos, ptrdiff_t length) const |
| Get the in-array-index to the given position. More...
|
|
ValueBoundaryTreatment< DataT, Dim > & | operator= (ValueBoundaryTreatment< DataT, Dim > const &bt) |
| Copy assignment operator. More...
|
|
bool | providesIndices () const |
| The returned boolean indicates, whether the boundary treatment is able to transform the incoming coordinates into valid Array coordinates and therefore it indicates, whether the function getIndex() returns valid in-Array-positions. More...
|
|
void | setBoundaryValue (DataT const &boundaryValue) |
| Set the value, that is returned when out-of-Array positions are requested. More...
|
|
BoundaryTreatmentType | type () const |
| Get the corresponding enumeration value for the boundary treatment type. More...
|
|
template<typename DataT, int Dim>
class atb::ValueBoundaryTreatment< DataT, Dim >
The ValueBoundaryTreatment class implements constant value border treatment when accessing Arrays.
The default constant is zero.
Definition at line 239 of file BoundaryTreatment.hh.
◆ ValueBoundaryTreatment() [1/2]
template<typename DataT, int Dim>
Constructor.
- Parameters
-
value | The value to assume for out-of-array pixels |
◆ ValueBoundaryTreatment() [2/2]
template<typename DataT, int Dim>
Copy Constructor.
- Parameters
-
◆ ~ValueBoundaryTreatment()
template<typename DataT, int Dim>
◆ operator=()
template<typename DataT, int Dim>
Copy assignment operator.
- Parameters
-
- Returns
- A reference to this BoundaryTreatment object for operator chaining
◆ clone()
template<typename DataT, int Dim>
◆ type()
template<typename DataT, int Dim>
◆ providesIndices()
template<typename DataT, int Dim>
The returned boolean indicates, whether the boundary treatment is able to transform the incoming coordinates into valid Array coordinates and therefore it indicates, whether the function getIndex() returns valid in-Array-positions.
- Returns
false
Implements atb::BoundaryTreatment< DataT, Dim >.
◆ get() [1/2]
template<typename DataT, int Dim>
DataT atb::ValueBoundaryTreatment< DataT, Dim >::get |
( |
blitz::Array< DataT, Dim > const & |
data, |
|
|
blitz::TinyVector< ptrdiff_t, Dim > |
pos |
|
) |
| const |
|
virtual |
Get the Array value at the given position.
For out-of-bounds positions the provided constant value will be returned
- Parameters
-
data | The Array to read a value from |
pos | The position to read |
- Returns
- The Array value at the specified position or the constant if the position is out-of-bounds
Implements atb::BoundaryTreatment< DataT, Dim >.
◆ getIndex() [1/2]
template<typename DataT, int Dim>
blitz::TinyVector<ptrdiff_t,Dim> atb::ValueBoundaryTreatment< DataT, Dim >::getIndex |
( |
blitz::TinyVector< ptrdiff_t, Dim > |
pos, |
|
|
blitz::TinyVector< ptrdiff_t, Dim > const & |
shape |
|
) |
| const |
|
virtual |
Get the in-Array-Index to the given position.
For the ValueBoundaryTreatment class this function just returns the given in-Array-position or throws an RuntimeError if an out-of-Array position is passed.
- Parameters
-
pos | The position to transform to in-Array-coordinates |
shape | The Array shape |
- Returns
- The position that was passed to the function
- Exceptions
-
RuntimeError | This exception is thrown if an out-of-Array position is passed. |
Implements atb::BoundaryTreatment< DataT, Dim >.
◆ get() [2/2]
template<typename DataT, int Dim>
Get the C-array value at the given position.
For out-of-array positions the corresponding treatment will be applied
- Parameters
-
data | The C-array to read a value from |
pos | The position to read |
length | The array length |
- Returns
- The array value at the specified position after boundary treatment
Implements atb::BoundaryTreatment< DataT, Dim >.
◆ getIndex() [2/2]
template<typename DataT, int Dim>
Get the in-array-index to the given position.
This function throws a RuntimeError if the BoundaryTreatment cannot return valid out-of-array indices. This can be checked using the providesIndices flag
- Parameters
-
pos | The position to transform to in-Array-coordinates |
length | The array length |
- Returns
- The in-Array position corresponding to the position that was passed to the function according to the used boundary treatment
- Exceptions
-
RuntimeError | This exception is thrown if the BoundaryTreatment cannot generate in-Array positions from given out-of-Array positions, and an out-of-Array position is passed. |
Implements atb::BoundaryTreatment< DataT, Dim >.
◆ boundaryValue()
template<typename DataT, int Dim>
Get the value, that is returned when out-of-Array positions are requested.
- Returns
- The out-of-Array value
◆ setBoundaryValue()
template<typename DataT, int Dim>
Set the value, that is returned when out-of-Array positions are requested.
- Parameters
-
boundaryValue | The new out-of-Array value |
The documentation for this class was generated from the following file: