#include <lti_navigator.h>
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 LTIImage & | getImage () 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 LTIScene & | getScene () 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 LTIImage & | m_image |
Definition at line 30 of file lti_navigator.h.
enum LTINavigator::Style |
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.
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.
LTINavigator::LTINavigator | ( | const LTIImage & | image | ) |
This constructor creates an LTINavigator whose scene corresponds to the entire given image at magnification 1.0.
image | the image to be navigated within |
This constructor creates an LTINavigator with the given scene.
image | the image to be navigated within | |
scene | the initial scene |
LTINavigator::~LTINavigator | ( | ) |
const LTIImage& LTINavigator::getImage | ( | ) | const |
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.
Modifies the current scene by moving by the specified amount. (See also moveTo().)
xDelta | the number of pixels to move horizontally | |
yDelta | the number of pixels to move vertically | |
style | how to handle boundary conditions |
Modifies the current scene by moving to the specified (x,y) position. (See also moveBy().)
x | the x-position to move to | |
y | the y-position to move to | |
style | how to handle boundary conditions |
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.
delta | the zoom factor | |
style | how to handle boundary conditions |
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.
mag | the magnification to change to | |
style | how to handle boundary conditions |
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.
maxWidth | the maximum width of the scene to return | |
maxHeight | the maximum height of the scene to return | |
newScene | the scene which fits the request |
void LTINavigator::roundScene | ( | ) |
Modifies the current scene by performing proper integral rounding on the (x,y) position and the dimensions.
bool LTINavigator::clipToImage | ( | ) |
This function clips the current scene to the boundaries of the image at the current magnification.
bool LTINavigator::clipToScene | ( | const LTIScene & | scene | ) |
This function clips the current scene to the boundaries of the given scene.
This function manually resets the navigator scene to the given scene.
scene | the new scene | |
style | boundary condition mode |
LT_STATUS LTINavigator::setSceneToIcon | ( | ) |
This function sets the navigator scene to the icon (the smallest magnification this image can be represented at).
LT_STATUS LTINavigator::setSceneToFull | ( | ) |
This function sets the navigator scene to the entire image at full resolution.
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.
LTIGeoCoord LTINavigator::getGeoCoord | ( | ) | const |
Returns the geographic coordinates of the current scene.
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.
upperLeftX | the upper-left x-position of the new scene | |
upperLeftY | the upper-left y-position of the new scene | |
width | the width of the new scene | |
height | the height of the new scene | |
magnification | the magnification of the new scene |
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.
upperLeftX | the upper-left x-position of the new scene | |
upperLeftY | the upper-left y-position of the new scene | |
lowerRightX | the lower-right x-position of the new scene | |
lowerRightY | the lower-right y-position of the new scene | |
magnification | the magnification of the new scene |
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.
centerX | the center x-position of the new scene | |
centerY | the center y-position of the new scene | |
width | the width of the new scene | |
height | the height of the new scene | |
magnification | the magnification of the new scene |
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.
upperLeftX | the upper-left x-position of the new scene | |
upperLeftY | the upper-left y-position of the new scene | |
width | the width of the new scene | |
height | the height of the new scene | |
magnification | the magnification of the new scene |
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.
upperLeftX | the upper-left x-position of the new scene | |
upperLeftY | the upper-left y-position of the new scene | |
lowerRightX | the lower-right x-position of the new scene | |
lowerRightY | the lower-right y-position of the new scene | |
magnification | the magnification of the new scene |
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.
centerX | the center x-position of the new scene | |
centerY | the center y-position of the new scene | |
width | the width of the new scene | |
height | the height of the new scene | |
magnification | the magnification of the new scene |
const LTIImage& LTINavigator::m_image [protected] |
Definition at line 369 of file lti_navigator.h.
LizardTech |