OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimDblGrid.h>
Public Types | |
enum | InterpType { BILINEAR } |
enum | DomainType { CONTINUOUS = 0, SAWTOOTH_90 = 1, WRAP_180 = 2, WRAP_360 = 3 } |
Public Member Functions | |
ossimDblGrid () | |
ossimDblGrid (const ossimDblGrid &source_to_copy) | |
ossimDblGrid (const ossimIpt &size, const ossimDpt &origin, const ossimDpt &spacing, double null_value=OSSIM_DEFAULT_NULL_PIX_DOUBLE) | |
ossimDblGrid (const ossimDrect &uv_rect, const ossimDpt &spacing, double null_value=OSSIM_DEFAULT_NULL_PIX_DOUBLE) | |
~ossimDblGrid () | |
void | initialize (const ossimIpt &size, const ossimDpt &origin, const ossimDpt &spacing, double null_value=OSSIM_DEFAULT_NULL_PIX_DOUBLE) |
void | initialize (const ossimDrect &uv_rect, const ossimDpt &spacing, double null_value=OSSIM_DEFAULT_NULL_PIX_DOUBLE) |
void | enableExtrapolation (bool arg=true) |
void | deallocate () |
void | fill (double fill_value) |
void | clear () |
void | setNode (const ossimIpt &p, const double &value) |
void | setNode (int x, int y, const double &value) |
double | getNode (const ossimIpt &p) const |
double | getNode (int x, int y) const |
void | setNearestNode (const ossimDpt &uv_point, const double &value) |
void | interpolateNullValuedNodes (const double &decay_rate=10.0) |
void | filter (int size_x, int size_y, double *kernel) |
void | setInterpolationType (InterpType interp) |
void | setDomainType (DomainType dt) |
double | operator() (const ossimDpt &uv_point) const |
double | value (const ossimDpt &uv_point) const |
double | operator() (const double &u, const double &v) const |
double | value (const double &u, const double &v) const |
const ossimDblGrid & | operator= (const ossimDblGrid &grid) |
double | minValue () const |
double | maxValue () const |
double | nullValue () const |
double | meanValue () |
double | meanStdDev () |
void | setMinValue (double value) |
void | setMaxValue (double value) |
void | setNullValue (double value) |
const ossimIpt & | size () const |
const ossimDpt & | origin () const |
const ossimDpt & | spacing () const |
unsigned long | getSizeInBytes () const |
bool | isInside (const ossimDpt &p) const |
bool | isInside (const double &u, const double &v) const |
bool | save (std::ostream &os, const char *descr) const |
bool | load (std::istream &is) |
Private Member Functions | |
void | computeMean () |
double | interpolate (double x, double y) const |
Interpolates given non-integral point x, y. More... | |
double | extrapolate (double x, double y) const |
void | constrain (double &value) const |
Constrains the value to the numerical domain specified in theDomainType. More... | |
ossim_uint32 | index (int x, int y) const |
Private Attributes | |
double * | theGridData |
ossimIpt | theSize |
ossimDpt | theOrigin |
ossimDpt | theSpacing |
double | theMinValue |
double | theMaxValue |
double | theNullValue |
double | theMeanValue |
double | theDeviation |
bool | theMeanIsComputed |
bool | theExtrapIsEnabled |
DomainType | theDomainType |
Friends | |
std::ostream & | operator<< (std::ostream &os, const ossimDblGrid &grid) |
Enumerator | |
---|---|
CONTINUOUS | |
SAWTOOTH_90 | |
WRAP_180 | |
WRAP_360 |
Definition at line 149 of file ossimDblGrid.h.
Interpolate between grid nodes given arbitrary u/v coord system:
Enumerator | |
---|---|
BILINEAR |
Definition at line 143 of file ossimDblGrid.h.
ossimDblGrid::ossimDblGrid | ( | ) |
Default Constructor.
DEFAULT CONSTRUCTOR: ossimDblGrid
Definition at line 40 of file ossimDblGrid.cpp.
ossimDblGrid::ossimDblGrid | ( | const ossimDblGrid & | source | ) |
Copy Constructor.
COPY CONSTRUCTOR: ossimDblGrid
Allocate mem for the grid, and initialize:
Definition at line 61 of file ossimDblGrid.cpp.
ossimDblGrid::ossimDblGrid | ( | const ossimIpt & | size, |
const ossimDpt & | origin, | ||
const ossimDpt & | spacing, | ||
double | null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE |
||
) |
Constructs given a U/V origin and spacing, and a grid size.
CONSTRUCTOR: ossimDblGrid
Definition at line 89 of file ossimDblGrid.cpp.
ossimDblGrid::ossimDblGrid | ( | const ossimDrect & | rect, |
const ossimDpt & | spacing, | ||
double | null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE |
||
) |
Constructs given a rectangle in U/V space and grid spacing. The origin is taken as the upper-left corner of the rectangle. The lower-rightmost grid point may not coincide with the rectangles LR corner if the side is not evenly divisible by the corresponding spacing.
CONSTRUCTOR: ossimDblGrid
Definition at line 112 of file ossimDblGrid.cpp.
ossimDblGrid::~ossimDblGrid | ( | ) |
|
inline |
|
private |
METHOD: ossimDblGrid::computeMean()
Loop to compute mean:
Loop again to compute deviation:
Definition at line 606 of file ossimDblGrid.cpp.
References theGridData.
|
private |
Constrains the value to the numerical domain specified in theDomainType.
Definition at line 1178 of file ossimDblGrid.cpp.
References CONTINUOUS, theDomainType, theNullValue, value(), WRAP_180, and WRAP_360.
Referenced by extrapolate(), interpolate(), setNearestNode(), and setNode().
void ossimDblGrid::deallocate | ( | ) |
Definition at line 219 of file ossimDblGrid.cpp.
References theGridData, and theSize.
|
inline |
Enables/disables extrapolation functionality. If extrapolation is enabled, then calls to operator() will handle points outside of the grid.
Definition at line 91 of file ossimDblGrid.h.
Referenced by ossimH5GridModel::initializeModelParams().
|
private |
Definition at line 419 of file ossimDblGrid.cpp.
References constrain(), getNode(), interpolate(), theDomainType, theGridData, theNullValue, theSize, WRAP_180, ossimIpt::x, x, ossimIpt::y, and y.
Referenced by operator()().
void ossimDblGrid::fill | ( | double | fill_value | ) |
Fills the current grid with the value specified.
Definition at line 1161 of file ossimDblGrid.cpp.
References size(), theGridData, theSize, ossimIpt::x, and ossimIpt::y.
Referenced by ossimEnviCgModel::loadEnviGeocFile().
void ossimDblGrid::filter | ( | int | size_x, |
int | size_y, | ||
double * | kernel | ||
) |
Passes the grid data through a convolution filter given the kernel array. The grid must not contain any NULL nodes as these are treated as valid quantities. The kernel sizes should be odd numbers. To avoid shrinking the grid by the kernel radius, the edge nodes outside of the filter's reach are computed by extrapolation. X is the contiguous axis in the kernel array, i.e., kernel(x,y) = kernel[y*size_x + x].
Definition at line 1093 of file ossimDblGrid.cpp.
|
inline |
Definition at line 111 of file ossimDblGrid.h.
References getNode(), ossimIpt::x, and ossimIpt::y.
Referenced by ossimHdf5GridModel::crossesDateline(), extrapolate(), getNode(), ossimH5GridModel::initializeModelParams(), ossimCoarseGridModel::initializeModelParams(), operator<<(), ossimCoarseGridModel::print(), and ossimH5GridModel::setGridNodes().
double ossimDblGrid::getNode | ( | int | x, |
int | y | ||
) | const |
METHOD: ossimDblGrid::getNode(x, y) CONST
This method is used to return the grid data values.
Definition at line 304 of file ossimDblGrid.cpp.
References index(), theGridData, theNullValue, theSize, ossimIpt::x, x, ossimIpt::y, and y.
|
inline |
Definition at line 190 of file ossimDblGrid.h.
|
inlineprivate |
void ossimDblGrid::initialize | ( | const ossimIpt & | size, |
const ossimDpt & | origin, | ||
const ossimDpt & | spacing, | ||
double | null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE |
||
) |
When constructed with default, permits initialization afterward.
Allocate mem for the grid, and initialize:
Definition at line 152 of file ossimDblGrid.cpp.
Referenced by ossimHdf5GridModel::initialize(), ossimQuadProjection::initializeGrids(), ossimEnviCgModel::loadEnviGeocFile(), ossimTiledElevationDatabase::mapRegion(), and ossimH5GridModel::setGridNodes().
void ossimDblGrid::initialize | ( | const ossimDrect & | uv_rect, |
const ossimDpt & | spacing, | ||
double | null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE |
||
) |
Definition at line 202 of file ossimDblGrid.cpp.
|
private |
Interpolates given non-integral point x, y.
Definition at line 342 of file ossimDblGrid.cpp.
References constrain(), if(), ossim::nan(), theDomainType, theGridData, theNullValue, theSize, value(), WRAP_180, ossimIpt::x, and ossimIpt::y.
Referenced by extrapolate(), and operator()().
void ossimDblGrid::interpolateNullValuedNodes | ( | const double & | decay_rate = 10.0 | ) |
This method performs a resampling of the defined grid nodes in order to compute interpolated values for those uninitialized nodes. This is necessary when only a subset of nodes are available for initializing the grid.
Definition at line 912 of file ossimDblGrid.cpp.
|
inline |
Returns true if double point lies within world space coverage:
Definition at line 195 of file ossimDblGrid.h.
References isInside(), ossimDpt::u, and ossimDpt::v.
Referenced by isInside().
bool ossimDblGrid::isInside | ( | const double & | u, |
const double & | v | ||
) | const |
INLINE METHOD: ossimDblGrid::isInside(const ossimDpt& pt) const
Definition at line 655 of file ossimDblGrid.cpp.
References theOrigin, theSize, theSpacing, ossimDpt::u, ossimDpt::v, ossimIpt::x, ossimDpt::x, ossimIpt::y, and ossimDpt::y.
bool ossimDblGrid::load | ( | std::istream & | is | ) |
Definition at line 736 of file ossimDblGrid.cpp.
|
inline |
double ossimDblGrid::meanStdDev | ( | ) |
METHOD: ossimDblGrid::meanStdDev()
Definition at line 590 of file ossimDblGrid.cpp.
double ossimDblGrid::meanValue | ( | ) |
METHOD: ossimDblGrid::meanValue()
Definition at line 572 of file ossimDblGrid.cpp.
Referenced by ossimIntensityAdjustmentFilter::getTile().
|
inline |
Statistics methods:
Definition at line 175 of file ossimDblGrid.h.
Referenced by ossimHdf5GridModel::initialize().
|
inline |
Definition at line 177 of file ossimDblGrid.h.
|
inline |
Access an interpolated value in the U/V (output) coordinate system.
Definition at line 161 of file ossimDblGrid.h.
References ossimDpt::u, and ossimDpt::v.
double ossimDblGrid::operator() | ( | const double & | u, |
const double & | v | ||
) | const |
METHOD: ossimDblGrid::operator(double, double)
This method interpolates between grid points given a fractional location in UV (external) world space.
Definition at line 323 of file ossimDblGrid.cpp.
References extrapolate(), interpolate(), theExtrapIsEnabled, theGridData, theNullValue, theOrigin, theSize, theSpacing, ossimDpt::u, ossimDpt::v, ossimIpt::x, ossimDpt::x, ossimIpt::y, and ossimDpt::y.
const ossimDblGrid & ossimDblGrid::operator= | ( | const ossimDblGrid & | grid | ) |
operator for initializing this grid with another.
Definition at line 525 of file ossimDblGrid.cpp.
References theDeviation, theDomainType, theExtrapIsEnabled, theGridData, theMaxValue, theMeanIsComputed, theMeanValue, theMinValue, theNullValue, theOrigin, theSize, theSpacing, ossimIpt::x, and ossimIpt::y.
|
inline |
bool ossimDblGrid::save | ( | std::ostream & | os, |
const char * | descr | ||
) | const |
Loads and saves the grid from/to a stream. Returns TRUE if successful.
Definition at line 673 of file ossimDblGrid.cpp.
|
inline |
Definition at line 156 of file ossimDblGrid.h.
Referenced by ossimHdf5GridModel::crossesDateline(), ossimEnviCgModel::loadEnviGeocFile(), ossimH5GridModel::ossimH5GridModel(), ossimHdf5GridModel::ossimHdf5GridModel(), and ossimH5GridModel::setGridNodes().
void ossimDblGrid::setInterpolationType | ( | InterpType | interp | ) |
|
inline |
Definition at line 182 of file ossimDblGrid.h.
|
inline |
Definition at line 181 of file ossimDblGrid.h.
void ossimDblGrid::setNearestNode | ( | const ossimDpt & | uv_point, |
const double & | input | ||
) |
Sets the node nearest the U,V point specified to the value given. This is different from setNode() in that the UV coordinate system is used to address a node instead of an XY grid point.
METHOD: ossimDblGrid::setNearestNode(uv)
Sets the node nearest the U,V point specified to the value given. This is different from setNode() in that the UV coordinate system is used to address a node instead of an XY grid point.
Definition at line 269 of file ossimDblGrid.cpp.
References constrain(), setNode(), theGridData, theOrigin, theSize, theSpacing, ossimDpt::u, ossimDpt::v, value(), ossimIpt::x, ossimDpt::x, ossimIpt::y, and ossimDpt::y.
Referenced by ossimIntensityAdjustmentFilter::createAndPopulateGrid().
|
inline |
Access individual node value by node index in the X/Y (grid) coord system.
Definition at line 107 of file ossimDblGrid.h.
References ossimIpt::x, and ossimIpt::y.
Referenced by ossimTiledElevationDatabase::fillGrid(), ossimQuadProjection::initializeGrids(), ossimEnviCgModel::loadEnviGeocFile(), ossimH5GridModel::setGridNodes(), and setNearestNode().
void ossimDblGrid::setNode | ( | int | x, |
int | y, | ||
const double & | input | ||
) |
METHOD: ossimDblGrid::setNode(x, y) NON-CONST
This method is used to assign the grid data values.
Definition at line 235 of file ossimDblGrid.cpp.
References constrain(), index(), theGridData, theMaxValue, theMeanIsComputed, theMinValue, theNullValue, theSize, value(), ossimIpt::x, x, ossimIpt::y, and y.
|
inline |
Definition at line 183 of file ossimDblGrid.h.
Referenced by ossimQuadProjection::initializeGrids(), and ossimH5GridModel::setGridNodes().
|
inline |
Other member access methods:
Definition at line 187 of file ossimDblGrid.h.
Referenced by ossimHdf5GridModel::crossesDateline(), fill(), ossimHdf5GridModel::initialize(), ossimH5GridModel::initializeModelParams(), ossimCoarseGridModel::initializeModelParams(), and ossimCoarseGridModel::print().
|
inline |
Definition at line 189 of file ossimDblGrid.h.
Referenced by ossimHdf5GridModel::initialize(), ossimH5GridModel::initializeModelParams(), ossimCoarseGridModel::initializeModelParams(), and ossimCoarseGridModel::print().
|
inline |
Definition at line 162 of file ossimDblGrid.h.
References ossimDpt::u, and ossimDpt::v.
Referenced by constrain(), interpolate(), setNearestNode(), and setNode().
|
inline |
Definition at line 165 of file ossimDblGrid.h.
|
friend |
|
private |
Definition at line 225 of file ossimDblGrid.h.
Referenced by operator<<(), and operator=().
|
private |
Definition at line 228 of file ossimDblGrid.h.
Referenced by constrain(), extrapolate(), interpolate(), and operator=().
|
private |
Definition at line 227 of file ossimDblGrid.h.
Referenced by operator()(), and operator=().
|
private |
Definition at line 217 of file ossimDblGrid.h.
Referenced by computeMean(), deallocate(), extrapolate(), fill(), getNode(), interpolate(), operator()(), operator<<(), operator=(), setNearestNode(), setNode(), and ~ossimDblGrid().
|
private |
Definition at line 222 of file ossimDblGrid.h.
Referenced by operator<<(), operator=(), and setNode().
|
private |
Definition at line 226 of file ossimDblGrid.h.
Referenced by operator<<(), operator=(), and setNode().
|
private |
Definition at line 224 of file ossimDblGrid.h.
Referenced by operator<<(), and operator=().
|
private |
Definition at line 221 of file ossimDblGrid.h.
Referenced by operator<<(), operator=(), and setNode().
|
private |
Definition at line 223 of file ossimDblGrid.h.
Referenced by constrain(), extrapolate(), getNode(), interpolate(), operator()(), operator<<(), operator=(), and setNode().
|
private |
Definition at line 219 of file ossimDblGrid.h.
Referenced by isInside(), operator()(), operator<<(), operator=(), and setNearestNode().
|
private |
Definition at line 218 of file ossimDblGrid.h.
Referenced by deallocate(), extrapolate(), fill(), getNode(), interpolate(), isInside(), operator()(), operator<<(), operator=(), setNearestNode(), and setNode().
|
private |
Definition at line 220 of file ossimDblGrid.h.
Referenced by isInside(), operator()(), operator<<(), operator=(), and setNearestNode().