-
Notifications
You must be signed in to change notification settings - Fork 3
/
colourmap.h
executable file
·56 lines (51 loc) · 13.5 KB
/
colourmap.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
#ifndef __colourmap__
#define __colourmap__
#define AUTUMN 1
#define BONE 2
#define WINTER 4
#define HOT 5
#define WATER 6
#define JET 3
#define NEGPOS 7
static float Autumn[]={ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
0,0.0159,0.0317,0.0476,0.0635,0.0794,0.0952,0.1111,0.1270,0.1429,0.1587,0.1746,0.1905,0.2063,0.2222,0.2381,0.2540,0.2698,0.2857,0.3016,0.3175,0.3333,0.3492,0.3651,0.3810,0.3968,0.4127,0.4286,0.4444,0.4603,0.4762,0.4921,0.5079,0.5238,0.5397,0.5556,0.5714,0.5873,0.6032,0.6190,0.6349,0.6508,0.6667,0.6825,0.6984,0.7143,0.7302,0.7460,0.7619,0.7778,0.7937,0.8095,0.8254,0.8413,0.8571,0.8730,0.8889,0.9048,0.9206,0.9365,0.9524,0.9683,0.9841,1.0000,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
static float Bone[]={ 0,0.0139,0.0278,0.0417,0.0556,0.0694,0.0833,0.0972,0.1111,0.1250,0.1389,0.1528,0.1667,0.1806,0.1944,0.2083,0.2222,0.2361,0.2500,0.2639,0.2778,0.2917,0.3056,0.3194,0.3333,0.3472,0.3611,0.3750,0.3889,0.4028,0.4167,0.4306,0.4444,0.4583,0.4722,0.4861,0.5000,0.5139,0.5278,0.5417,0.5556,0.5694,0.5833,0.5972,0.6111,0.6250,0.6389,0.6528,0.6745,0.6962,0.7179,0.7396,0.7613,0.7830,0.8047,0.8264,0.8481,0.8698,0.8915,0.9132,0.9349,0.9566,0.9783,1.0000,
0,0.0139,0.0278,0.0417,0.0556,0.0694,0.0833,0.0972,0.1111,0.1250,0.1389,0.1528,0.1667,0.1806,0.1944,0.2083,0.2222,0.2361,0.2500,0.2639,0.2778,0.2917,0.3056,0.3194,0.3385,0.3576,0.3767,0.3958,0.4149,0.4340,0.4531,0.4722,0.4913,0.5104,0.5295,0.5486,0.5677,0.5868,0.6059,0.6250,0.6441,0.6632,0.6823,0.7014,0.7205,0.7396,0.7587,0.7778,0.7917,0.8056,0.8194,0.8333,0.8472,0.8611,0.8750,0.8889,0.9028,0.9167,0.9306,0.9444,0.9583,0.9722,0.9861,1.000,
0.0052,0.0243,0.0434,0.0625,0.0816,0.1007,0.1198,0.1389,0.1580,0.1771,0.1962,0.2153,0.2344,0.2535,0.2726,0.2917,0.3108,0.3299,0.3490,0.3681,0.3872,0.4062,0.4253,0.4444,0.4583,0.4722,0.4861,0.5000,0.5139,0.5278,0.5417,0.5556,0.5694,0.5833,0.5972,0.6111,0.6250,0.6389,0.6528,0.6667,0.6806,0.6944,0.7083,0.7222,0.7361,0.7500,0.7639,0.7778,0.7917,0.8056,0.8194,0.8333,0.8472,0.8611,0.8750,0.8889,0.9028,0.9167,0.9306,0.9444,0.9583,0.9722,0.9861,1.0000};
static float Winter[]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0.0159,0.0317,0.0476,0.0635,0.0794,0.0952,0.1111,0.1270,0.1429,0.1587,0.1746,0.1905,0.2063,0.2222,0.2381,0.2540,0.2698,0.2857,0.3016,0.3175,0.3333,0.3492,0.3651,0.3810,0.3968,0.4127,0.4286,0.4444,0.4603,0.4762,0.4921,0.5079,0.5238,0.5397,0.5556,0.5714,0.5873,0.6032,0.6190,0.6349,0.6508,0.6667,0.6825,0.6984,0.7143,0.7302,0.7460,0.7619,0.7778,0.7937,0.8095,0.8254,0.8413,0.8571,0.8730,0.8889,0.9048,0.9206,0.9365,0.9524,0.9683,0.9841,1.0000,
1.0000,0.9921,0.9841,0.9762,0.9683,0.9603,0.9524,0.9444,0.9365,0.9286,0.9206,0.9127,0.9048,0.8968,0.8889,0.8810,0.8730,0.8651,0.8571,0.8492,0.8413,0.8333,0.8254,0.8175,0.8095,0.8016,0.7937,0.7857,0.7778,0.7698,0.7619,0.7540,0.7460,0.7381,0.7302,0.7222,0.7143,0.7063,0.6984,0.6905,0.6825,0.6746,0.6667,0.6587,0.6508,0.6429,0.6349,0.6270,0.6190,0.6111,0.6032,0.5952,0.5873,0.5794,0.5714,0.5635,0.5556,0.5476,0.5397,0.5317,0.5238,0.5159,0.5079,0.5000};
static float Water[]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0625,0.1250,0.1875,0.2500,0.3125,0.3750,0.4375,0.5000,0.5625,0.6250,0.6875,0.7500,0.8125,0.8750,0.9375,1.0000,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0417,0.0833,0.1250,0.1667,0.2083,0.2500,0.2917,0.3333,0.3750,0.4167,0.4583,0.5000,0.5417,0.5833,0.6250,0.6667,0.7083,0.7500,0.7917,0.8333,0.8750,0.9167,0.9583,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,
0.0417,0.0833,0.1250,0.1667,0.2083,0.2500,0.2917,0.3333,0.3750,0.4167,0.4583,0.5000,0.5417,0.5833,0.6250,0.6667,0.7083,0.7500,0.7917,0.8333,0.8750,0.9167,0.9583,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000};
static float Hot[]={ 0.0139,0.0278,0.0417,0.0556,0.0694,0.0833,0.0972,0.1111,0.1250,0.1389,0.1528,0.1667,0.1806,0.1944,0.2083,0.2222,0.2361,0.2500,0.2639,0.2778,0.2917,0.3056,0.3194,0.3333,0.3472,0.3611,0.3750,0.3889,0.4028,0.4167,0.4306,0.4444,0.4583,0.4722,0.4861,0.5000,0.5139,0.5278,0.5417,0.5556,0.5694,0.5833,0.5972,0.6111,0.6250,0.6389,0.6528,0.6667,0.6806,0.6944,0.7083,0.7222,0.7361,0.7500,0.7639,0.7778,0.7917,0.8056,0.8194,0.8333,0.8472,0.8611,0.8750,0.8889,0.9028,0.9167,0.9306,0.9444,0.9583,0.9722,0.9861,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0139,0.0278,0.0417,0.0556,0.0694,0.0833,0.0972,0.1111,0.1250,0.1389,0.1528,0.1667,0.1806,0.1944,0.2083,0.2222,0.2361,0.2500,0.2639,0.2778,0.2917,0.3056,0.3194,0.3333,0.3472,0.3611,0.3750,0.3889,0.4028,0.4167,0.4306,0.4444,0.4583,0.4722,0.4861,0.5000,0.5139,0.5278,0.5417,0.5556,0.5694,0.5833,0.5972,0.6111,0.6250,0.6389,0.6528,0.6667,0.6806,0.6944,0.7083,0.7222,0.7361,0.7500,0.7639,0.7778,0.7917,0.8056,0.8194,0.8333,0.8472,0.8611,0.8750,0.8889,0.9028,0.9167,0.9306,0.9444,0.9583,0.9722,0.9861,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0208,0.0417,0.0625,0.0833,0.1042,0.1250,0.1458,0.1667,0.1875,0.2083,0.2292,0.2500,0.2708,0.2917,0.3125,0.3333,0.3542,0.3750,0.3958,0.4167,0.4375,0.4583,0.4792,0.5000,0.5208,0.5417,0.5625,0.5833,0.6042,0.6250,0.6458,0.6667,0.6875,0.7083,0.7292,0.7500,0.7708,0.7917,0.8125,0.8333,0.8542,0.8750,0.8958,0.9167,0.9375,0.9583,0.9792,1.0000};
static float Jet[]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0208,0.0417,0.0625,0.0833,0.1042,0.1250,0.1458,0.1667,0.1875,0.2083,0.2292,0.2500,0.2708,0.2917,0.3125,0.3333,0.3542,0.3750,0.3958,0.4167,0.4375,0.4583,0.4792,0.5000,0.5208,0.5417,0.5625,0.5833,0.6042,0.6250,0.6458,0.6667,0.6875,0.7083,0.7292,0.7500,0.7708,0.7917,0.8125,0.8333,0.8542,0.8750,0.8958,0.9167,0.9375,0.9583,0.9792,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,0.9792,0.9583,0.9375,0.9167,0.8958,0.8750,0.8542,0.8333,0.8125,0.7917,0.7708,0.7500,0.7292,0.7083,0.6875,0.6667,0.6458,0.6250,0.6042,0.5833,0.5625,0.5417,0.5208,0.5000,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0208,0.0417,0.0625,0.0833,0.1042,0.1250,0.1458,0.1667,0.1875,0.2083,0.2292,0.2500,0.2708,0.2917,0.3125,0.3333,0.3542,0.3750,0.3958,0.4167,0.4375,0.4583,0.4792,0.5000,0.5208,0.5417,0.5625,0.5833,0.6042,0.6250,0.6458,0.6667,0.6875,0.7083,0.7292,0.7500,0.7708,0.7917,0.8125,0.8333,0.8542,0.8750,0.8958,0.9167,0.9375,0.9583,0.9792,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,0.9792,0.9583,0.9375,0.9167,0.8958,0.8750,0.8542,0.8333,0.8125,0.7917,0.7708,0.7500,0.7292,0.7083,0.6875,0.6667,0.6458,0.6250,0.6042,0.5833,0.5625,0.5417,0.5208,0.5000,0.4792,0.4583,0.4375,0.4167,0.3958,0.3750,0.3542,0.3333,0.3125,0.2917,0.2708,0.2500,0.2292,0.2083,0.1875,0.1667,0.1458,0.1250,0.1042,0.0833,0.0625,0.0417,0.0208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0.5208,0.5417,0.5625,0.5833,0.6042,0.6250,0.6458,0.6667,0.6875,0.7083,0.7292,0.7500,0.7708,0.7917,0.8125,0.8333,0.8542,0.8750,0.8958,0.9167,0.9375,0.9583,0.9792,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,0.9792,0.9583,0.9375,0.9167,0.8958,0.8750,0.8542,0.8333,0.8125,0.7917,0.7708,0.7500,0.7292,0.7083,0.6875,0.6667,0.6458,0.6250,0.6042,0.5833,0.5625,0.5417,0.5208,0.5000,0.4792,0.4583,0.4375,0.4167,0.3958,0.3750,0.3542,0.3333,0.3125,0.2917,0.2708,0.2500,0.2292,0.2083,0.1875,0.1667,0.1458,0.1250,0.1042,0.0833,0.0625,0.0417,0.0208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
static float Negpos[]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0053,0.0105,0.0158,0.0211,0.0263,0.0316,0.0368,0.0421,0.0474,0.0526,0.0579,0.0632,0.0684,0.0737,0.0789,0.0842,0.0895,0.0947,0.1000,0.1053,0.1105,0.1158,0.1211,0.1263,0.1316,0.1368,0.1421,0.1474,0.1526,0.1579,0.1632,0.3368,0.3474,0.3579,0.3684,0.3789,0.3895,0.4000,0.4105,0.4211,0.4316,0.4421,0.4526,0.4632,0.4737,0.4842,0.4947,0.5053,0.5158,0.5263,0.5368,0.5474,0.5579,0.5684,0.5789,0.5895,0.6000,0.6105,0.6211,0.6316,0.6421,0.6526,0.6632,0.6737,0.6842,0.6947,0.7053,0.7158,0.7263,0.7368,0.7474,0.7579,0.7684,0.7789,0.7895,0.8000,0.8105,0.8211,0.8316,0.8421,0.8526,0.8632,0.8737,0.8842,0.8947,0.9053,0.9158,0.9263,0.9368,0.9474,0.9579,0.9684,0.9789,0.9895,1.0000,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.3316,0.3263,0.3211,0.3158,0.3105,0.3053,0.3000,0.2947,0.2895,0.2842,0.2789,0.2737,0.2684,0.2632,0.2579,0.2526,0.2474,0.2421,0.2368,0.2316,0.2263,0.2211,0.2158,0.2105,0.2053,0.2000,0.1947,0.1895,0.1842,0.1789,0.1737,0.1684,0.3263,0.3158,0.3053,0.2947,0.2842,0.2737,0.2632,0.2526,0.2421,0.2316,0.2211,0.2105,0.2000,0.1895,0.1789,0.1684,0.1579,0.1474,0.1368,0.1263,0.1158,0.1053,0.0947,0.0842,0.0737,0.0632,0.0526,0.0421,0.0316,0.0211,0.0105,0,0,0.0105,0.0211,0.0316,0.0421,0.0526,0.0632,0.0737,0.0842,0.0947,0.1053,0.1158,0.1263,0.1368,0.1474,0.1579,0.1684,0.1789,0.1895,0.2000,0.2105,0.2211,0.2316,0.2421,0.2526,0.2632,0.2737,0.2842,0.2947,0.3053,0.3158,0.3263,0.1684,0.1737,0.1789,0.1842,0.1895,0.1947,0.2000,0.2053,0.2105,0.2158,0.2211,0.2263,0.2316,0.2368,0.2421,0.2474,0.2526,0.2579,0.2632,0.2684,0.2737,0.2789,0.2842,0.2895,0.2947,0.3000,0.3053,0.3105,0.3158,0.3211,0.3263,0.3316,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1.0000,0.9895,0.9789,0.9684,0.9579,0.9474,0.9368,0.9263,0.9158,0.9053,0.8947,0.8842,0.8737,0.8632,0.8526,0.8421,0.8316,0.8211,0.8105,0.8000,0.7895,0.7789,0.7684,0.7579,0.7474,0.7368,0.7263,0.7158,0.7053,0.6947,0.6842,0.6737,0.6632,0.6526,0.6421,0.6316,0.6211,0.6105,0.6000,0.5895,0.5789,0.5684,0.5579,0.5474,0.5368,0.5263,0.5158,0.5053,0.4947,0.4842,0.4737,0.4632,0.4526,0.4421,0.4316,0.4211,0.4105,0.4000,0.3895,0.3789,0.3684,0.3579,0.3474,0.3368,0.1632,0.1579,0.1526,0.1474,0.1421,0.1368,0.1316,0.1263,0.1211,0.1158,0.1105,0.1053,0.1000,0.0947,0.0895,0.0842,0.0789,0.0737,0.0684,0.0632,0.0579,0.0526,0.0474,0.0421,0.0368,0.0316,0.0263,0.0211,0.0158,0.0105,0.0053,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
static void colourmap(float val, unsigned char *c, int index);
static void colourmap(float val, unsigned char *c, int index)
{
int n=192,i=val*(n-1);
float *cm;
switch(index)
{
case AUTUMN: cm=Autumn; break;
case BONE: cm=Bone; break;
case WINTER: cm=Winter; break;
case HOT: cm=Hot; break;
case WATER: cm=Water; break;
case JET: cm=Jet; break;
case NEGPOS: cm=Negpos; break;
}
c[0]=255*(cm[ i]+(val-i/(float)(n-1))*(cm[ i+1]-cm[ i]));
c[1]=255*(cm[ n+i]+(val-i/(float)(n-1))*(cm[ n+i+1]-cm[ n+i]));
c[2]=255*(cm[2*n+i]+(val-i/(float)(n-1))*(cm[2*n+i+1]-cm[2*n+i]));
c[3]=255;
}
#endif