summaryrefslogtreecommitdiffstats
path: root/tksao/colorbar/colorbarrgb.h
blob: 9aec65a726ce2cc5d71ac5259c60e6a6cadea2e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (C) 1999-2017
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#ifndef __colorbarrgb_h__
#define __colorbarrgb_h__

#include "colorbarbase.h"

class Filter;

class ColorbarRGB : public ColorbarBase {
 protected:
  int channel;
  float bias[3];
  float contrast[3];

 private:
  void psHorz(ostream&, Filter&, int, int);
  void psVert(ostream&, Filter&, int, int);

protected:
  int calcContrastBias(int, float, float);
  void reset();
  void updateColorCells();

#ifdef MAC_OSX_TK
  void macosx(float, int, int, const Vector&, const Vector&);
#endif

#ifdef __WIN32
  void win32(float, int, int, const Vector&, const Vector&);
#endif

public:
  ColorbarRGB(Tcl_Interp*, Tk_Canvas, Tk_Item*);

  // SubCommandFunctions

  void adjustCmd(float, float);
  void getBiasCmd();
  void getColorbarCmd();
  void getColormapCmd();
  void getColormapNameCmd(int);
  void getColormapFileNameCmd(int);
  void getContrastCmd();
  void getCurrentFileNameCmd();
  void getCurrentIDCmd();
  void getCurrentNameCmd();
  void setColorbarCmd(float, float, float, float, float, float, int);
  void getRGBChannelCmd();
  void setRGBChannelCmd(const char*);
};

#endif