Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccCAM.h
Go to the documentation of this file.
1/** @file
2 File: IccCAM.h
3
4 Contains: Implementation of the ICC CAM color transform
5
6 Version: V1
7
8 Copyright: (c) see ICC Software License
9*/
10
11/*
12 * The ICC Software License, Version 0.2
13 *
14 *
15 * Copyright (c) 2003-2012 The International Color Consortium. All rights
16 * reserved.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 *
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 *
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in
27 * the documentation and/or other materials provided with the
28 * distribution.
29 *
30 * 3. In the absence of prior written permission, the names "ICC" and "The
31 * International Color Consortium" must not be used to imply that the
32 * ICC organization endorses or promotes products derived from this
33 * software.
34 *
35 *
36 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39 * DISCLAIMED. IN NO EVENT SHALL THE INTERNATIONAL COLOR CONSORTIUM OR
40 * ITS CONTRIBUTING MEMBERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 * SUCH DAMAGE.
48 * ====================================================================
49 *
50 * This software consists of voluntary contributions made by many
51 * individuals on behalf of the The International Color Consortium.
52 *
53 *
54 * Membership in the ICC is encouraged when this software is used for
55 * commercial purposes.
56 *
57 *
58 * For more information on The International Color Consortium, please
59 * see <http://www.color.org/>.
60 *
61 *
62 */
63
64//////////////////////////////////////////////////////////////////////
65// HISTORY:
66//
67// -Initial implementation by Marc Mahy 5-15-2012
68// -Refactoring to match IccProfLib by Max Derhak 5-31-2012
69//
70//////////////////////////////////////////////////////////////////////
71
72#if !defined(_ICCCAM_H)
73#define _ICCCAM_H
74
75#include "IccDefs.h"
76#include "IccIO.h"
77
78#ifdef USEREFICCMAXNAMESPACE
79namespace refIccMAX {
80#endif
81
82//: ICCCAM transformation Object definition
83
85{
86private:
87 // parameters color space
88 icFloatNumber m_WhitePoint[3];
89 icFloatNumber m_La; /* Absolute luminance of adapting field in cd/m^2 */
90 icFloatNumber m_Yb; /* relative luminance of background in cd/m^2 */
91 icFloatNumber m_c; /* impact surround */
92 icFloatNumber m_Nc; /* chromatic induction factor */
93 icFloatNumber m_F; /* degree of adaptation factor */
94 icFloatNumber m_mFor[3][3];
95 icFloatNumber m_mInv[3][3];
97
98 //Additional non-provided parameters
99 //Yw is relative luminance of adapting field in cd/m^2
100 //LW is absolute luminance of the reference white in cd/m^2
101
102 // parameters precalculations
103 icFloatNumber m_rgbWhite[3];
110
111 // parameters for corrected hyperbolic function
116
117 // helper functions
118 void Multiply_vect_by_mx (const icFloatNumber *in, icFloatNumber *out, icFloatNumber m[3][3]);
119
120 icFloatNumber F_Function (icFloatNumber x);
121 icFloatNumber H_Function (icFloatNumber x);
122 icFloatNumber H_FunctionInv (icFloatNumber y);
123
124 icFloatNumber IccCam_e (icFloatNumber hue);
125 icFloatNumber Hyperbolic (icFloatNumber x);
126 icFloatNumber HyperbolicInv (icFloatNumber x);
127 void ReferenceConditions (icFloatNumber* rgb, icFloatNumber* rgbC);
128 void ReferenceConditionsInv (icFloatNumber* rgbC, icFloatNumber* rgb);
129
130 void ab2chDeg(icFloatNumber a, icFloatNumber b, icFloatNumber &c, icFloatNumber &h);
131
132 void CalcCoefficients ();
133
134public:
137 CIccCamConverter& operator=(const CIccCamConverter &camcon);
138 CIccCamConverter* NewCopy() const;
139
140 void JabToXYZ (const icFloatNumber* jab, icFloatNumber* xyz, int nbr);
141 void XYZToJab (const icFloatNumber* xyz, icFloatNumber* jab, int nbr);
142
143 void SetParameter_WhitePoint (icFloatNumber* whitePoint);
144 //Set absolute luminance of adapting field La
145 void SetParameter_La (icFloatNumber La);
146 //Set relative luminance of background Yb
147 void SetParameter_Yb (icFloatNumber YB);
148 //Set impact of surround
149 void SetParameter_C (icFloatNumber c);
150 //Set chromatic induction factor
151 void SetParameter_Nc (icFloatNumber Nc);
152 //Set factor determining degree of adaptation
153 void SetParameter_F (icFloatNumber F);
154 void GetParameter_WhitePoint (icFloatNumber* whitePoint);
155 icFloatNumber GetParameter_La ();
156 icFloatNumber GetParameter_Yb ();
157 icFloatNumber GetParameter_C ();
158 icFloatNumber GetParameter_Nc ();
159 icFloatNumber GetParameter_F ();
160};
161
162
163#ifdef USEREFICCMAXNAMESPACE
164} //namespace refIccMAX
165#endif
166
167#endif // !defined(_ICCCAM_H)
File: IccDefs.h
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
File: IccIO.h.
#define F(x, y, z)
Definition IccMD5.cpp:64
#define ICCPROFLIB_API
icFloatNumber m_D
Definition IccCAM.h:104
icFloatNumber m_La
Definition IccCAM.h:89
icFloatNumber m_cc
Definition IccCAM.h:113
icFloatNumber m_Yb
Definition IccCAM.h:90
icFloatNumber m_Nc
Definition IccCAM.h:92
icFloatNumber m_alfa
Definition IccCAM.h:114
icFloatNumber m_c
Definition IccCAM.h:91
icFloatNumber m_x0
Definition IccCAM.h:112
icFloatNumber m_Nbb
Definition IccCAM.h:107
icFloatNumber m_factor
Definition IccCAM.h:96
icFloatNumber m_F
Definition IccCAM.h:93
icFloatNumber m_n
Definition IccCAM.h:106
icFloatNumber m_exp
Definition IccCAM.h:115
icFloatNumber m_z
Definition IccCAM.h:108
icFloatNumber m_Fl
Definition IccCAM.h:105
icFloatNumber m_AWhite
Definition IccCAM.h:109