#include <lti_utils.h>
Static Public Member Functions | |
static lt_uint8 | getMinNumSamplesPerPixel (LTIColorSpace colorspace) |
returns number of samples per pixel | |
static LTIColorSpace | getColorSpaceWithoutAlpha (LTIColorSpace colorspace) |
returns the colorspace without alpha channel flag | |
static bool | hasAlphaBand (LTIColorSpace colorspace) |
returns true with colorspace has alpha channel flags | |
static lt_uint8 | getNumBytes (LTIDataType datatype) |
returns number of bytes for a given a datatype | |
static bool | isSigned (LTIDataType datatype) |
returns true if datatype is signed | |
static bool | isIntegral (LTIDataType datatype) |
returns true if datatype is integral | |
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 | |
static const char * | getVersionString () |
get SDK version information as a string | |
Dynamic range conversion functions | |
static void | convertWindowLevelToMinMax (double window, double level, double &drmin, double &drmax) |
convert from window/level to min/max | |
static void | convertMinMaxToWindowLevel (double drmin, double drmax, double &window, double &level) |
convert from min/max to window/level | |
Mag/level conversion functions | |
static lt_int32 | magToLevel (double mag) |
convert mag to level | |
static double | levelToMag (lt_int32 level) |
convert level to mag | |
static double | snapToOctave (double mag, double threshold=0.41503749927884381) |
snap to octave | |
static double | snapToOctave (double mag, const LTIImageStage &imageStage, double threshold=0.41503749927884381) |
snap to octave | |
static bool | isOctave (double mag) |
convert mag to level | |
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 | |
static LT_STATUS | getDimsAtMag (lt_uint32 width, lt_uint32 height, double mag, lt_uint32 &scaledWidth, lt_uint32 &scaledHeight) |
get dimensions at an octave |
Definition at line 31 of file lti_utils.h.
static lt_uint8 LTIUtils::getMinNumSamplesPerPixel | ( | LTIColorSpace | colorspace | ) | [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 LTIColorSpace LTIUtils::getColorSpaceWithoutAlpha | ( | LTIColorSpace | colorspace | ) | [static] |
colorspace | the colorspace to query |
static bool LTIUtils::hasAlphaBand | ( | LTIColorSpace | colorspace | ) | [static] |
colorspace | the colorspace to query |
static lt_uint8 LTIUtils::getNumBytes | ( | LTIDataType | datatype | ) | [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 bool LTIUtils::isSigned | ( | LTIDataType | datatype | ) | [static] |
This function returns true if and only if the datatype can represent signed values.
datatype | the datatype to query |
static bool LTIUtils::isIntegral | ( | LTIDataType | datatype | ) | [static] |
This function returns true if and only if the datatype is integral, i.e. not floating point.
datatype | the datatype to query |
static double LTIUtils::getMinValue | ( | LTIDataType | datatype | ) | [static] |
static double LTIUtils::getMaxValue | ( | LTIDataType | datatype | ) | [static] |
static bool LTIUtils::needsSwapping | ( | LTIDataType | datatype, | |
LTIEndian | byteOrder | |||
) | [static] |
static void LTIUtils::convertWindowLevelToMinMax | ( | double | window, | |
double | level, | |||
double & | drmin, | |||
double & | drmax | |||
) | [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 void LTIUtils::convertMinMaxToWindowLevel | ( | double | drmin, | |
double | drmax, | |||
double & | window, | |||
double & | level | |||
) | [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 lt_int32 LTIUtils::magToLevel | ( | double | mag | ) | [static] |
This function converts a "magnification" value to a "level" value.
Examples:
mag | the magnification value to convert |
static double LTIUtils::levelToMag | ( | lt_int32 | level | ) | [static] |
This function converts a "level" value to a "magnification" value.
See magToLevel() for examples.
level | the level value to convert |
static double LTIUtils::snapToOctave | ( | double | mag, | |
double | threshold = 0.41503749927884381 | |||
) | [static] |
This function rounds a magnification to the nearest larger "octave"
mag | the current magnification |
static double LTIUtils::snapToOctave | ( | double | mag, | |
const LTIImageStage & | imageStage, | |||
double | threshold = 0.41503749927884381 | |||
) | [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 |
static bool LTIUtils::isOctave | ( | double | mag | ) | [static] |
This function converts a "magnification" value to a "level" value.
Examples:
mag | the magnification value to convert |
static lt_uint8 LTIUtils::getNumLevelsForIcon | ( | lt_uint32 | width, | |
lt_uint32 | height, | |||
lt_uint32 | iconsize | |||
) | [static] |
width | input image width | |
height | input image height | |
iconsize | desired icon size |
static LT_STATUS LTIUtils::getDimsAtMag | ( | lt_uint32 | width, | |
lt_uint32 | height, | |||
double | mag, | |||
lt_uint32 & | scaledWidth, | |||
lt_uint32 & | scaledHeight | |||
) | [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 void LTIUtils::getVersionInfo | ( | lt_uint32 & | major, | |
lt_uint32 & | minor, | |||
lt_uint32 & | revision, | |||
lt_uint32 & | build, | |||
const char *& | branch | |||
) | [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 const char* LTIUtils::getVersionString | ( | ) | [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().
LizardTech |