MrSID Decode SDK for Raster Reference Manual
9.1.0.4045
|
utility functions More...
#include <lti_utils.h>
Static Public Member Functions | |
static lt_uint8 | getMinNumSamplesPerPixel (LTIColorSpace colorspace) |
returns number of samples per pixel More... | |
static LTIColorSpace | getColorSpaceWithoutAlpha (LTIColorSpace colorspace) |
returns the colorspace without alpha channel flag More... | |
static bool | hasAlphaBand (LTIColorSpace colorspace) |
returns true with colorspace has alpha channel flags More... | |
static lt_uint8 | getNumBytes (LTIDataType datatype) |
returns number of bytes for a given a datatype More... | |
static bool | isSigned (LTIDataType datatype) |
returns true if datatype is signed More... | |
static bool | isIntegral (LTIDataType datatype) |
returns true if datatype is integral More... | |
static double | getMinValue (LTIDataType datatype) |
static double | getMaxValue (LTIDataType datatype) |
static bool | needsSwapping (LTIDataType datatype, LTIEndian byteOrder) |
static void | getVersionInfo (lt_uint32 &major, lt_uint32 &minor, lt_uint32 &revision, lt_uint32 &build, const char *&branch) |
get SDK version information More... | |
static const char * | getVersionString () |
get SDK version information as a string More... | |
Dynamic range conversion functions | |
static void | convertWindowLevelToMinMax (double window, double level, double &drmin, double &drmax) |
convert from window/level to min/max More... | |
static void | convertMinMaxToWindowLevel (double drmin, double drmax, double &window, double &level) |
convert from min/max to window/level More... | |
Mag/level conversion functions | |
static lt_int32 | magToLevel (double mag) |
convert mag to level More... | |
static double | levelToMag (lt_int32 level) |
convert level to mag More... | |
static double | snapToOctave (double mag, double threshold=0.41503749927884381) |
snap to octave More... | |
static double | snapToOctave (double mag, const LTIImageStage &imageStage, double threshold=0.41503749927884381) |
snap to octave More... | |
static bool | isOctave (double mag) |
convert mag to level More... | |
static lt_uint8 | getNumLevelsForIcon (lt_uint32 width, lt_uint32 height, lt_uint32 iconsize) |
get the number of levels needed to scale an image to a given icon size More... | |
static LT_STATUS | getDimsAtMag (lt_uint32 width, lt_uint32 height, double mag, lt_uint32 &scaledWidth, lt_uint32 &scaledHeight) |
get dimensions at an octave More... | |
The LTIUtils class contains a number of generally useful static functions, e.g. functions which operate on the enums declared in lti_types.h
Definition at line 31 of file lti_utils.h.
|
static |
This function converts a "minimum and maximum" style of dynamic range to a "window and level" style.
The "window" is defined as the width of the range, i.e. maximum - minimum + 1. The "level" is defined as the center of the window, i.e. minimum + 1/2 * window.
drmin | the dynamic range minimum value |
drmax | the dynamic range maximum value |
window | the window value |
level | the level value |
|
static |
This function converts a "window and level" style of dynamic range to a "minimum and maximum" style.
window | the window value |
level | the level value |
drmin | the dynamic range minimum value |
drmax | the dynamic range maximum value |
|
static |
colorspace | the colorspace to query |
|
static |
This function returns the dimensions of an image when scaled to the given magnification.
width | input width to be scaled |
height | input height to be scaled |
mag | the magnification to scale to |
scaledWidth | output width after scaling |
scaledHeight | output height after scaling |
|
static |
|
static |
This function returns the number of samples (bands) per pixel for the given colorspace, e.g. 3 for RGB. If the number of bands is not known for a given colorspace, 0 will be returned.
colorspace | the colorspace to query |
|
static |
|
static |
This function returns the number of bytes for a given datatype, e.g. 1 for LTI_DATATYPE_UINT8 or 4 for LTI_DATATYPE_FLOAT32.
datatype | the datatype to query |
|
static |
width | input image width |
height | input image height |
iconsize | desired icon size |
|
static |
This function returns SDK version and build information. The major, minor, and revision numbers correspond to the public SDK version number. For this SDK series, major will be 4. The revision number is used to indicate the intermediate release point, e.g. "Technology Preview 8". The build number and branch name are for internal use by LizardTech.
major | the major version number |
minor | the minor version number |
revision | the revision number |
build | the build number |
branch | the branch name |
|
static |
This function returns SDK version and build information as a formatted string. The string will be of the form "SDK Version MAJOR.MINOR.REVISION.BUILD.BRANCH", using the values returned from LTIUtils::getVersionInfo().
|
static |
colorspace | the colorspace to query |
|
static |
This function returns true if and only if the datatype is integral, i.e. not floating point.
datatype | the datatype to query |
|
static |
This function converts a "magnification" value to a "level" value.
Examples:
mag | the magnification value to convert |
|
static |
This function returns true if and only if the datatype can represent signed values.
datatype | the datatype to query |
|
static |
This function converts a "level" value to a "magnification" value.
See magToLevel() for examples.
level | the level value to convert |
|
static |
This function converts a "magnification" value to a "level" value.
Examples:
mag | the magnification value to convert |
|
static |
|
static |
This function rounds a magnification to the nearest larger "octave"
mag | the current magnification |
|
static |
This function rounds a magnification to the nearest larger "octave", with respect to a given image stage.
mag | the current magnification |
imageStage | used to provide min/max magnification bounds |
LizardTech |