LTIScene Class Reference

representation of a scene More...

#include <lti_scene.h>

Inheritance diagram for LTIScene:

LTINavigator

List of all members.

Public Member Functions

 LTIScene (double ulX, double ulY, double width, double height, double magnification)
 constructor
 LTIScene (const LTIScene &copy)
 copy constructor
 LTIScene (void)
 default constructor
 LTIScene (const LTIGeomIntRect &rect, double magnification)
LTIGeomIntRect getRect (void) const
LTISceneoperator= (const LTIScene &)
 assignment operator
bool operator== (const LTIScene &) const
 equality operator
bool operator!= (const LTIScene &) const
 equality operator
double getMag () const
 returns the magnification of the scene
LTIScene clip (double width, double height) const
 return a clip scene to fit an image with size (width, height)
High-precision point functions
double getUpperLeftX () const
 returns the x-position of the upper-left point
double getUpperLeftY () const
 returns the y-position of the upper-left point
double getLowerRightX () const
 returns the x-position of the lower-right point
double getLowerRightY () const
 returns the y-position of the lower-right point
double getUpperRightX () const
 returns the x-position of the upper-right point
double getUpperRightY () const
 returns the y-position of the upper-left point
double getLowerLeftX () const
 returns the x-position of the lower-left point
double getLowerLeftY () const
 returns the y-position of the lower-left point
double getCenterX () const
 returns the x-position of the center point
double getCenterY () const
 returns the x-position of the center point
Low-precision point functions
These functions return properly rounded integral values, to be used only when discretizing the pixels (for example to map to a buffer in memory).

lt_int32 getUpperLeftCol () const
 returns the x-position of the upper-left point
lt_int32 getUpperLeftRow () const
 returns the y-position of the upper-left point
lt_int32 getLowerRightCol () const
 returns the x-position of the lower-right point
lt_int32 getLowerRightRow () const
 returns the y-position of the lower-right point
lt_int32 getUpperRightCol () const
 returns the x-position of the upper-right point
lt_int32 getUpperRightRow () const
 returns the y-position of the upper-right point
lt_int32 getLowerLeftCol () const
 returns the x-position of the lower-left point
lt_int32 getLowerLeftRow () const
 returns the y-position of the lower-left point
lt_int32 getCenterCol () const
 returns the x-position of the center point
lt_int32 getCenterRow () const
 returns the y-position of the center point
Dimension functions
double getWidth () const
 returns the width of the scene
double getHeight () const
 returns the height of the scene
lt_int32 getNumCols () const
 returns the width of the scene
lt_int32 getNumRows () const
 returns the height of the scene
Helper functions
double getX () const
 returns the x-position of the upper-left point
double getY () const
 returns the y-position of the upper-left point
void getPoints (double &ulX, double &ulY, double &lrX, double &lrY) const
 returns the (x,y) positions of the upper-left and lower-right points
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
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
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

Protected Attributes

double m_ulX
double m_ulY
double m_width
double m_height
double m_magnification


Detailed Description

This class represents a scene within an image. A scene contains these values: The (X,Y) point is expressed in pixel-space (mag=1.0) coordinates, relative to the given magnification. The width and height are absolutes, i.e. they correspond to the buffer size the user expects.

The scene position and dimensions are maintained as high-precision values. Accessors are supplied to get the high-precision values as well as the properly rounded integral values (expressed in row/col form).

A mag value of 1.0 indicates full-size resolution. A mag greater than 1.0 indicates res-up (zoom in) by a factor of two: 2.0 gives an image 2x bigger, 4.0 gives an image 4x bigger, etc. A mag value less than 1.0 indicates a lower resolution: 0.5 gives a half-sized image, 0.25 gives a quarter-sized image, etc.

An LTIImageStage may not support the requested magnification: most readers only support mag=1.0, and MrSID readers only support power-of-two magnifications (0.25, 0.5, 1.0, 2.0, 4.0, etc). If the mag request cannot be returned the extraction will return an error.

An LTIScene is used to express the region of an image to be decoded via a call to LTIImageStage::decodeBegin(), etc.

As an example, consider an image which is 512x512 pixels. Then, the following scenes from the image will all contain the same upper-left point and all will be 100x100 pixels. The "granularity" (resolution) of each pixel, however, will differ.

Note:
Scenes may not require a buffer larger than 2GB.
Examples:

DecodeJP2ToBBB.cpp, DecodeJP2ToJPG.cpp, DecodeJP2ToMemory.cpp, DecodeMrSIDBandSelection.cpp, DecodeMrSIDToMemory.cpp, DecodeMrSIDToRaw.cpp, DecodeMrSIDToTIFF.cpp, DerivedImageFilter.cpp, DerivedImageReader.cpp, DerivedImageWriter.cpp, GeoScene.cpp, InterruptDelegate.cpp, Pipeline.cpp, ProgressDelegate.cpp, and SceneBuffer.cpp.

Definition at line 64 of file lti_scene.h.


Constructor & Destructor Documentation

LTIScene::LTIScene ( double  ulX,
double  ulY,
double  width,
double  height,
double  magnification 
)

This constructor produces a scene set to the given parameters, using double-precision.

Parameters:
ulX upper left X position of scene
ulY upper left Y position of scene
width width of scene
height height of scene
magnification resolution of scene

LTIScene::LTIScene ( const LTIScene copy  ) 

LTIScene::LTIScene ( void   ) 

This constructor will produce a scene with "invalid" default coordinates.

LTIScene::LTIScene ( const LTIGeomIntRect rect,
double  magnification 
)


Member Function Documentation

LTIGeomIntRect LTIScene::getRect ( void   )  const

LTIScene& LTIScene::operator= ( const LTIScene  ) 

bool LTIScene::operator== ( const LTIScene  )  const

bool LTIScene::operator!= ( const LTIScene  )  const

double LTIScene::getMag (  )  const

Returns the magnification of the scene.

Returns:
the magnification

double LTIScene::getUpperLeftX (  )  const

Returns the x-position of the upper-left point. This is a high-precision value.

Returns:
the x-position of the point

double LTIScene::getUpperLeftY (  )  const

Returns the y-position of the upper-left point. This is a high-precision value.

Returns:
the y-position of the point

double LTIScene::getLowerRightX (  )  const

Returns the x-position of the lower-right point. This is a high-precision value.

Returns:
the x-position of the point

double LTIScene::getLowerRightY (  )  const

Returns the y-position of the lower-right point. This is a high-precision value.

Returns:
the y-position of the point

double LTIScene::getUpperRightX (  )  const

Returns the x-position of the upper-right point. This is a high-precision value.

Returns:
the x-position of the point

double LTIScene::getUpperRightY (  )  const

Returns the y-position of the upper-left point. This is a high-precision value.

Returns:
the y-position of the point

double LTIScene::getLowerLeftX (  )  const

Returns the x-position of the lower-left point. This is a high-precision value.

Returns:
the x-position of the point

double LTIScene::getLowerLeftY (  )  const

Returns the y-position of the lower-left point. This is a high-precision value.

Returns:
the y-position of the point

double LTIScene::getCenterX (  )  const

Returns the x-position of the center point. This is a high-precision value.

Returns:
the x-position of the point

double LTIScene::getCenterY (  )  const

Returns the x-position of the center point. This is a high-precision value.

Returns:
the x-position of the point

lt_int32 LTIScene::getUpperLeftCol (  )  const

Returns the x-position of the upper-left point. This is a low-precision value.

Returns:
the x-position of the point
Examples:
DerivedImageReader.cpp.

lt_int32 LTIScene::getUpperLeftRow (  )  const

Returns the y-position of the upper-left point. This is a low-precision value.

Returns:
the y-position of the point
Examples:
DerivedImageReader.cpp.

lt_int32 LTIScene::getLowerRightCol (  )  const

Returns the x-position of the lower-right point. This is a low-precision value.

Returns:
the x-position of the point

lt_int32 LTIScene::getLowerRightRow (  )  const

Returns the y-position of the lower-right point. This is a low-precision value.

Returns:
the y-position of the point

lt_int32 LTIScene::getUpperRightCol (  )  const

Returns the x-position of the upper-right point. This is a low-precision value.

Returns:
the x-position of the point

lt_int32 LTIScene::getUpperRightRow (  )  const

Returns the y-position of the upper-right point. This is a low-precision value.

Returns:
the y-position of the point

lt_int32 LTIScene::getLowerLeftCol (  )  const

Returns the x-position of the lower-left point. This is a low-precision value.

Returns:
the x-position of the point

lt_int32 LTIScene::getLowerLeftRow (  )  const

Returns the y-position of the lower-left point. This is a low-precision value.

Returns:
the y-position of the point

lt_int32 LTIScene::getCenterCol (  )  const

Returns the x-position of the center point. This is a low-precision value.

Returns:
the x-position of the point

lt_int32 LTIScene::getCenterRow (  )  const

Returns the y-position of the center point. This is a low-precision value.

Returns:
the y-position of the point

double LTIScene::getWidth (  )  const

Returns the width of the scene. This is a high-precision value.

Returns:
the width

double LTIScene::getHeight (  )  const

Returns the height of the scene. This is a high-precision value.

Returns:
the height

lt_int32 LTIScene::getNumCols (  )  const

Returns the width of the scene. This is a low-precision value.

Returns:
the width
Examples:
DerivedImageFilter.cpp, DerivedImageReader.cpp, and DerivedImageWriter.cpp.

lt_int32 LTIScene::getNumRows (  )  const

Returns the height of the scene. This is a low-precision value.

Returns:
the height
Examples:
DerivedImageFilter.cpp, DerivedImageReader.cpp, and DerivedImageWriter.cpp.

double LTIScene::getX (  )  const

Returns the x-position of the upper-left point, as a high-precision value. This returns the same value as calling getUpperLeftX().

Returns:
the x-position of the point

double LTIScene::getY (  )  const

Returns the y-position of the upper-left point, as a high-precision value. This returns the same value as calling getUpperLeftY().

Returns:
the y-position of the point

void LTIScene::getPoints ( double &  ulX,
double &  ulY,
double &  lrX,
double &  lrY 
) const

Returns the (x,y) positions of the upper-left and lower-right points, as high-precision values.

Parameters:
ulX the upper-left x-position
ulY the upper-left y-position
lrX the lower-right x-position
lrY the lower-right y-position

void LTIScene::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, as high-precision values.

Parameters:
ulX the upper-left x-position
ulY the upper-left y-position
urX the upper-right x-position
urY the upper-right y-position
llX the lower-left x-position
llY the lower-left y-position
lrX the lower-right x-position
lrY the lower-right y-position
cX the center x-position
cY the center y-position

void LTIScene::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, as low-precision values.

Parameters:
ulX the upper-left x-position
ulY the upper-left y-position
lrX the lower-right x-position
lrY the lower-right y-position

void LTIScene::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, as low-precision values.

Parameters:
ulX the upper-left x-position
ulY the upper-left y-position
urX the upper-right x-position
urY the upper-right y-position
llX the lower-left x-position
llY the lower-left y-position
lrX the lower-right x-position
lrY the lower-right y-position
cX the center x-position
cY the center y-position

LTIScene LTIScene::clip ( double  width,
double  height 
) const

Parameters:
width max x value
height max y value


Member Data Documentation

double LTIScene::m_ulX [protected]

Definition at line 483 of file lti_scene.h.

double LTIScene::m_ulY [protected]

Definition at line 483 of file lti_scene.h.

double LTIScene::m_width [protected]

Definition at line 484 of file lti_scene.h.

double LTIScene::m_height [protected]

Definition at line 484 of file lti_scene.h.

double LTIScene::m_magnification [protected]

Definition at line 485 of file lti_scene.h.


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

LizardTech