KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
kjb::Colormap Class Reference

#include <i_colormap.h>

Public Types

typedef std::vector< PixelRGBA >(* Preset_map_func )(int)
 

Public Member Functions

 Colormap (const std::string &name="jet", int n=64)
 
 Colormap (const char *name, int n=64)
 
void preset (const std::string &name, int n=64)
 
PixelRGBA operator() (double x) const
 
size_t size () const
 

Static Public Member Functions

static std::vector< PixelRGBAjet (int n)
 
static std::vector< PixelRGBAhot (int n)
 
static std::vector< PixelRGBAhsv (int n)
 
static std::vector< PixelRGBAgray (int n)
 
static std::vector< PixelRGBAcool (int n)
 
static std::vector< PixelRGBAlines (int n)
 

Public Attributes

std::vector< PixelRGBAcolors_
 

Static Public Attributes

static std::map< std::string,
Preset_map_func
presets_
 

Member Typedef Documentation

typedef std::vector<PixelRGBA>(* kjb::Colormap::Preset_map_func)(int)

Constructor & Destructor Documentation

kjb::Colormap::Colormap ( const std::string &  name = "jet",
int  n = 64 
)
inline
kjb::Colormap::Colormap ( const char *  name,
int  n = 64 
)
inline

Member Function Documentation

std::vector< PixelRGBA > kjb::Colormap::cool ( int  n)
static
std::vector< PixelRGBA > kjb::Colormap::gray ( int  n)
static
std::vector< PixelRGBA > kjb::Colormap::hot ( int  n)
static
std::vector< PixelRGBA > kjb::Colormap::hsv ( int  n)
static
std::vector< PixelRGBA > kjb::Colormap::jet ( int  n)
static
std::vector< PixelRGBA > kjb::Colormap::lines ( int  n)
static
PixelRGBA kjb::Colormap::operator() ( double  x) const
inline

Convert value in [0.0, 1.0] to corresponding color in map. Values will be clamped to [0.0, 1.0]

void kjb::Colormap::preset ( const std::string &  name,
int  n = 64 
)
inline
size_t kjb::Colormap::size ( ) const
inline

Member Data Documentation

std::vector<PixelRGBA> kjb::Colormap::colors_
std::map< std::string, Colormap::Preset_map_func > kjb::Colormap::presets_
static
Initial value:
= boost::assign::map_list_of<std::string, Colormap::Preset_map_func>
("jet", Colormap::jet)
("hot", Colormap::hot)
("hsv", Colormap::hsv)
("gray", Colormap::gray)
("cool", Colormap::cool)
("lines", Colormap::lines)

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