/* pygl/rgbreps.h: CCP4MG Molecular Graphics Program Copyright (C) 2001-2008 University of York, CCLRC This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php 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 Lesser General Public License for more details. */ #ifndef _CCP4MG_RGBREPS_ #define _CCP4MG_RGBREPS_ #include #include #include #include enum ColourRepresentation { NOCOLOURREP , RGBCOLOURREP , HSVCOLOURREP }; class RGBReps { static std::vector colours_name_map; static std::map > string_colours; static std::vector > colours; static std::vector >hsv; static std::vector complement_colour; static void BuildRGBReps(std::ifstream &infile); public: RGBReps(std::ifstream &infile); RGBReps(std::string &infile); RGBReps(const char *infile); RGBReps(); ~RGBReps(){}; static void SetFile(std::ifstream &infile); static void SetFile(std::string &infile); static void SetFile(const char *infile); static std::vector > GetColours(); static std::vector GetColour(unsigned int i); static double* GetColourP(unsigned int i); static std::vector GetColourHSV(unsigned int i); static std::vector > GetColourDefinitions( std::vector codes,int mode); static std::string GetNameOfColour(unsigned int i); static std::vector GetColour(const std::string &name); static unsigned int GetNumberOfColours(); static void AddColour(std::string colour, double r, double g, double b, double a=255.0); static void ChangeColour(std::string colour, double r, double g, double b, double a=255.0); static void DeleteColour(std::string colour); static int GetColourNumber(std::string name ); static std::vector GetColourNumbers(std::vector names ); static std::vector hsvtorgb (std::vector hsv); static std::vector rgbtohsv (std::vector rgb ); static double* hsvtorgb (double *hsv); static double* rgbtohsv (double *rgb ); static void SetBackgroundColour(std::string colour); static void SetBackgroundColour(std::vector col); }; #endif