Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 6437 → Rev 6438

/branches/Version13x/Scribus/scribus/plugins/colorwheel/colorblind.h
11,8 → 11,6
#include <qcolor.h>
#include <qobject.h>
 
/* $Id$ */
 
/*! \brief This code is an implementation of an algorithm described by Hans Brettel,
Francoise Vienot and John Mollon in the Journal of the Optical Society of
America V14(10), pg 2647. (See http://vischeck.com/ for more info.).
24,7 → 22,7
This code is written using "Scribus coding standard" as a part of the
Scribus project (www.scribus.net).
 
\author Petr Vanek <petr@yarpen.cz>
\author Petr Vanek <petr@scribus.info>
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
45,7 → 43,7
{
Q_OBJECT
public:
/*! Enumerate Vision Defects for readable ComboBox access */
/*! \brief Enumerate Vision Defects for readable ComboBox access */
enum defectMode {
normalVision = 0,
protanopeVision = 1,
54,64 → 52,64
colorBlindnessVision = 4
};
 
/*! QColor like constructors. Setup the RGB parts, then init().
/*! \brief QColor like constructors. Setup the RGB parts, then init().
\param r red part of the color
\param g green part of the color
\param b blue part of the color
*/
VisionDefectColor(int r, int g, int b);
/*! QColor like constructors. Setup the RGB parts, then init().
/*! \brief QColor like constructors. Setup the RGB parts, then init().
\param c QColor object
*/
VisionDefectColor(QColor c);
 
/*! Actual defect type. One of the 'defectMode' */
/*! \brief Actual defect type. One of the 'defectMode' */
int deficiency;
 
/*! Perform conversion itself.
/*! \brief Perform conversion itself.
Gama removing, RGB2LSM, matrix operation for selected deficiency,
LSM2RGB, gama applying. */
void convertDefect();
 
/*! Return the color parts
/*! \brief Return the color parts
\retval uint red part
*/
uint getRed();
/*! Return the color parts
/*! \brief Return the color parts
\retval uint green part
*/
uint getGreen();
/*! Return the color parts
/*! \brief Return the color parts
\retval uint blue part
*/
uint getBlue();
/*! Return QColor
/*! \brief Return QColor
\retval QColor new QColor
*/
QColor getColor();
 
private:
/*! Convert matrix */
/*! \brief Convert matrix */
double rgb2lms[9];
/*! Convert matrix */
/*! \brief Convert matrix */
double lms2rgb[9];
/*! Gamma matrix */
/*! \brief Gamma matrix */
double gammaRGB[3];
 
/*! cross products with transform matrixes for actual defect */
/*! \brief cross products with transform matrixes for actual defect */
double a1, b1, c1;
/*! cross products with transform matrixes for actual defect */
/*! \brief cross products with transform matrixes for actual defect */
double a2, b2, c2;
/*! Inflection border line */
/*! \brief Inflection border line */
double inflection;
 
/*! Internal RGB color parts */
/*! \brief Internal RGB color parts */
double red, green, blue;
 
/*! original color */
/*! \brief original color */
QColor originalColor;
 
/*! Initialization of the internal values. rgb2lms, lms2rgb etc.
/*! \brief Initialization of the internal values. rgb2lms, lms2rgb etc.
For most modern Cathode-Ray Tube monitors (CRTs), the following
are good estimates of the RGB->LMS and LMS->RGB transform
matrices. They are based on spectra measured on a typical CRT
133,11 → 131,11
*/
void init();
 
/*! This function performs initialisations that are dependant
/*! \brief This function performs initialisations that are dependant
on the type of color deficiency (see defectMode). */
void setupDefect();
 
/*! Ensures that x is between the limits set by low and high.
/*! \brief Ensures that x is between the limits set by low and high.
Glib CLAMP() macro replacement for C++ speedup optimalization.
\param x value itself
\param low low border