Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads

Class for palette definition. More...

#include <palette.hpp>

Classes

struct  Entry
 Palette defining entry. More...
 

Public Member Functions

 Palette ()
 Default constructor for default black and white palette. More...
 
 Palette (const std::vector< Entry > &entries)
 Constructor for defined palette. More...
 
Vec3D operator() (double x) const
 Return the interpolated color value from palette. More...
 
void clear (void)
 Clear current palette. More...
 
void push_back (const Vec3D &color, double val)
 Pushes new entry to palette. More...
 
void normalize (void)
 Normalize palette entries. More...
 
int get_steps (void) const
 Get palette steps. More...
 
void set_steps (int steps)
 Set palette steps. More...
 
void debug_print (std::ostream &os) const
 Print debugging information to os. More...
 

Detailed Description

Class for palette definition.

Palette is an object that contains a list of colors and corresponding values. The colors are interpolated linearly between the defined points for a smooth color palette. The palette values are normalized so that the end points of palette have values 0.0 and 1.0.

Constructor & Destructor Documentation

◆ Palette() [1/2]

Palette::Palette ( )

Default constructor for default black and white palette.

◆ Palette() [2/2]

Palette::Palette ( const std::vector< Entry > &  entries)

Constructor for defined palette.

The values are normed to range from 0.0 to 1.0.

Member Function Documentation

◆ clear()

void Palette::clear ( void  )

Clear current palette.

Leaves palette with no colors. Used with push_back() to build new palettes on-line.

◆ debug_print()

void Palette::debug_print ( std::ostream &  os) const

Print debugging information to os.

◆ get_steps()

int Palette::get_steps ( void  ) const

Get palette steps.

If steps is less than or equal to 1 a regular interpolated palette will be used (default), otherwise steps is used as the number of separate shades in the palette.

◆ normalize()

void Palette::normalize ( void  )

Normalize palette entries.

Normalize palette to range from 0.0 to 1.0.

◆ operator()()

Vec3D Palette::operator() ( double  x) const

Return the interpolated color value from palette.

Makes and interpolated color value at value x, where 0 <= x <= 1. If palette has no colors, black will be returned. If palette has one color, that color will be returned. With two or more colors the value returned is interpolated from the colors. Outside the defined range, the closest color value is returned (color 0 if x < 0 and color N-1 if x > 1). If stepped palette is enabled, the palette shades will be limited and hard limits will be shown on palette sweeps.

◆ push_back()

void Palette::push_back ( const Vec3D color,
double  val 
)

Pushes new entry to palette.

Palette entries are automatically sorted. The palette won't be normalized in range. This has to be manually done by calling normalize() after adding palette entries.

◆ set_steps()

void Palette::set_steps ( int  steps)

Set palette steps.

If steps is less than or equal to 1 a regular interpolated palette will be used (default), otherwise steps is used as the number of separate shades in the palette.

Defaults to 0.


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


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.