![]() |
Scribus
Open source desktop publishing at your fingertips
|
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.). More...
#include <colorblind.h>
Public Types | |
enum | defectMode { normalVision = 0, protanopeVision = 1, deuteranopeVision = 2, tritanopeVision = 3, colorBlindnessVision = 4 } |
Enumerate Vision Defects for readable ComboBox access. | |
Public Member Functions | |
VisionDefectColor (int r, int g, int b) | |
QColor like constructors. Setup the RGB parts, then init(). More... | |
VisionDefectColor (QColor c) | |
QColor like constructors. Setup the RGB parts, then init(). More... | |
VisionDefectColor () | |
Default constructors. Setup the RGB parts to default values, then init(). | |
void | convertDefect () |
Perform conversion itself. Gama removing, RGB2LSM, matrix operation for selected deficiency, LSM2RGB, gama applying. | |
QColor | convertDefect (QColor c, int d) |
Perform conversion itself. Confidence overload to perform the conversion in one step;. More... | |
uint | getRed () |
Return the color parts. More... | |
uint | getGreen () |
Return the color parts. More... | |
uint | getBlue () |
Return the color parts. More... | |
QColor | getColor () |
Return QColor. More... | |
Public Attributes | |
int | deficiency |
Actual defect type. One of the 'defectMode'. | |
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.).
Based on the GIMP's cdisplay_colorblind.c by Michael Natterer mitch, Sven Neumann @gim p.orgsven@, Robert Dougherty gimp .orgbob@v and Alex Wade isch eck.c omalex@. visc heck. com
This code is written using "Scribus coding standard" as a part of the Scribus project (www.scribus.net).
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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
VisionDefectColor::VisionDefectColor | ( | int | r, |
int | g, | ||
int | b | ||
) |
QColor like constructors. Setup the RGB parts, then init().
r | red part of the color |
g | green part of the color |
b | blue part of the color |
VisionDefectColor::VisionDefectColor | ( | QColor | c | ) |
QColor like constructors. Setup the RGB parts, then init().
c | QColor object |
QColor VisionDefectColor::convertDefect | ( | QColor | c, |
int | d | ||
) |
Perform conversion itself. Confidence overload to perform the conversion in one step;.
c | QColor object |
d | defect type |
QColor | converted color Gama removing, RGB2LSM, matrix operation for selected deficiency, LSM2RGB, gama applying. |
uint VisionDefectColor::getBlue | ( | ) |
Return the color parts.
uint | blue part |
QColor VisionDefectColor::getColor | ( | ) |
Return QColor.
QColor | new QColor |
uint VisionDefectColor::getGreen | ( | ) |
Return the color parts.
uint | green part |
uint VisionDefectColor::getRed | ( | ) |
Return the color parts.
uint | red part |