MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
LTINavigator Class Reference

provides LTIScene movement control More...

#include <lti_navigator.h>

Inheritance diagram for LTINavigator:
LTIScene

Public Types

enum  Style { STYLE_LAX = 1, STYLE_STRICT = 2, STYLE_CLIP = 3 }
 Styles for scene-setting operations. More...
 

Public Member Functions

 LTINavigator (const LTIImage &image)
 default constructor More...
 
 LTINavigator (const LTIImage &image, const LTIScene &scene)
 constructor More...
 
 ~LTINavigator ()
 destructor More...
 
const LTIImagegetImage () const
 Returns the image the navigator is attached to. More...
 
bool isSceneValid () const
 is current scene is legal for the image More...
 
LT_STATUS moveBy (double xDelta, double yDelta, Style style)
 move by specified amount More...
 
LT_STATUS moveTo (double x, double y, Style style)
 move to specified amount More...
 
LT_STATUS zoomBy (double delta, Style style)
 zoom by specified amount More...
 
LT_STATUS zoomTo (double mag, Style style)
 zoom to specified scale More...
 
LT_STATUS bestFit (double maxWidth, double maxHeight, LTIScene &newScene)
 return scene large enough to fit window More...
 
void roundScene ()
 round scene to integral values More...
 
bool clipToImage ()
 clip scene to fit image More...
 
bool clipToScene (const LTIScene &scene)
 clip scene to fit given scene More...
 
LT_STATUS setScene (const LTIScene &scene, Style style)
 reset scene More...
 
LT_STATUS setSceneToIcon ()
 set scene to "icon" More...
 
LT_STATUS setSceneToFull ()
 set scene to full image More...
 
const LTIScenegetScene () const
 get current scene More...
 
LTIGeoCoord getGeoCoord () const
 returns the geographic coordinates of scene More...
 
Functions to set scene explicitly
LT_STATUS setSceneAsULWH (double upperLeftX, double upperLeftY, double width, double height, double magnification)
 set scene to given position More...
 
LT_STATUS setSceneAsULLR (double upperLeftX, double upperLeftY, double lowerRightX, double lowerRightY, double magnification)
 set scene to given position More...
 
LT_STATUS setSceneAsCWH (double centerX, double centerY, double width, double height, double magnification)
 sets scene to the given position More...
 
Functions to set scene explicitly, using geographic coordinates
LT_STATUS setSceneAsGeoULWH (double upperLeftX, double upperLeftY, double width, double height, double magnification)
 set scene to given position More...
 
LT_STATUS setSceneAsGeoULLR (double upperLeftX, double upperLeftY, double lowerRightX, double lowerRightY, double magnification)
 set scene to given position More...
 
LT_STATUS setSceneAsGeoCWH (double centerX, double centerY, double width, double height, double magnification)
 set scene to given position More...
 
- Public Member Functions inherited from LTIScene
 LTIScene (double ulX, double ulY, double width, double height, double magnification)
 constructor More...
 
 LTIScene (const LTIScene &copy)
 copy constructor More...
 
 LTIScene (void)
 default constructor More...
 
 LTIScene (const LTIGeomIntRect &rect, double magnification)
 
LTIGeomIntRect getRect (void) const
 
LTISceneoperator= (const LTIScene &)
 assignment operator More...
 
bool operator== (const LTIScene &) const
 equality operator More...
 
bool operator!= (const LTIScene &) const
 equality operator More...
 
double getMag () const
 returns the magnification of the scene More...
 
LTIScene clip (double width, double height) const
 return a clip scene to fit an image with size (width, height) More...
 
double getUpperLeftX () const
 returns the x-position of the upper-left point More...
 
double getUpperLeftY () const
 returns the y-position of the upper-left point More...
 
double getLowerRightX () const
 returns the x-position of the lower-right point More...
 
double getLowerRightY () const
 returns the y-position of the lower-right point More...
 
double getUpperRightX () const
 returns the x-position of the upper-right point More...
 
double getUpperRightY () const
 returns the y-position of the upper-left point More...
 
double getLowerLeftX () const
 returns the x-position of the lower-left point More...
 
double getLowerLeftY () const
 returns the y-position of the lower-left point More...
 
double getCenterX () const
 returns the x-position of the center point More...
 
double getCenterY () const
 returns the x-position of the center point More...
 
lt_int32 getUpperLeftCol () const
 returns the x-position of the upper-left point More...
 
lt_int32 getUpperLeftRow () const
 returns the y-position of the upper-left point More...
 
lt_int32 getLowerRightCol () const
 returns the x-position of the lower-right point More...
 
lt_int32 getLowerRightRow () const
 returns the y-position of the lower-right point More...
 
lt_int32 getUpperRightCol () const
 returns the x-position of the upper-right point More...
 
lt_int32 getUpperRightRow () const
 returns the y-position of the upper-right point More...
 
lt_int32 getLowerLeftCol () const
 returns the x-position of the lower-left point More...
 
lt_int32 getLowerLeftRow () const
 returns the y-position of the lower-left point More...
 
lt_int32 getCenterCol () const
 returns the x-position of the center point More...
 
lt_int32 getCenterRow () const
 returns the y-position of the center point More...
 
double getWidth () const
 returns the width of the scene More...
 
double getHeight () const
 returns the height of the scene More...
 
lt_int32 getNumCols () const
 returns the width of the scene More...
 
lt_int32 getNumRows () const
 returns the height of the scene More...
 
double getX () const
 returns the x-position of the upper-left point More...
 
double getY () const
 returns the y-position of the upper-left point More...
 
void getPoints (double &ulX, double &ulY, double &lrX, double &lrY) const
 returns the (x,y) positions of the upper-left and lower-right points More...
 
void getPoints (double &ulX, double &ulY, double &urX, double &urY, double &llX, double &llY, double &lrX, double &lrY, double &cX, double &cY) const
 returns the (x,y) positions of the center and corner points More...
 
void getPoints (lt_int32 &ulX, lt_int32 &ulY, lt_int32 &lrX, lt_int32 &lrY) const
 returns the (x,y) positions of the upper-left and lower-right points More...
 
void getPoints (lt_int32 &ulX, lt_int32 &ulY, lt_int32 &urX, lt_int32 &urY, lt_int32 &llX, lt_int32 &llY, lt_int32 &lrX, lt_int32 &lrY, lt_int32 &cX, lt_int32 &cY) const
 returns the (x,y) positions of the center and corner points More...
 

Protected Attributes

const LTIImagem_image
 
- Protected Attributes inherited from LTIScene
double m_ulX
 
double m_ulY
 
double m_width
 
double m_height
 
double m_magnification
 

Detailed Description

Class for navigating around an image. This class extends LTIScene by adding functions for moving the scene, resizing, zooming, etc.

Examples:
GeoScene.cpp.

Definition at line 30 of file lti_navigator.h.

Member Enumeration Documentation

These constants are used to define how to treat out-of-bounds conditions for scene-setting operations, i.e. when a calculated scene or magnification is not valid for our image.

Enumerator
STYLE_LAX 

if invalid scene, return success anyway

STYLE_STRICT 

if invalid scene, return an error code

STYLE_CLIP 

if invalid scene, clip scene to image and return success

Definition at line 39 of file lti_navigator.h.

Constructor & Destructor Documentation

LTINavigator::LTINavigator ( const LTIImage image)

This constructor creates an LTINavigator whose scene corresponds to the entire given image at magnification 1.0.

Parameters
imagethe image to be navigated within
LTINavigator::LTINavigator ( const LTIImage image,
const LTIScene scene 
)

This constructor creates an LTINavigator with the given scene.

Parameters
imagethe image to be navigated within
scenethe initial scene
LTINavigator::~LTINavigator ( )

Member Function Documentation

LT_STATUS LTINavigator::bestFit ( double  maxWidth,
double  maxHeight,
LTIScene newScene 
)

Returns a scene which fits the image to the given size. The scene will be the largest such that the entire image fits completely within the specified dimensions. A failure code will be returned if the request cannot be honored.

Note
This function does NOT stretch, upsample, or downsample the image; it will only determine the best fit within the bounds of the resolutions that the image supports, e.g. power-of-two.
Parameters
maxWidththe maximum width of the scene to return
maxHeightthe maximum height of the scene to return
newScenethe scene which fits the request
Returns
status code indicating success or failure
bool LTINavigator::clipToImage ( )

This function clips the current scene to the boundaries of the image at the current magnification.

Returns
true if the resulting scene contains any part of the image
bool LTINavigator::clipToScene ( const LTIScene scene)

This function clips the current scene to the boundaries of the given scene.

Returns
true if the resulting scene contains any part of the image
LTIGeoCoord LTINavigator::getGeoCoord ( ) const

Returns the geographic coordinates of the current scene.

Returns
the geo coordinates
const LTIImage& LTINavigator::getImage ( ) const
Returns
the navigator's image
const LTIScene& LTINavigator::getScene ( ) const

This function returns the current navigator scene, e.g. to be used in a call to LTIImageStage::read().

Note the returned object is volatile; caller should use copy ctor as needed.

Returns
the navigator scene
bool LTINavigator::isSceneValid ( ) const

Returns true if the current scene is legal for the image. If any part of the scene is outside the boundaries of the image or if the magnification is not supported by the image, false will be returned.

Returns
the navigator's image
LT_STATUS LTINavigator::moveBy ( double  xDelta,
double  yDelta,
Style  style 
)

Modifies the current scene by moving by the specified amount. (See also moveTo().)

Parameters
xDeltathe number of pixels to move horizontally
yDeltathe number of pixels to move vertically
stylehow to handle boundary conditions
Returns
status code indicating success or failure
LT_STATUS LTINavigator::moveTo ( double  x,
double  y,
Style  style 
)

Modifies the current scene by moving to the specified (x,y) position. (See also moveBy().)

Parameters
xthe x-position to move to
ythe y-position to move to
stylehow to handle boundary conditions
Returns
status code indicating success or failure
void LTINavigator::roundScene ( )

Modifies the current scene by performing proper integral rounding on the (x,y) position and the dimensions.

LT_STATUS LTINavigator::setScene ( const LTIScene scene,
Style  style 
)

This function manually resets the navigator scene to the given scene.

Parameters
scenethe new scene
styleboundary condition mode
Returns
status code indicating success or failure
LT_STATUS LTINavigator::setSceneAsCWH ( double  centerX,
double  centerY,
double  width,
double  height,
double  magnification 
)

Sets the scene to the given position. The position is specified using center/width-height values.

Parameters
centerXthe center x-position of the new scene
centerYthe center y-position of the new scene
widththe width of the new scene
heightthe height of the new scene
magnificationthe magnification of the new scene
Returns
status code indicating success or failure
LT_STATUS LTINavigator::setSceneAsGeoCWH ( double  centerX,
double  centerY,
double  width,
double  height,
double  magnification 
)

Sets the scene to the given position. The position is specified using center/width-height values. The values are in "geo" space, i.e. that of the LTIGeoCoord space.

Parameters
centerXthe center x-position of the new scene
centerYthe center y-position of the new scene
widththe width of the new scene
heightthe height of the new scene
magnificationthe magnification of the new scene
Returns
status code indicating success or failure
LT_STATUS LTINavigator::setSceneAsGeoULLR ( double  upperLeftX,
double  upperLeftY,
double  lowerRightX,
double  lowerRightY,
double  magnification 
)

Sets the scene to the given position. The position is specified using upper-left/lower-right values. The values are in "geo" space, i.e. that of the LTIGeoCoord space.

Parameters
upperLeftXthe upper-left x-position of the new scene
upperLeftYthe upper-left y-position of the new scene
lowerRightXthe lower-right x-position of the new scene
lowerRightYthe lower-right y-position of the new scene
magnificationthe magnification of the new scene
Returns
status code indicating success or failure
LT_STATUS LTINavigator::setSceneAsGeoULWH ( double  upperLeftX,
double  upperLeftY,
double  width,
double  height,
double  magnification 
)

Sets the scene to the given position. The position is specified using upper-left/width-height values. The values are in "geo" space, i.e. that of the LTIGeoCoord space.

Parameters
upperLeftXthe upper-left x-position of the new scene
upperLeftYthe upper-left y-position of the new scene
widththe width of the new scene
heightthe height of the new scene
magnificationthe magnification of the new scene
Returns
status code indicating success or failure
LT_STATUS LTINavigator::setSceneAsULLR ( double  upperLeftX,
double  upperLeftY,
double  lowerRightX,
double  lowerRightY,
double  magnification 
)

Sets the scene to the given position. The position is specified using upper-left/lower-right values.

Parameters
upperLeftXthe upper-left x-position of the new scene
upperLeftYthe upper-left y-position of the new scene
lowerRightXthe lower-right x-position of the new scene
lowerRightYthe lower-right y-position of the new scene
magnificationthe magnification of the new scene
Returns
status code indicating success or failure
LT_STATUS LTINavigator::setSceneAsULWH ( double  upperLeftX,
double  upperLeftY,
double  width,
double  height,
double  magnification 
)

Sets the scene to the given position. The position is specified using upper-left/width-height values.

Parameters
upperLeftXthe upper-left x-position of the new scene
upperLeftYthe upper-left y-position of the new scene
widththe width of the new scene
heightthe height of the new scene
magnificationthe magnification of the new scene
Returns
status code indicating success or failure
LT_STATUS LTINavigator::setSceneToFull ( )

This function sets the navigator scene to the entire image at full resolution.

Returns
status code indicating success or failure
LT_STATUS LTINavigator::setSceneToIcon ( )

This function sets the navigator scene to the icon (the smallest magnification this image can be represented at).

Returns
status code indicating success or failure
LT_STATUS LTINavigator::zoomBy ( double  delta,
Style  style 
)

Modifies the current scene by zooming by the specified scale factor. (See also zoomTo().) The other scene parameters (x, y, width, height) are unaffected, unless the style parameter is used.

For example, a call zoomBy(2.0) will double the magnification.

Parameters
deltathe zoom factor
stylehow to handle boundary conditions
Returns
status code indicating success or failure
LT_STATUS LTINavigator::zoomTo ( double  mag,
Style  style 
)

Modifies the current scene by zooming to the specified scale. (See also zoomBy().) The other scene parameters (x, y, width, height) are unaffected, unless the style parameter is used.

For example, a call zoomBy(2.0) will double the magnification.

Parameters
magthe magnification to change to
stylehow to handle boundary conditions
Returns
status code indicating success or failure

Member Data Documentation

const LTIImage& LTINavigator::m_image
protected

Definition at line 369 of file lti_navigator.h.


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

LizardTech