svcore  1.9
LogRange Class Reference

#include <LogRange.h>

List of all members.

Static Public Member Functions

static void mapRange (float &min, float &max, float thresh=-10)
 Map a linear range onto a logarithmic range.
static float map (float value, float thresh=-10)
 Map a value onto a logarithmic range.
static float unmap (float value)
 Map a value from the logarithmic range back again.
static bool useLogScale (std::vector< float > values)
 Estimate whether a set of values would be more properly shown using a logarithmic than a linear scale.

Detailed Description

Definition at line 22 of file LogRange.h.


Member Function Documentation

void LogRange::mapRange ( float &  min,
float &  max,
float  thresh = -10 
) [static]

Map a linear range onto a logarithmic range.

min and max are passed as the extents of the linear range and returned as the extents of the logarithmic range. thresh is the minimum value for the log range, to be used if the linear range spans zero.

Definition at line 24 of file LogRange.cpp.

float LogRange::map ( float  value,
float  thresh = -10 
) [static]

Map a value onto a logarithmic range.

This just means taking the base-10 log of the absolute value, or using the threshold value if the absolute value is zero.

Definition at line 65 of file LogRange.cpp.

float LogRange::unmap ( float  value) [static]

Map a value from the logarithmic range back again.

This just means taking the value'th power of ten.

Definition at line 72 of file LogRange.cpp.

bool LogRange::useLogScale ( std::vector< float >  values) [static]

Estimate whether a set of values would be more properly shown using a logarithmic than a linear scale.

This is only ever going to be a rough guess.

Definition at line 94 of file LogRange.cpp.

References sd(), and SVDEBUG.

Referenced by EditableDenseThreeDimensionalModel::shouldUseLogValueScale().


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