This class implements a 2D lookup object with values at the bins' center positions defining the individual lookup values.
More...
|
| LookupCenter2 ()=default |
| Creates a new empty lookup object.
|
|
| LookupCenter2 (const LookupCenter2< T, TScalar > &lookup) |
| Copy constructor.
|
|
| LookupCenter2 (LookupCenter2< T, TScalar > &&lookup) noexcept |
| Move constructor.
|
|
| LookupCenter2 (const size_t sizeX, const size_t sizeY, const size_t binsX, const size_t binsY) |
| Creates a new lookup object by definition of the dimensions and bin numbers.
|
|
| LookupCenter2 (const size_t sizeX, const size_t sizeY, const size_t binsX, const size_t binsY, const T *binValues) |
| Creates a new lookup object by definition of the dimensions and bin numbers.
|
|
| LookupCenter2 (const size_t sizeX, const size_t sizeY, const LookupCenter2< T, TScalar > &lookup) |
| Creates a new lookup object by definition of the dimensions and a given lookup object.
|
|
bool | isInside (const TScalar x, const TScalar y) const |
| Returns whether a given position lies inside this lookup object and therefore whether this position can be applied for the interpolation functions.
|
|
size_t | binX (const TScalar x) const |
| Returns the horizontal bin that corresponds to a precise horizontal lookup position.
|
|
size_t | binY (const TScalar y) const |
| Returns the vertical bin that corresponds to a precise vertical lookup position.
|
|
size_t | binTopLeftX (const size_t binX) const |
| Returns the horizontal top left position of a specified bin with pixel accuracy.
|
|
size_t | binTopLeftY (const size_t binY) const |
| Returns the vertical top left position of a specified bin with pixel accuracy.
|
|
size_t | binBottomRightX (const size_t binX) const |
| Returns the horizontal bottom right position (including) of a specified bin with pixel accuracy.
|
|
size_t | binBottomRightY (const size_t binY) const |
| Returns the vertical bottom right position of a specified bin with pixel accuracy.
|
|
TScalar | binCenterPositionX (const size_t binX) const |
| Returns the horizontal center position of a specific bin in relation to the dimension of this lookup object.
|
|
TScalar | binCenterPositionY (const size_t binY) const |
| Returns the vertical center position of a specific bin in relation to the dimension of this lookup object.
|
|
Vector2 | binCenterPosition (const size_t binX, const size_t binY) const |
| Returns the center position of a specific bin in relation to the dimension of this lookup object.
|
|
const T & | binCenterValue (const size_t binX, const size_t binY) const |
| Returns the lookup value of a specific bin's center of this lookup object.
|
|
T & | binCenterValue (const size_t binX, const size_t binY) |
| Returns the lookup value of a specific bin's center of this lookup object.
|
|
T | nearestValue (const TScalar x, const TScalar y) const |
| Applies a lookup for a specific position in this lookup object.
|
|
T | bilinearValue (const TScalar x, const TScalar y) const |
| Applies a lookup for a specific position in this lookup object.
|
|
T | bicubicValue (const TScalar x, const TScalar y) const |
| Applies a lookup for a specific position in this lookup object.
|
|
T | clampedNearestValue (const TScalar x, const TScalar y) const |
| Applies a lookup for a specific position in this lookup object while the position is clamped to match into the domain of the lookup table.
|
|
T | clampedBilinearValue (const TScalar x, const TScalar y) const |
| Applies a lookup for a specific position in this lookup object while the position is clamped to match into the domain of the lookup table.
|
|
T | clampedBicubicValue (const TScalar x, const TScalar y) const |
| Applies a lookup for a specific position in this lookup object while the position is clamped to match into the domain of the lookup table.
|
|
void | setBinCenterValue (const size_t binX, const size_t binY, const T &value) |
| Sets the value of one specific lookup bin's center.
|
|
LookupCenter2< T, TScalar > & | operator= (LookupCenter2< T, TScalar > &&lookup) noexcept |
| Move operator.
|
|
const T * | data () const |
| Returns a pointer to the constant bin data (row aligned).
|
|
T * | data () |
| Returns a pointer to the bin data (row aligned).
|
|
size_t | sizeX () const |
| Returns the horizontal dimension of this lookup object.
|
|
size_t | sizeY () const |
| Returns the vertical dimension of this lookup object.
|
|
size_t | binsX () const |
| Returns the number of horizontal bins of this lookup object.
|
|
size_t | binsY () const |
| Returns the number of vertical bins of this lookup object.
|
|
bool | isEmpty () const |
| Returns whether this lookup object does not hold any lookup bin.
|
|
| operator bool () const |
| Returns whether this lookup object holds at least one lookup bin.
|
|
bool | operator== (const Lookup2< T, TScalar > &lookup) const |
| Returns whether two lookup objects are identical.
|
|
bool | operator!= (const Lookup2< T, TScalar > &lookup) const |
| Returns whether two lookup objects are not identical.
|
|
|
typedef T | Type |
| Definition of the lookup data type.
|
|
typedef std::vector< T > | Values |
| Definition of a vector holding lookup values.
|
|
| Lookup2 ()=default |
| Creates a new empty lookup object.
|
|
| Lookup2 (const Lookup2< T, TScalar > &lookup) |
| Copy constructor.
|
|
| Lookup2 (Lookup2< T, TScalar > &&lookup) noexcept |
| Move constructor.
|
|
Lookup2< T, TScalar > & | operator= (const Lookup2< T, TScalar > &lookup) |
| Assign operator.
|
|
Lookup2< T, TScalar > & | operator= (Lookup2< T, TScalar > &&lookup) noexcept |
| Move operator.
|
|
size_t | sizeX_ = 0 |
| Horizontal dimension of this lookup object.
|
|
size_t | sizeY_ = 0 |
| Vertical dimension of this lookup object.
|
|
size_t | binsX_ = 0 |
| Number of horizontal bins.
|
|
size_t | binsY_ = 0 |
| Number of vertical bins.
|
|
TScalar | invSizeX_ = 0 |
| Inverse horizontal dimension of this lookup object.
|
|
TScalar | invSizeY_ = 0 |
| Inverse vertical dimension of this lookup object.
|
|
TScalar | invBinsX_ = 0 |
| Inverse number of horizontal bins.
|
|
TScalar | invBinsY_ = 0 |
| Inverse number of vertical bins.
|
|
Values | values_ |
| The values of the lookup bins.
|
|
template<typename T, typename TScalar = Scalar>
class Ocean::LookupCenter2< T, TScalar >
This class implements a 2D lookup object with values at the bins' center positions defining the individual lookup values.
This area is separated into individual neighboring bins (with almost same size) each covering an integer-sized area.
The sizes of the bins may vary due to rounding issues if the number of bins is not dividable without remainder in relation to the size of the lookup object.
Each bin covers a whole-numbered number of elements (e.g., pixels) and the left, top, right and bottom position of each bin is also an integer number.
However, the center position of the bins may have a non-integer position.
The lookup table with 4x2 bins has the following layout:
--- --- --- ---
| + | + | + | + |
--- --- --- ---
| + | + | + | + |
--- --- --- ---
With '+' showing the center positions of the lookup values.
Thus, the lookup table has 4 horizontal bins and 4 horizontal lookup values.
All lookup values are located inside the specified size of the lookup object.
The vertical positions are accordingly.
- Template Parameters
-
T | The data type of the stored lookup values |
TScalar | The data type of the scalar values, either 'float' or 'double' |
- See also
- LookupCorner2