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

List of all members.

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
 LTINavigator (const LTIImage &image, const LTIScene &scene)
 constructor
 ~LTINavigator ()
 destructor
const LTIImagegetImage () const
 Returns the image the navigator is attached to.
bool isSceneValid () const
 is current scene is legal for the image
LT_STATUS moveBy (double xDelta, double yDelta, Style style)
 move by specified amount
LT_STATUS moveTo (double x, double y, Style style)
 move to specified amount
LT_STATUS zoomBy (double delta, Style style)
 zoom by specified amount
LT_STATUS zoomTo (double mag, Style style)
 zoom to specified scale
LT_STATUS bestFit (double maxWidth, double maxHeight, LTIScene &newScene)
 return scene large enough to fit window
void roundScene ()
 round scene to integral values
bool clipToImage ()
 clip scene to fit image
bool clipToScene (const LTIScene &scene)
 clip scene to fit given scene
LT_STATUS setScene (const LTIScene &scene, Style style)
 reset scene
LT_STATUS setSceneToIcon ()
 set scene to "icon"
LT_STATUS setSceneToFull ()
 set scene to full image
const LTIScenegetScene () const
 get current scene
LTIGeoCoord getGeoCoord () const
 returns the geographic coordinates of scene
Functions to set scene explicitly
LT_STATUS setSceneAsULWH (double upperLeftX, double upperLeftY, double width, double height, double magnification)
 set scene to given position
LT_STATUS setSceneAsULLR (double upperLeftX, double upperLeftY, double lowerRightX, double lowerRightY, double magnification)
 set scene to given position
LT_STATUS setSceneAsCWH (double centerX, double centerY, double width, double height, double magnification)
 sets scene to the given position
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
LT_STATUS setSceneAsGeoULLR (double upperLeftX, double upperLeftY, double lowerRightX, double lowerRightY, double magnification)
 set scene to given position
LT_STATUS setSceneAsGeoCWH (double centerX, double centerY, double width, double height, double magnification)
 set scene to given position

Protected Attributes

const LTIImagem_image

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

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

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

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

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

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

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

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

Returns:
status code indicating success or failure

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: