Debian Codegraph @

ccp4mg-utils/pygl/rgbreps.h

raw symbols SCIP
1 /*
2 pygl/rgbreps.h: CCP4MG Molecular Graphics Program
3 Copyright (C) 2001-2008 University of York, CCLRC
4
5 This library is free software: you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License
7 version 3, modified in accordance with the provisions of the
8 license to address the requirements of UK law.
9
10 You should have received a copy of the modified GNU Lesser General
11 Public License along with this library. If not, copies may be
12 downloaded from http://www.ccp4.ac.uk/ccp4license.php
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18 */
19
20
21 #ifndef _CCP4MG_RGBREPS_
22 #define _CCP4MG_RGBREPS_
23
24
25 #include <map>
26 #include <vector>
27 #include <string>
28 #include <fstream>
29
30 enum ColourRepresentation { NOCOLOURREP , RGBCOLOURREP , HSVCOLOURREP };
31
32 class RGBReps {
33 static std::vector<std::string> colours_name_map;
34 static std::map<std::string,std::vector<double> > string_colours;
35 static std::vector<std::vector<double> > colours;
36 static std::vector<std::vector<double> >hsv;
37 static std::vector<double> complement_colour;
38
39 static void BuildRGBReps(std::ifstream &infile);
40 public:
41 RGBReps(std::ifstream &infile);
42 RGBReps(std::string &infile);
43 RGBReps(const char *infile);
44 RGBReps();
45 ~RGBReps(){};
46
47 static void SetFile(std::ifstream &infile);
48 static void SetFile(std::string &infile);
49 static void SetFile(const char *infile);
50
51 static std::vector<std::vector<double> > GetColours();
52 static std::vector<double> GetColour(unsigned int i);
53 static double* GetColourP(unsigned int i);
54 static std::vector<double> GetColourHSV(unsigned int i);
55 static std::vector<std::vector<double> > GetColourDefinitions( std::vector<int> codes,int mode);
56 static std::string GetNameOfColour(unsigned int i);
57 static std::vector<double> GetColour(const std::string &name);
58 static unsigned int GetNumberOfColours();
59 static void AddColour(std::string colour, double r, double g, double b, double a=255.0);
60 static void ChangeColour(std::string colour, double r, double g, double b, double a=255.0);
61 static void DeleteColour(std::string colour);
62 static int GetColourNumber(std::string name );
63 static std::vector<int> GetColourNumbers(std::vector<std::string> names );
64 static std::vector<double> hsvtorgb (std::vector<double> hsv);
65 static std::vector<double> rgbtohsv (std::vector<double> rgb );
66 static double* hsvtorgb (double *hsv);
67 static double* rgbtohsv (double *rgb );
68 static void SetBackgroundColour(std::string colour);
69 static void SetBackgroundColour(std::vector<double> col);
70 };
71
72 #endif