SPATMOD::IMAGE::STAGE Class Reference

Base class for image supporting "pull" operations. More...

#include <spatmod/imagestage.h>

Inheritance diagram for SPATMOD::IMAGE::STAGE:
Inheritance graph
[legend]

List of all members.

Public Types

enum  BESTZOOM { BESTZOOM_Closest, BESTZOOM_ClosestTo1, BESTZOOM_Below75Pct }

Public Member Functions

 STAGE ()
virtual ~STAGE ()
ERRVALUE ComputeMultivariateStats (STAT_MULTIVAR &Stats)
ERRVALUE ComputePixelRange (const SECTION &section, PIXEL &PixelValueMin, PIXEL &PixelValueMax, RANGETYPE accuracy=RANGETYPE_Maximal)
ERRVALUE ComputePixelRange (RANGETYPE RangeType=RANGETYPE_Exact)
ERRVALUE ComputeSampleStats (STATSVALIDITY StatsValidity)
double GetBestZoom (double ZoomDesired, BESTZOOM bestzoom) const
ERRVALUE GetBoundingRegion (REGION2D &region) const
void GetMetadata (MISTRING &result, METADATACONTENT content, METADATAFORMAT format) const
const STAT_UNIVARIATEGetSampleStats (UINT16 index) const
STATSVALIDITY GetSampleStatsValidity () const
ERRVALUE Initialize ()
ERRVALUE Pull (const SECTION &section, BUFFER &buffer)
ERRVALUE PullBegin (const SECTION_ITERATOR &iterator)
ERRVALUE PullEnd ()
ERRVALUE PullSubSection (const SECTION &SubSection, BUFFER &buffer)
ERRVALUE ZoomCoordinates (DPOINT2D *PtsImage, UINT32 NumPoints, double TgtZoom, double SrcZoom=1) const
ERRVALUE ZoomRectangle (DRECT2D &RectImage, double TgtZoom, double SrcZoom=1) const

Protected Member Functions

void GetMetadataThisOnly (MISTRING &result, METADATACONTENT content, METADATAFORMAT format) const
ERRVALUE SetSampleStats (const STAT_UNIVARIATE *SampleStatsArray, STATSVALIDITY StatsValidity)
void SetSampleStatsValidity (STATSVALIDITY StatsValidity)
virtual ERRVALUE v_ComputePixelRange (const SECTION &section, PIXEL &PixelValueMin, PIXEL &PixelValueMax, RANGETYPE accuracy)
virtual ERRVALUE v_GetBoundingRegion (REGION2D &region) const
virtual bool v_QueryCapability (CAPABILITY capability) const

Private Member Functions

virtual ERRVALUE v_ComputeSampleStats (STAT_UNIVARIATE *SampleStatsArray, STATSVALIDITY StatsValidity)
virtual void v_GetMetadata (MISTRING &result, METADATACONTENT content, METADATAFORMAT format) const =0
virtual void v_GetMetadataThisOnly (MISTRING &result, METADATACONTENT content, METADATAFORMAT format) const
virtual ERRVALUE v_Initialize ()=0
virtual ERRVALUE v_PullBegin (const SECTION_ITERATOR &iterator)=0
virtual ERRVALUE v_PullEnd ()=0
virtual ERRVALUE v_PullSubSection (const SECTION &SubSection, BUFFER &buffer)=0

Detailed Description

Base class for image supporting "pull" operations.


Member Enumeration Documentation

Enumeration for use with GetBestZoom.

Enumerator:
BESTZOOM_Closest 

Closest absolute.

BESTZOOM_ClosestTo1 

Closest to 1 (unity).

BESTZOOM_Below75Pct 

Highest value below desired and above 75% of desired, if any, otherwise closest to 1.


Constructor & Destructor Documentation

SPATMOD::IMAGE::STAGE::STAGE (  ) 
virtual SPATMOD::IMAGE::STAGE::~STAGE (  )  [virtual]

Member Function Documentation

ERRVALUE SPATMOD::IMAGE::STAGE::ComputeMultivariateStats ( STAT_MULTIVAR Stats  ) 

Compute multivariate statistics for entire image.

This will read entire image once. Initialize() must be done before calling this function.

Parameters:
Stats Statistics returned
ERRVALUE SPATMOD::IMAGE::STAGE::ComputePixelRange ( const SECTION section,
PIXEL PixelValueMin,
PIXEL PixelValueMax,
RANGETYPE  accuracy = RANGETYPE_Maximal 
) [inline]

Compute pixel range for specified section.

The specified "accuracy" value may affect the method used to compute the range. If RANGETYPE_Typical is specified and the image supports zoom values lower than that specified, additional zooming may be used to improve performance. If RANGETYPE_Maximal is used, implementations may use previously computed aggregate ranges that cover the specified section, possibly up to the entire image extent. Initialize() must be done before calling this function.

Parameters:
section Image section, including zoom factor if desired
PixelValueMin Minimum pixel values returned
PixelValueMax Maximum pixel values returned
accuracy Desired range accuracy
ERRVALUE SPATMOD::IMAGE::STAGE::ComputePixelRange ( RANGETYPE  RangeType = RANGETYPE_Exact  ) 

Compute pixel range for image suitable for specified range type.

Will read entire image if necessary. Initialize() must be done before calling this function.

Parameters:
RangeType Required range type
ERRVALUE SPATMOD::IMAGE::STAGE::ComputeSampleStats ( STATSVALIDITY  StatsValidity  ) 

Compute statistics for image samples.

Will read entire image if necessary. Initialize() must be done before calling this function.

Parameters:
StatsValidity Required validity
double SPATMOD::IMAGE::STAGE::GetBestZoom ( double  ZoomDesired,
BESTZOOM  bestzoom 
) const

Get best allowed zoom value for specified zoom.

Parameters:
ZoomDesired Desired zoom value
bestzoom How to determine best zoom
ERRVALUE SPATMOD::IMAGE::STAGE::GetBoundingRegion ( REGION2D region  )  const [inline]

Get bounding region for image.

Default implementation returns image rectangular extents.

Parameters:
region Region in image coordinates returned
void SPATMOD::IMAGE::STAGE::GetMetadata ( MISTRING result,
METADATACONTENT  content,
METADATAFORMAT  format 
) const

Get metadata as string.

Parameters:
result Resulting string returned
content Requested content
format Formatting
void SPATMOD::IMAGE::STAGE::GetMetadataThisOnly ( MISTRING result,
METADATACONTENT  content,
METADATAFORMAT  format 
) const [protected]

Get metadata for this stage only.

Parameters:
result Resulting string returned
content Requested content
format Formatting
const STAT_UNIVARIATE* SPATMOD::IMAGE::STAGE::GetSampleStats ( UINT16  index  )  const

Get statistics for sample.

Returns:
Pointer to statistics, or NULL if none available
Parameters:
index Sample index
STATSVALIDITY SPATMOD::IMAGE::STAGE::GetSampleStatsValidity (  )  const [inline]

Get validity for sample statistics.

ERRVALUE SPATMOD::IMAGE::STAGE::Initialize (  ) 

Initialize stage.

Must be be called after construction and optional parameter settings before stage is inserted into pipeline.

ERRVALUE SPATMOD::IMAGE::STAGE::Pull ( const SECTION section,
BUFFER buffer 
)

Pull section of image into buffer.

If buffer has already been created it must match the specified section in size, and have the same pixel properties as the image. If buffer has not been created it will be created with the appropriate size and pixel properties.

Parameters:
section Section to pull data from
buffer Buffer to put data into
ERRVALUE SPATMOD::IMAGE::STAGE::PullBegin ( const SECTION_ITERATOR iterator  ) 

Begin pull of a specific section.

Should not be called directly except within v_PullBegin by class derived from FILTER. May be called multiple times.

ERRVALUE SPATMOD::IMAGE::STAGE::PullEnd (  ) 

Finish pulling subsections.

Should not be called directly except within v_PullEnd by class derived from FILTER.

ERRVALUE SPATMOD::IMAGE::STAGE::PullSubSection ( const SECTION SubSection,
BUFFER buffer 
)

Pull data for specified subsection into buffer.

Should not be called directly except within v_PullSubSection by class derived from FILTER.

ERRVALUE SPATMOD::IMAGE::STAGE::SetSampleStats ( const STAT_UNIVARIATE SampleStatsArray,
STATSVALIDITY  StatsValidity 
) [protected]

Set sample statistics array and validity.

Should only be used in implementations where v_Initialize can efficiently determine statistics.

void SPATMOD::IMAGE::STAGE::SetSampleStatsValidity ( STATSVALIDITY  StatsValidity  )  [protected]

Set validity of sample statistics.

Should only be called by override of v_ComputeSampleStats.

virtual ERRVALUE SPATMOD::IMAGE::STAGE::v_ComputePixelRange ( const SECTION section,
PIXEL PixelValueMin,
PIXEL PixelValueMax,
RANGETYPE  accuracy 
) [protected, virtual]

Compute pixel range for specified image section.

Implementations are not required to honor RANGETYPE_Exact requests if deemed too inefficient and may instead behave as though RANGETYPE_Maximal is used. Default implementation returns range for entire image if available and specified section is large, otherwise the requested section is read and the exact range determined.

Parameters:
section Section, including desired zoom value if allowed
PixelValueMin Minimum pixel value returned
PixelValueMax Maximum pixel value returned
accuracy Desired range accuracy
virtual ERRVALUE SPATMOD::IMAGE::STAGE::v_ComputeSampleStats ( STAT_UNIVARIATE SampleStatsArray,
STATSVALIDITY  StatsValidity 
) [private, virtual]

Compute statistics for image samples.

May read entire image if necessary. Default implementation will compute at less than 1X zoom if supported unless STATSVALIDITY_Exact used. Most implementations should override to maximize efficiency.

Parameters:
SampleStatsArray Array to contain statistics, dimension matches number of samples
StatsValidity Required validity
virtual ERRVALUE SPATMOD::IMAGE::STAGE::v_GetBoundingRegion ( REGION2D region  )  const [protected, virtual]

Get bounding region for image.

Default implementation returns image rectangular extents.

Parameters:
region Region in image coordinates returned
virtual void SPATMOD::IMAGE::STAGE::v_GetMetadata ( MISTRING result,
METADATACONTENT  content,
METADATAFORMAT  format 
) const [private, pure virtual]

Get metadata as string.

Parameters:
result Resulting string returned
content Requested content
format Formatting
virtual void SPATMOD::IMAGE::STAGE::v_GetMetadataThisOnly ( MISTRING result,
METADATACONTENT  content,
METADATAFORMAT  format 
) const [private, virtual]

Get metadata for this stage only.

Parameters:
result Resulting string returned
content Requested content
format Formatting
virtual ERRVALUE SPATMOD::IMAGE::STAGE::v_Initialize (  )  [private, pure virtual]

Initialize stage before insertion into pipeline.

Must do the following (in order), checking for error after each call. Validate all class-specific settings. Open any data sources/files if required. Call v_Initialize() on base class (if not private in base). Call SetAllProperties OR call SetPixelProperties(), SetTotalDimensions(), and SetTransToCRS(). Optionally call SetTileDimensions, SetPixelRange and/or other Set... methods needed. Preprocessing of source stages to determine properties may be done here or the first time v_PullBegin is called if does not affect base image properties.

Implemented in SPATMOD::IMAGE::FILTER_FOCAL, SPATMOD::IMAGE::FILTER_FOCALTOPOGRAPHIC, SPATMOD::IMAGE::FILTER_FUSION, SPATMOD::IMAGE::FILTER_LINEAR, SPATMOD::IMAGE::FILTER_MORPHOLOGY_DILATION, SPATMOD::IMAGE::FILTER_MORPHOLOGY_EROSION, SPATMOD::IMAGE::FILTER_MORPHOLOGY_OPENING, and SPATMOD::IMAGE::FILTER_MORPHOLOGY_CLOSING.

virtual ERRVALUE SPATMOD::IMAGE::STAGE::v_PullBegin ( const SECTION_ITERATOR iterator  )  [private, pure virtual]

Begin pull of a specific section.

May be called multiple times. If any extra processing is done it may be done the first time this is called if not done in v_Initialize.

Parameters:
iterator SubSection iterator to be used

Implemented in SPATMOD::IMAGE::FILTER, SPATMOD::IMAGE::FILTER_FOCAL, SPATMOD::IMAGE::FILTER_FOCALTOPOGRAPHIC, SPATMOD::IMAGE::FILTER_FUSION, SPATMOD::IMAGE::FILTER_MORPHOLOGY_DILATION, and SPATMOD::IMAGE::FILTER_MORPHOLOGY_EROSION.

virtual ERRVALUE SPATMOD::IMAGE::STAGE::v_PullEnd (  )  [private, pure virtual]

Finish pulling subsections.

Implemented in SPATMOD::IMAGE::FILTER, and SPATMOD::IMAGE::SOURCE.

virtual ERRVALUE SPATMOD::IMAGE::STAGE::v_PullSubSection ( const SECTION SubSection,
BUFFER buffer 
) [private, pure virtual]

Pull data for specified subsection into buffer.

Buffer provided may be larger than needed for subsection, in which case data not overwritten in buffer may be left unchanged for efficiency.

Parameters:
SubSection Current subsection to read
buffer Buffer to read into

Implemented in SPATMOD::IMAGE::FILTER_FOCALTOPOGRAPHIC, SPATMOD::IMAGE::FILTER_MORPHOLOGY_DILATION, SPATMOD::IMAGE::FILTER_MORPHOLOGY_EROSION, SPATMOD::IMAGE::FILTER_MORPHOLOGY_OPENING, and SPATMOD::IMAGE::FILTER_MORPHOLOGY_CLOSING.

virtual bool SPATMOD::IMAGE::STAGE::v_QueryCapability ( CAPABILITY  capability  )  const [protected, virtual]

Query image for specified capability.

Reimplemented from SPATMOD::IMAGE::BASE.

ERRVALUE SPATMOD::IMAGE::STAGE::ZoomCoordinates ( DPOINT2D PtsImage,
UINT32  NumPoints,
double  TgtZoom,
double  SrcZoom = 1 
) const

Apply zoom to coordinates as points.

Parameters:
PtsImage Points passed/returned in source/target image coordinates
NumPoints Number of points
TgtZoom Target zoom factor
SrcZoom Source zoom factor
ERRVALUE SPATMOD::IMAGE::STAGE::ZoomRectangle ( DRECT2D RectImage,
double  TgtZoom,
double  SrcZoom = 1 
) const

Apply zoom to rectangle.

Parameters:
RectImage Rectangle passed/returned in source/target image coordinates
TgtZoom Target zoom factor
SrcZoom Source zoom factor

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

Generated on Sun Oct 7 21:40:12 2012 for TNTsdk 2012 by  doxygen 1.6.1