1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14#ifndef OSGSIM_SCALARSTCOLORS
15#define OSGSIM_SCALARSTCOLORS 1
17#include <osgSim/Export>
20#include <osg/Referenced>
25ScalarsToColors defines the interface to map a scalar value to a color,
26and provides a default implementation of the mapping functionaltity,
27with colors ranging from black to white across the min - max scalar
30class OSGSIM_EXPORT ScalarsToColors: public osg::Referenced
34 ScalarsToColors(float scalarMin, float scalarMax);
35 virtual ~ScalarsToColors() {}
37 /** Get the color for a given scalar value. */
38 virtual osg::Vec4 getColor(float scalar) const;
40 /** Get the minimum scalar value. */
43 /** Get the maximum scalar value. */