SPATMOD::IMAGE::BASE Class Reference

Base class for image. More...

#include <spatmod/imagebase.h>

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

List of all members.

Public Types

enum  CAPABILITY { CAPABILITY_Pull, CAPABILITY_Push }
enum  ZOOMABILITY { ZOOMABILITY_Only1X, ZOOMABILITY_List, ZOOMABILITY_Range }

Public Member Functions

 BASE ()
virtual ~BASE ()
ERRVALUE ComputeGeoreferenceRegion (REGION2D &region) const
INT32 ComputeTileColumn (double x, double zoom=1) const
INT32 ComputeTileRow (double y, double zoom=1) const
ERRVALUE GetDimensions (DIMENSIONS &dimensions, double zoom) const
const DIMENSIONSGetDimensions () const
ERRVALUE GetGeoreference (GEOREFERENCE &georeference, double zoom) const
const GEOREFERENCEGetGeoreference () const
MILOGGetLog ()
const MILOGGetLog () const
INT32 GetNumColumnsOfTiles () const
double GetNumColumnsPerTile (TILEPOSITION tileposition) const
INT32 GetNumRowsOfTiles () const
double GetNumRowsPerTile (TILEPOSITION tileposition) const
UINT16 GetNumSamples () const
const PIXELTABLEGetPixelLookupTable () const
const PIXELGetPixelProperties () const
RANGETYPE GetPixelRangeType () const
PIXEL::TYPE GetPixelType () const
const PIXELGetPixelValueMax () const
const PIXELGetPixelValueMin () const
UINT32 GetTotalColumns () const
UINT32 GetTotalRows () const
const char * GetTypeName () const
ZOOMABILITY GetZoomAbility (SIMPLE_ARRAY< double > &ZoomsAllowed) const
ERRVALUE LogCreate (const char *label=0, bool OnlyEnds=false, MILOG::MODE mode=MILOG::MODE_OwnFile)
bool QueryCapability (CAPABILITY capability) const
float QueryIterator (const SECTION_ITERATOR &iterator) const
bool QueryZoom (double zoom) const
void SetGeoreference (const GEOREFERENCE *pGeoreference)

Protected Member Functions

void AttachPixelLookupTable (PIXELTABLE &PixelTable)
void SetAllDimensions (const BASE &image)
void SetAllProperties (const BASE &image)
void SetDimensions (const DIMENSIONS &Dimensions)
void SetPixelLookupTable (const PIXELTABLE *pPixelTable)
void SetPixelProperties (const BASE &image)
void SetPixelProperties (const PIXEL &PixelProperties)
ERRVALUE SetPixelRange (const PIXEL &PixelValueMin, const PIXEL &PixelValueMax, RANGETYPE RangeType)
void SetPixelRangeDefault ()
ERRVALUE SetTileDimensions (double ColumnsPerTile, double RowsPerTile, double ColumnsPerTileFirst=0, double RowsPerTileFirst=0, double ColumnsPerTileLast=0, double RowsPerTileLast=0)
ERRVALUE SetTotalDimensions (UINT32 TotalColumns, UINT32 TotalRows)
virtual ERRVALUE v_GetGeoreference (GEOREFERENCE &georeference, double zoom) const
virtual const PIXELTABLEv_GetPixelLookupTable () const
virtual bool v_QueryCapability (CAPABILITY capability) const
virtual float v_QueryIterator (const SECTION_ITERATOR &iterator) const

Protected Attributes

PIXELTABLEm_pPixelLookupTable

Private Member Functions

virtual ERRVALUE v_GetDimensions (DIMENSIONS &dimensions, double zoom) const
virtual const char * v_GetTypeName () const
virtual ZOOMABILITY v_GetZoomAbility (SIMPLE_ARRAY< double > &ZoomsAllowed) const
virtual ERRVALUE v_LogCreate (const char *label, bool OnlyEnds, MILOG::MODE mode)=0

Detailed Description

Base class for image.

Contains image properties, provides no methods for reading/writing actual image data.


Member Enumeration Documentation

Enumeration of basic image capabilities.

Enumerator:
CAPABILITY_Pull 

Can "pull" from image.

CAPABILITY_Push 

Can "push" to image.

Enumeration of supported zoom abilities.

Enumerator:
ZOOMABILITY_Only1X 

Can only access with zoom = 1.

ZOOMABILITY_List 

Supports specific set of zoom values.

ZOOMABILITY_Range 

Supports any zoom in range.


Constructor & Destructor Documentation

SPATMOD::IMAGE::BASE::BASE (  ) 

Constructor.

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

Destructor.


Member Function Documentation

void SPATMOD::IMAGE::BASE::AttachPixelLookupTable ( PIXELTABLE PixelTable  )  [protected]

Attach pixel lookup table (for PIXEL::TYPE_Indexed).

More efficient than SetPixelLookupTable.

Parameters:
PixelTable Pixel table to attach, return value will be empty
ERRVALUE SPATMOD::IMAGE::BASE::ComputeGeoreferenceRegion ( REGION2D region  )  const

Compute georeference region.

If image is not georeferenced returned region's CRS will be undefined.

Parameters:
region Region in georeference CRS returned
INT32 SPATMOD::IMAGE::BASE::ComputeTileColumn ( double  x,
double  zoom = 1 
) const

Compute tile column for specified image coordinate.

Parameters:
x Image coordinate at specified zoom value
zoom Zoom/magnification factor
INT32 SPATMOD::IMAGE::BASE::ComputeTileRow ( double  y,
double  zoom = 1 
) const

Compute tile row for specified image coordinate.

Parameters:
y Image coordinate at specified zoom value
zoom Zoom/magnification factor
ERRVALUE SPATMOD::IMAGE::BASE::GetDimensions ( DIMENSIONS dimensions,
double  zoom 
) const

Get dimensions at specified zoom value.

If zoom is exactly 1, base image dimensions will be returned.

Parameters:
dimensions Dimensions returned
zoom Zoom/magnification factor
const DIMENSIONS& SPATMOD::IMAGE::BASE::GetDimensions (  )  const [inline]

Get dimensions of unzoomed image.

Returns:
Dimensions
ERRVALUE SPATMOD::IMAGE::BASE::GetGeoreference ( GEOREFERENCE georeference,
double  zoom 
) const

Get georeference at specified zoom value.

If zoom is exactly 1 and has base georeference, that will be returned. Will return error if image is not georeferenced or if zoom level is not supported.

Parameters:
georeference Georeference returned
zoom Zoom/magnification factor
const GEOREFERENCE* SPATMOD::IMAGE::BASE::GetGeoreference (  )  const [inline]

Get georeference of unzoomed image.

Returns:
Pointer to georeference or NULL if none.
MILOG& SPATMOD::IMAGE::BASE::GetLog (  )  [inline]

Access log (non-const).

const MILOG& SPATMOD::IMAGE::BASE::GetLog (  )  const [inline]

Access log (const).

INT32 SPATMOD::IMAGE::BASE::GetNumColumnsOfTiles (  )  const [inline]

Get number of columns of tiles "across" the image.

Returns:
Number of columns of tiles.
double SPATMOD::IMAGE::BASE::GetNumColumnsPerTile ( TILEPOSITION  tileposition  )  const [inline]

Get number of columns per tile.

Note that first and last tiles may have different sizes than each other or interior tiles. If GetNumColumnsOfTiles is less than 3 then will return 0 for TILEPOSITION_Interior. If GetNumColumnsOfTiles is less than 2 then the "last" tile will have same dimension as "first" tile.

Returns:
Number of columns per tile.
Parameters:
tileposition Tile position
INT32 SPATMOD::IMAGE::BASE::GetNumRowsOfTiles (  )  const [inline]

Get number of rows of tiles "down" the image.

Returns:
Number of rows of tiles.
double SPATMOD::IMAGE::BASE::GetNumRowsPerTile ( TILEPOSITION  tileposition  )  const [inline]

Get number of rows per tile.

Note that first and last tiles may have different sizes than each other or interior tiles. If GetNumRowsOfTiles is less than 3 then will return 0 for TILEPOSITION_Interior. If GetNumRowsOfTiles is less than 2 then the "last" tile will have same dimension as "first" tile.

Returns:
Number of rows per tile.
Parameters:
tileposition Tile position
UINT16 SPATMOD::IMAGE::BASE::GetNumSamples (  )  const [inline]

Get number of samples per pixel.

Same as GetPixelProperties().GetNumSamples().

const PIXELTABLE* SPATMOD::IMAGE::BASE::GetPixelLookupTable (  )  const [inline]

Get pixel lookup table (for images with PIXEL::TYPE_Indexed).

Returns:
Pointer to lookup table or NULL if none.
const PIXEL& SPATMOD::IMAGE::BASE::GetPixelProperties (  )  const [inline]

Get image pixel properties.

RANGETYPE SPATMOD::IMAGE::BASE::GetPixelRangeType (  )  const [inline]

Get type of pixel range available.

PIXEL::TYPE SPATMOD::IMAGE::BASE::GetPixelType (  )  const [inline]

Get pixel type.

Same as GetPixelProperties().GetPixelType().

const PIXEL& SPATMOD::IMAGE::BASE::GetPixelValueMax (  )  const [inline]

Get maximum pixel value.

Use GetPixelRangeType() to determine if specific to image.

Reimplemented in SPATMOD::IMAGE::TARGET_TILESET_FILE.

const PIXEL& SPATMOD::IMAGE::BASE::GetPixelValueMin (  )  const [inline]

Get minimum pixel value.

Use GetPixelRangeType() to determine if specific to image.

Reimplemented in SPATMOD::IMAGE::TARGET_TILESET_FILE.

UINT32 SPATMOD::IMAGE::BASE::GetTotalColumns (  )  const [inline]

Get total number of columns in image.

Returns:
Total image columns.
UINT32 SPATMOD::IMAGE::BASE::GetTotalRows (  )  const [inline]

Get total number of rows in image.

Returns:
Total image rows.
const char* SPATMOD::IMAGE::BASE::GetTypeName (  )  const [inline]

Get class type name, typically used for logging.

ZOOMABILITY SPATMOD::IMAGE::BASE::GetZoomAbility ( SIMPLE_ARRAY< double > &  ZoomsAllowed  )  const [inline]

Get zoom ability information.

The returned array will contain one or more values, the meaning of which depends on the ZOOMABILITY value returned. If ZOOMABILITY_Only1X, the returned array should be ignored and may be empty. If ZOOMABILITY_List, the returned array should contain a list of all supported zoom values (including 1.0). If ZOOMABILITY_Range, the returned array will contain exactly 2 values with the first being the minimum supported zoom and the last being the maximum. Returned values in the array should always be positive.

Parameters:
ZoomsAllowed Zoom values allowed, interpretation depends on return value
ERRVALUE SPATMOD::IMAGE::BASE::LogCreate ( const char *  label = 0,
bool  OnlyEnds = false,
MILOG::MODE  mode = MILOG::MODE_OwnFile 
)

Create log for entire pipeline.

Parameters:
label Label for log
OnlyEnds Only create log for source/target stages
mode Logging mode, must use MODE_OwnFile or MODE_SharedFile
bool SPATMOD::IMAGE::BASE::QueryCapability ( CAPABILITY  capability  )  const [inline]

Query image for specified capability.

float SPATMOD::IMAGE::BASE::QueryIterator ( const SECTION_ITERATOR iterator  )  const

Query support/efficiency for specified iterator.

Returns:
Efficiency between 0 and 1, 0 indicates not supported, 1 indicates most efficient.
Parameters:
iterator Iterator
bool SPATMOD::IMAGE::BASE::QueryZoom ( double  zoom  )  const

Query image for support of specified zoom value.

void SPATMOD::IMAGE::BASE::SetAllDimensions ( const BASE image  )  [protected]

Set all base dimensions from another image.

Set total and tile dimensions, and georeference.

Parameters:
image Image to set dimensions from
void SPATMOD::IMAGE::BASE::SetAllProperties ( const BASE image  )  [protected]

Set all base properties (except pixel lookup table) from another image.

Set total and tile dimensions, pixel properties, pixel range if defined, and georeference.

Parameters:
image Image to set properties from
void SPATMOD::IMAGE::BASE::SetDimensions ( const DIMENSIONS Dimensions  )  [protected]

Set dimensions.

void SPATMOD::IMAGE::BASE::SetGeoreference ( const GEOREFERENCE pGeoreference  ) 

Set georeference.

May be done after Initialize, but must usually be done before adding more stages to pipeline. A copy of the specified georeference is retained.

Parameters:
pGeoreference Pointer to georeference, NULL to remove previously set values
void SPATMOD::IMAGE::BASE::SetPixelLookupTable ( const PIXELTABLE pPixelTable  )  [protected]

Set pixel lookup table (for PIXEL::TYPE_Indexed).

A copy of the specified table is retained. Note, AttachPixelLookupTable is more efficient.

Parameters:
pPixelTable Pointer to lookup table, NULL to remove previously set table
void SPATMOD::IMAGE::BASE::SetPixelProperties ( const BASE image  )  [protected]

Set pixel properties, including range, from source image.

Parameters:
image Image to set properties from
void SPATMOD::IMAGE::BASE::SetPixelProperties ( const PIXEL PixelProperties  )  [protected]

Set pixel properties for image.

Will also reset pixel range to default.

ERRVALUE SPATMOD::IMAGE::BASE::SetPixelRange ( const PIXEL PixelValueMin,
const PIXEL PixelValueMax,
RANGETYPE  RangeType 
) [protected]

Set specific pixel range and type.

void SPATMOD::IMAGE::BASE::SetPixelRangeDefault (  )  [protected]

Set pixel range to default for pixel type.

Also set pixel range type to RANGETYPE_Default.

ERRVALUE SPATMOD::IMAGE::BASE::SetTileDimensions ( double  ColumnsPerTile,
double  RowsPerTile,
double  ColumnsPerTileFirst = 0,
double  RowsPerTileFirst = 0,
double  ColumnsPerTileLast = 0,
double  RowsPerTileLast = 0 
) [protected]

Set tile dimensions.

ERRVALUE SPATMOD::IMAGE::BASE::SetTotalDimensions ( UINT32  TotalColumns,
UINT32  TotalRows 
) [protected]

Set image dimensions.

Will reset tile dimensions to match image dimensions (resulting in "untiled" image).

virtual ERRVALUE SPATMOD::IMAGE::BASE::v_GetDimensions ( DIMENSIONS dimensions,
double  zoom 
) const [private, virtual]

Get dimensions at specified zoom value.

Must be overridden if image supports zooming, default implementation returns error.

Parameters:
dimensions Dimensions returned
zoom Zoom/magnification factor

Reimplemented in SPATMOD::IMAGE::FILTER.

virtual ERRVALUE SPATMOD::IMAGE::BASE::v_GetGeoreference ( GEOREFERENCE georeference,
double  zoom 
) const [protected, virtual]

Get georeference information.

Default implementation calculates by scaling, which assumes top and left edges are exactly coincident.

Reimplemented in SPATMOD::IMAGE::FILTER.

virtual const PIXELTABLE* SPATMOD::IMAGE::BASE::v_GetPixelLookupTable (  )  const [protected, virtual]

Get pixel lookup table.

Default implementation returns pointer if set and image has PIXEL::TYPE_Indexed, NULL otherwise.

Reimplemented in SPATMOD::IMAGE::FILTER, and SPATMOD::IMAGE::TARGET.

virtual const char* SPATMOD::IMAGE::BASE::v_GetTypeName (  )  const [private, virtual]

Get class type name.

Should always be overridden. Do not inline.

virtual ZOOMABILITY SPATMOD::IMAGE::BASE::v_GetZoomAbility ( SIMPLE_ARRAY< double > &  ZoomsAllowed  )  const [private, virtual]

Query image for support of specified zoom value.

Default implementation returns true if zoom==1 and false otherwise.

Parameters:
ZoomsAllowed Zoom values allowed, interpretation depends on return value

Reimplemented in SPATMOD::IMAGE::FILTER.

virtual ERRVALUE SPATMOD::IMAGE::BASE::v_LogCreate ( const char *  label,
bool  OnlyEnds,
MILOG::MODE  mode 
) [private, pure virtual]

Create log.

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

Query image for specified capability.

Reimplemented in SPATMOD::IMAGE::STAGE, and SPATMOD::IMAGE::TARGET.

virtual float SPATMOD::IMAGE::BASE::v_QueryIterator ( const SECTION_ITERATOR iterator  )  const [protected, virtual]

Query support/efficiency for specified stepping order.

Returns:
Efficiency between 0 and 1, 0 indicates not supported, 1 indicates most efficient. Default implementation returns 1 for STEPORDER_TileSequential, 1 for STEPORDER_FullSequential if only one column of tiles and 0 for all other cases.
Parameters:
iterator Iterator

Reimplemented in SPATMOD::IMAGE::FILTER, and SPATMOD::IMAGE::TARGET_MGD.


Member Data Documentation

Pointer to pixel lookup table.


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

Generated on Sun Oct 7 21:39:29 2012 for TNTsdk 2012 by  doxygen 1.6.1