12 #ifndef GLVIS_PALETTES_HPP
13 #define GLVIS_PALETTES_HPP
40 int GetSize(
int pal = -1)
const;
43 {
return PaletteNumColors ? PaletteNumColors :
GetSize(pal); }
55 {
return palette_tex[curr_palette][use_smooth]; }
59 void ToTextureDiscrete(
double * palette,
size_t plt_size, GLuint tex);
60 void ToTextureSmooth(
double * palette,
size_t plt_size, GLuint tex);
63 std::vector<std::array<TexHandle,2>> palette_tex;
68 int RepeatPaletteTimes = 1;
69 int PaletteNumColors = 0;
71 bool use_logscale =
false;
int GetSize(int pal=-1) const
Gets the total number of colors in the current palette color array.
int GetNumColors(int pal=-1) const
Gets the number of colors used in the current palette color array.
const double * GetData() const
Gets the data in the palette color array.
void GetColorFromVal(double val, float *rgba)
int SelectNewRGBPalette()
void SetRepeatTimes(int rpt)
int GetRepeatTimes() const
double GetColorCoord(double val, double min, double max)
GLuint GetColorTexture() const
GLuint GetAlphaTexture() const
Handle< texCleanup > TextureHandle
void SetIndex(int num)
Sets the palette texture to bind.
void Init()
Initializes the palette textures.
int GetSmoothSetting()
Gets whether the smooth texture is being used (1 = true)
void UseSmooth()
Binds the smooth version of the current palette texture.
void SetNumColors(int numColors)
Sets the number of colors to use in the current palette color array.
void GenerateAlphaTexture(float matAlpha, float matAlphaCenter)
void UseDiscrete()
Binds the discrete version of the current palette texture.
void SetUseLogscale(bool logscale)