1 /*
2 * mp3plot - Bitrate analysis tool
3 *
4 * Copyright (C) 2009 Toni Corvera
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 // $Id: colourscheme.inc.cc 1344 2009-06-22 01:11:09Z toni $
22 /*
23 * File automatically generated by the colourschemegen.pl script, part of mp3plot.
24 * This file is meant to be '#included' by image_plotter.cc (although it should
25 * also compile by itself).
26 * See the colourschemegen.pl script for details on how to (re-)generate this file.
27 *
28 * Command-line used to generate this file: colourschemegen.pl 400000 1 R
29 */
30 #include "../common.h"
31 #include "../mp3/bitrate.h"
32 #include "colour.h"
33
34 #include <cassert>
35 #include <vector>
36 #include <map>
37
38 #include <iostream>
39
40 namespace mp3plot {
41 namespace impl {
42 namespace colourscheme {
43
44 using namespace std;
45 using namespace net_outlyer;
46
get_map()47 const map<uint8_t, rgb_type>& get_map() {
48 static map<uint8_t, rgb_type> m;
49
50 if (m.empty()) {
51 typedef colour_type<int, 255> ict;
52 uint8_t header_idx = 0;
53 // Free-form
54 m.insert( make_pair(0, rgb_type(1)) );
55
56 // Standard bitrates
57 ++header_idx;
58 assert( header_idx < 16 );
59 m.insert( make_pair(header_idx, ict(64,0,0).convert<double,1>()) );
60 ++header_idx;
61 assert( header_idx < 16 );
62 m.insert( make_pair(header_idx, ict(79,0,0).convert<double,1>()) );
63 ++header_idx;
64 assert( header_idx < 16 );
65 m.insert( make_pair(header_idx, ict(93,0,0).convert<double,1>()) );
66 ++header_idx;
67 assert( header_idx < 16 );
68 m.insert( make_pair(header_idx, ict(108,0,0).convert<double,1>()) );
69 ++header_idx;
70 assert( header_idx < 16 );
71 m.insert( make_pair(header_idx, ict(123,0,0).convert<double,1>()) );
72 ++header_idx;
73 assert( header_idx < 16 );
74 m.insert( make_pair(header_idx, ict(137,0,0).convert<double,1>()) );
75 ++header_idx;
76 assert( header_idx < 16 );
77 m.insert( make_pair(header_idx, ict(152,0,0).convert<double,1>()) );
78 ++header_idx;
79 assert( header_idx < 16 );
80 m.insert( make_pair(header_idx, ict(167,0,0).convert<double,1>()) );
81 ++header_idx;
82 assert( header_idx < 16 );
83 m.insert( make_pair(header_idx, ict(182,0,0).convert<double,1>()) );
84 ++header_idx;
85 assert( header_idx < 16 );
86 m.insert( make_pair(header_idx, ict(196,0,0).convert<double,1>()) );
87 ++header_idx;
88 assert( header_idx < 16 );
89 m.insert( make_pair(header_idx, ict(211,0,0).convert<double,1>()) );
90 ++header_idx;
91 assert( header_idx < 16 );
92 m.insert( make_pair(header_idx, ict(226,0,0).convert<double,1>()) );
93 ++header_idx;
94 assert( header_idx < 16 );
95 m.insert( make_pair(header_idx, ict(240,0,0).convert<double,1>()) );
96 ++header_idx;
97 assert( header_idx < 16 );
98 m.insert( make_pair(header_idx, ict(255,0,0).convert<double,1>()) );
99
100 // Bad bitrate
101 assert( m.end() == m.find(0x0F) );
102 m.insert( make_pair(0x0F, ict(128).convert<double,1>()) );
103 }
104
105 return m;
106 }
107
108 } // ns colourscheme
109 } // ns impl
110 } // ns mp3plot
111
112