ImFusion SDK 4.3
ImagePyramid Class Reference

#include <ImFusion/GL/ImagePyramid.h>

Represents a pyramid of images with decreasing resolution. More...

+ Inheritance diagram for ImagePyramid:

Detailed Description

Represents a pyramid of images with decreasing resolution.

The first level will always be the original image. All other levels are generated and owned by the object.

Public Member Functions

 ImagePyramid (SharedImage *input, bool nearestInterpolation=false, bool useCPU=false, bool approximateUniformSpacing=true)
 Creates a pyramid with one level.
 
const std::vector< SharedImage * > & levels () const
 Returns a list of all levels sorted from highest to lowest resolution.
 
SharedImagelevel (int i) const
 Returns the image at level i (or nullptr if the level does not exist);.
 
int createLevels (int numLevels)
 Creates and initializes the levels of the pyramid.
 
void propagateUp (int level)
 Upsamples the contents of a level to its direct (higher-resolution) predecessor.
 
void propagateDown (int level)
 Updates the contents of a level to its direct (lower-resolution) child.
 
int size () const
 Returns the current number of levels.
 
bool explicitlyResampleMask ()
 If true, creates a downsampled ExplicitMask.
 
void setExplicitlyResampleMask (bool explicitlyResampleMask)
 If set to true, creates a downsampled ExplicitMask.
 
void setPreserveMaskedPixelsOnPropagateUp (bool preserveMaskedPixelsOnPropagateUp)
 If true, masked values in the next higher level will not be overridden by propagateUp.
 

Protected Attributes

std::vector< SharedImage * > m_levels
 
GL::ImageProgramm_programDown = nullptr
 
GL::ImageProgramm_programUp = nullptr
 
std::vector< ImageDownsamplerm_cpuDownsamplers
 
bool m_useCPU
 
bool m_nearestNeighborInterpolation
 
bool m_approximateUniformSpacing = true
 If true, downsample along denser (in terms of spacing) dimensions first.
 
bool m_explicitlyResampleMask = true
 If true, creates a downsampled ExplicitMask.
 
bool m_preserveMaskedPixelsOnPropagateUp = false
 Don't update masked pixel on propagateUp.
 

Member Function Documentation

◆ createLevels()

int createLevels ( int numLevels)

Creates and initializes the levels of the pyramid.

Existing levels are deleted. The minimum number of levels will always be one. Each level is computed by downsampling the previous level by factor 2. Once a dimension reaches a size of 2 pixels, it will not be downsampled any further. When all dimension reach this minimum before the desired number of levels is reached, no more levels will be added. If the input image has a mask, the lower levels will be assigned either a downsampled ExplicitMask (independend of the input mask type), a mask that evaluates the original mask directly on the dowsampled image (

See also
m_resampleMask) The mask of the input remains unchanged.
Returns
the actual number of levels.

◆ propagateUp()

void propagateUp ( int level)

Upsamples the contents of a level to its direct (higher-resolution) predecessor.

This method only propagates to the next level and NOT recursively to any further levels. Masks will not be propagated.

Parameters
level

◆ explicitlyResampleMask()

bool explicitlyResampleMask ( )
inline

If true, creates a downsampled ExplicitMask.

If false, uses the mask directly with the texture-coordinates of the downsampled image.

◆ setExplicitlyResampleMask()

void setExplicitlyResampleMask ( bool explicitlyResampleMask)
inline

If set to true, creates a downsampled ExplicitMask.

If false, uses the mask directly with the texture-coordinates of the downsampled image.

Member Data Documentation

◆ m_approximateUniformSpacing

bool m_approximateUniformSpacing = true
protected

If true, downsample along denser (in terms of spacing) dimensions first.

To use this, isMetric of the ImageDescriptor of input SharedImage must be true.

◆ m_explicitlyResampleMask

bool m_explicitlyResampleMask = true
protected

If true, creates a downsampled ExplicitMask.

If false, uses the mask directly with the texture-coordinates of the downsampled image.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close