![]() |
ImFusion SDK 4.3
|
Utility functions for working with OpenGL and/or GlImages. More...
Utility functions for working with OpenGL and/or GlImages.
Functions | |
std::pair< double, double > | shiftScaleStorageToNormalized (const ImageDescriptor &desc) |
Returns the storage vs. | |
std::pair< double, double > | shiftScaleOrignalToNormalized (const ImageDescriptor &desc) |
Returns the original vs. | |
double | storageToNormalized (const ImageDescriptor &desc, double intensity) |
Transforms the given image intensity as stored on the CPU to the normalized intensity range as it is retrieved in GLSL shaders. | |
double | storageToNormalized (const Image *image, double intensity) |
double | normalizedToStorage (const ImageDescriptor &desc, double intensity) |
Transforms the given image intensity from the normalized intensity range as it is retrieved in GLSL shaders to its actual value as stored on the CPU side. | |
double | normalizedToStorage (const Image *image, double intensity) |
vec2 | windowLevelOriginalToNormalized (const ImageDescriptor &desc, double window, double level) |
Transforms window/level from original value domain to normalized value domain. | |
vec2 | windowLevelOriginalToNormalized (const Image *image, double window, double level) |
vec2 | windowLevelNormalizedToOriginal (const ImageDescriptor &desc, double window, double level) |
Transforms window/level from normalized value domain to original value domain. | |
vec2 | windowLevelNormalizedToOriginal (const Image *image, double window, double level) |
bool | checkOpenGlStateDefaults () |
Checks that the current OpenGL state is according to the defined default values. | |
void | resetOpenGlStateDefaults () |
Resets the OpenGL state to the following results: | |
std::pair< double, double > shiftScaleStorageToNormalized | ( | const ImageDescriptor & | desc | ) |
Returns the storage vs.
normalized (in GL) constants {normShift, normScale}
such that
std::pair< double, double > shiftScaleOrignalToNormalized | ( | const ImageDescriptor & | desc | ) |
Returns the original vs.
normalized (in GL) constants {totalShift, totalScale}
such that
double storageToNormalized | ( | const ImageDescriptor & | desc, |
double | intensity ) |
Transforms the given image intensity as stored on the CPU to the normalized intensity range as it is retrieved in GLSL shaders.
Integral image types (both signed and unsigned) are mapped to [0, 1] range. Float image types keep their domain.
double normalizedToStorage | ( | const ImageDescriptor & | desc, |
double | intensity ) |
Transforms the given image intensity from the normalized intensity range as it is retrieved in GLSL shaders to its actual value as stored on the CPU side.
Integral image types (both signed and unsigned) are mapped from [0, 1] range. Float image types keep their domain.
vec2 windowLevelOriginalToNormalized | ( | const ImageDescriptor & | desc, |
double | window, | ||
double | level ) |
Transforms window/level from original value domain to normalized value domain.
The return value encodes (window, level) as vec2.
vec2 windowLevelNormalizedToOriginal | ( | const ImageDescriptor & | desc, |
double | window, | ||
double | level ) |
Transforms window/level from normalized value domain to original value domain.
The return value encodes (window, level) as vec2.
bool checkOpenGlStateDefaults | ( | ) |
Checks that the current OpenGL state is according to the defined default values.
All algorithms/renderers should reset the state to these settings when finished:
GL_DEPTH_DEST
: disabledglDepthFunc
: GL_LESSglClearDepth
: 1.0GL_BLEND
: disabledglBlendFunc
: GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHAGL_SCISSOR_TEST
: disabled void resetOpenGlStateDefaults | ( | ) |
Resets the OpenGL state to the following results:
GL_DEPTH_DEST
: disabledglDepthFunc
: GL_LESSglClearDepth
: 1.0GL_BLEND
: disabledglBlendFunc
: GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHAGL_SCISSOR_TEST
: disabled