Base class for image. More...
#include <spatmod/imagebase.h>

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 ®ion) 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 DIMENSIONS & | GetDimensions () const |
| ERRVALUE | GetGeoreference (GEOREFERENCE &georeference, double zoom) const |
| const GEOREFERENCE * | GetGeoreference () const |
| MILOG & | GetLog () |
| const MILOG & | GetLog () const |
| INT32 | GetNumColumnsOfTiles () const |
| double | GetNumColumnsPerTile (TILEPOSITION tileposition) const |
| INT32 | GetNumRowsOfTiles () const |
| double | GetNumRowsPerTile (TILEPOSITION tileposition) const |
| UINT16 | GetNumSamples () const |
| const PIXELTABLE * | GetPixelLookupTable () const |
| const PIXEL & | GetPixelProperties () const |
| RANGETYPE | GetPixelRangeType () const |
| PIXEL::TYPE | GetPixelType () const |
| const PIXEL & | GetPixelValueMax () const |
| const PIXEL & | GetPixelValueMin () 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 PIXELTABLE * | v_GetPixelLookupTable () const |
| virtual bool | v_QueryCapability (CAPABILITY capability) const |
| virtual float | v_QueryIterator (const SECTION_ITERATOR &iterator) const |
Protected Attributes | |
| PIXELTABLE * | m_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 |
Base class for image.
Contains image properties, provides no methods for reading/writing actual image data.
| SPATMOD::IMAGE::BASE::BASE | ( | ) |
Constructor.
| virtual SPATMOD::IMAGE::BASE::~BASE | ( | ) | [virtual] |
Destructor.
| void SPATMOD::IMAGE::BASE::AttachPixelLookupTable | ( | PIXELTABLE & | PixelTable | ) | [protected] |
Attach pixel lookup table (for PIXEL::TYPE_Indexed).
More efficient than SetPixelLookupTable.
| PixelTable | Pixel table to attach, return value will be empty |
Compute georeference region.
If image is not georeferenced returned region's CRS will be undefined.
| region | Region in georeference CRS returned |
| INT32 SPATMOD::IMAGE::BASE::ComputeTileColumn | ( | double | x, | |
| double | zoom = 1 | |||
| ) | const |
Compute tile column for specified image coordinate.
| 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.
| 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.
| dimensions | Dimensions returned | |
| zoom | Zoom/magnification factor |
| const DIMENSIONS& SPATMOD::IMAGE::BASE::GetDimensions | ( | ) | const [inline] |
Get dimensions of unzoomed image.
| 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.
| georeference | Georeference returned | |
| zoom | Zoom/magnification factor |
| const GEOREFERENCE* SPATMOD::IMAGE::BASE::GetGeoreference | ( | ) | const [inline] |
Get georeference of unzoomed image.
| 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.
| 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.
| tileposition | Tile position |
| INT32 SPATMOD::IMAGE::BASE::GetNumRowsOfTiles | ( | ) | const [inline] |
Get number of rows of tiles "down" the image.
| 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.
| 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).
| 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.
| UINT32 SPATMOD::IMAGE::BASE::GetTotalRows | ( | ) | const [inline] |
Get total number of rows in image.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| iterator | Iterator |
Reimplemented in SPATMOD::IMAGE::FILTER, and SPATMOD::IMAGE::TARGET_MGD.
PIXELTABLE* SPATMOD::IMAGE::BASE::m_pPixelLookupTable [protected] |
Pointer to pixel lookup table.
1.6.1