MrSID Decode SDK for Raster Reference Manual 9.5.5.5244
LTIScene Class Reference

representation of a scene More...

#include <lti_scene.h>

Inheritance diagram for LTIScene:

Public Member Functions

 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
 
LTIScene & operator= (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...
 
High-precision point functions
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...
 
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 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...
 
Dimension functions
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...
 

Helper functions

double m_ulX
 returns the x-position of the upper-left point More...
 
double m_ulY
 returns the x-position of the upper-left point More...
 
double m_width
 returns the x-position of the upper-left point More...
 
double m_height
 returns the x-position of the upper-left point More...
 
double m_magnification
 returns the x-position of the upper-left point 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...
 
LTIScene clip (double width, double height) const
 return a clip scene to fit an image with size (width, height) More...
 

Detailed Description

This class represents a scene within an image. A scene contains these values:

  • an upper-left (x,y) position
  • a width and a height
  • a magnification

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.

  • const LTIScene scene(256, 256, 100, 100, 1.0); // center point
  • const LTIScene scene(512, 512, 100, 100, 2.0);
  • const LTIScene scene(128, 128, 100, 100, 0.5);
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 59 of file lti_scene.h.

Constructor & Destructor Documentation

◆ LTIScene() [1/4]

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
ulXupper left X position of scene
ulYupper left Y position of scene
widthwidth of scene
heightheight of scene
magnificationresolution of scene

◆ LTIScene() [2/4]

LTIScene::LTIScene ( const LTIScene &  copy)

◆ LTIScene() [3/4]

LTIScene::LTIScene ( void  )

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

◆ LTIScene() [4/4]

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

Member Function Documentation

◆ clip()

LTIScene LTIScene::clip ( double  width,
double  height 
) const
Parameters
widthmax x value
heightmax y value

◆ getCenterCol()

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

◆ getCenterRow()

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

◆ getCenterX()

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

◆ getCenterY()

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

◆ getHeight()

double LTIScene::getHeight ( ) const

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

Returns
the height

◆ getLowerLeftCol()

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

◆ getLowerLeftRow()

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

◆ getLowerLeftX()

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

◆ getLowerLeftY()

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

◆ getLowerRightCol()

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

◆ getLowerRightRow()

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

◆ getLowerRightX()

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

◆ getLowerRightY()

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

◆ getMag()

double LTIScene::getMag ( ) const

Returns the magnification of the scene.

Returns
the magnification

◆ getNumCols()

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.

◆ getNumRows()

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.

◆ getPoints() [1/4]

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
ulXthe upper-left x-position
ulYthe upper-left y-position
lrXthe lower-right x-position
lrYthe lower-right y-position

◆ getPoints() [2/4]

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
ulXthe upper-left x-position
ulYthe upper-left y-position
urXthe upper-right x-position
urYthe upper-right y-position
llXthe lower-left x-position
llYthe lower-left y-position
lrXthe lower-right x-position
lrYthe lower-right y-position
cXthe center x-position
cYthe center y-position

◆ getPoints() [3/4]

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
ulXthe upper-left x-position
ulYthe upper-left y-position
lrXthe lower-right x-position
lrYthe lower-right y-position

◆ getPoints() [4/4]

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
ulXthe upper-left x-position
ulYthe upper-left y-position
urXthe upper-right x-position
urYthe upper-right y-position
llXthe lower-left x-position
llYthe lower-left y-position
lrXthe lower-right x-position
lrYthe lower-right y-position
cXthe center x-position
cYthe center y-position

◆ getRect()

LTIGeomIntRect LTIScene::getRect ( void  ) const

◆ getUpperLeftCol()

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.

◆ getUpperLeftRow()

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.

◆ getUpperLeftX()

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

◆ getUpperLeftY()

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

◆ getUpperRightCol()

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

◆ getUpperRightRow()

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

◆ getUpperRightX()

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

◆ getUpperRightY()

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

◆ getWidth()

double LTIScene::getWidth ( ) const

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

Returns
the width

◆ getX()

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

◆ getY()

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

◆ operator!=()

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

◆ operator=()

LTIScene & LTIScene::operator= ( const LTIScene &  )

◆ operator==()

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

Member Data Documentation

◆ m_height

double LTIScene::m_height
protected

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

Definition at line 479 of file lti_scene.h.

◆ m_magnification

double LTIScene::m_magnification
protected

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

Definition at line 480 of file lti_scene.h.

◆ m_ulX

double LTIScene::m_ulX
protected

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

Definition at line 478 of file lti_scene.h.

◆ m_ulY

double LTIScene::m_ulY
protected

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

Definition at line 478 of file lti_scene.h.

◆ m_width

double LTIScene::m_width
protected

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

Definition at line 479 of file lti_scene.h.


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

Extensis