-
Notifications
You must be signed in to change notification settings - Fork 0
/
ColorMapList.h
69 lines (52 loc) · 2.2 KB
/
ColorMapList.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* ----------------------------------------------------------------------------
ColorMapList.h
MIView - Medical Image Viewer
Copyright (C) 2009-2011 Gregory Book
MIView is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------- */
#pragma once
#include "ColorMap.h"
#include "wx/textfile.h"
#include "wx/dynarray.h"
//WX_DEFINE_ARRAY_PTR(float *, wxArrayFloatPointer);
WX_DECLARE_OBJARRAY(ColorMap,c_colorMaps);
class ColorMapList
{
public:
ColorMapList(int texSize);
~ColorMapList(void);
/* resize the map when its added */
int AddMap(wxString name);
int AddMap(wxString name, wxArrayInt r, wxArrayInt g, wxArrayInt b, wxArrayInt a, wxArrayInt p);
/* delete extra maps if needed */
void DeleteMap(int mapIndex);
bool ReadColorMapFile();
void WriteColorMapFile();
void SortColorMapByPosition(int mapIndex);
int AddColorToMap(int mapIndex, int r, int g, int b, int a, int p);
void DeleteColorFromMap(int mapIndex, int colorIndex);
void UpdateRed(int mapIndex, int colorIndex,int red);
void UpdateGreen(int mapIndex, int colorIndex,int green);
void UpdateBlue(int mapIndex, int colorIndex,int blue);
void UpdateAlpha(int mapIndex, int colorIndex,int alpha);
void UpdatePosition(int mapIndex, int colorIndex,int position);
/* get the map at the specified index */
float *GetPointerToMap(int mapIndex);
/* array of colormaps */
c_colorMaps maps;
// wxArrayFloatPointer maps; /* array of pointers to the maps */
private:
//int newMapSize; /* OpenGL texture size limit for the current video card */
int glTextureSize;
wxSize bitmapSize;
wxString msg;
};