Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccMpeSpectral.h
Go to the documentation of this file.
1/** @file
2File: IccMpeSpectral.h
3
4Contains: Header for implementation of Basic CIccTagMPE elements
5 and supporting classes
6
7Version: V1
8
9Copyright: (c) see ICC Software License
10*/
11
12/*
13* The ICC Software License, Version 0.2
14*
15*
16* Copyright (c) 2005 The International Color Consortium. All rights
17* reserved.
18*
19* Redistribution and use in source and binary forms, with or without
20* modification, are permitted provided that the following conditions
21* are met:
22*
23* 1. Redistributions of source code must retain the above copyright
24* notice, this list of conditions and the following disclaimer.
25*
26* 2. Redistributions in binary form must reproduce the above copyright
27* notice, this list of conditions and the following disclaimer in
28* the documentation and/or other materials provided with the
29* distribution.
30*
31* 3. In the absence of prior written permission, the names "ICC" and "The
32* International Color Consortium" must not be used to imply that the
33* ICC organization endorses or promotes products derived from this
34* software.
35*
36*
37* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40* DISCLAIMED. IN NO EVENT SHALL THE INTERNATIONAL COLOR CONSORTIUM OR
41* ITS CONTRIBUTING MEMBERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48* SUCH DAMAGE.
49* ====================================================================
50*
51* This software consists of voluntary contributions made by many
52* individuals on behalf of the The International Color Consortium.
53*
54*
55* Membership in the ICC is encouraged when this software is used for
56* commercial purposes.
57*
58*
59* For more information on The International Color Consortium, please
60* see <http://www.color.org/>.
61*
62*
63*/
64
65//////////////////////////////////////////////////////////////////////
66// HISTORY:
67//
68// -Oct 23, 2015
69// Initial CIccMpe Spectral development
70//
71//////////////////////////////////////////////////////////////////////
72
73#ifndef _ICCELEMSPECTRAL_H
74#define _ICCELEMSPECTRAL_H
75
76#include "IccTagMPE.h"
77
78
79//CIccFloatTag support
80#ifdef USEREFICCMAXNAMESPACE
81namespace refIccMAX {
82#endif
83
84//declare class for referencing by CIccMpeInvEmissionMatrix
85class CIccMathMatrix;
86
87/**
88****************************************************************************
89* Class: CIccMpeSpectralMatrix
90*
91* Purpose: The Observed Emission Matrix Element
92*****************************************************************************
93*/
95{
96public:
99 virtual ~CIccMpeSpectralMatrix();
100
101 virtual void Describe(std::string &sDescription, int nVerboseness);
102
103 virtual bool Read(icUInt32Number size, CIccIO *pIO);
104 virtual bool Write(CIccIO *pIO);
105
106 const icSpectralRange &GetRange() { return m_Range;}
107
108 bool SetSize(icUInt16Number nInputChannels, icUInt16Number nOutputChannels, const icSpectralRange &range );
109
110 icFloatNumber *GetWhite() { return m_pWhite;}
111 icFloatNumber *GetMatrix() {return m_pMatrix;}
112 icFloatNumber *GetOffset() {return m_pOffset;}
113
114 virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE) = 0;
115 virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const = 0;
116
117 virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement* pMPE=NULL, const CIccProfile* pProfile = NULL) const;
118
119 virtual bool IsLateBinding() const { return true; }
120
121protected:
122 void copyData(const CIccMpeSpectralMatrix &ITPC);
123 virtual const char *GetDescribeName() const = 0;
124 virtual icUInt16Number numVectors() const = 0;
125
128
133
135 icFloatNumber m_xyzOffset[3];
136};
137
138
139
140/**
141****************************************************************************
142* Class: CIccMpeEmissionMatrix
143*
144* Purpose: The Observed Emission Matrix Element
145*****************************************************************************
146*/
148{
149public:
152 CIccMpeEmissionMatrix &operator=(const CIccMpeEmissionMatrix &ITPC) { copyData(ITPC); return *this; }
153 virtual CIccMultiProcessElement *NewCopy() const { return new CIccMpeEmissionMatrix(*this);}
155
157 virtual const icChar *GetClassName() const { return "CIccMpeEmissionMatrix"; }
158
159 virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE);
160 virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const;
161
162protected:
163 virtual const char *GetDescribeName() const { return "ELEM_OBS_EMIS_MATRIX"; }
164 virtual icUInt16Number numVectors() const { return m_nInputChannels; }
165};
166
167/**
168****************************************************************************
169* Class: CIccMpeInvEmissionMatrix
170*
171* Purpose: The Inverse Observed Emission Matrix Element
172*****************************************************************************
173*/
175{
176public:
179 CIccMpeInvEmissionMatrix &operator=(const CIccMpeInvEmissionMatrix &ITPC) { copyData(ITPC); return *this; }
180 virtual CIccMultiProcessElement *NewCopy() const { return new CIccMpeInvEmissionMatrix(*this);}
182
184 virtual const icChar *GetClassName() const { return "CIccMpeEmissionMatrix"; }
185
186 virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE);
187 virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const;
188
189 virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement* pMPE=NULL, const CIccProfile* pProfile = NULL) const;
190
191protected:
192 virtual const char *GetDescribeName() const { return "ELEM_INV_OBS_EMIS_MATRIX"; }
193 virtual icUInt16Number numVectors() const { return m_nOutputChannels; }
194};
195
196/**
197****************************************************************************
198* Class: CIccMpeSpectralCLUT
199*
200* Purpose: The float Color LookUp Table tag
201*****************************************************************************
202*/
204{
205public:
208 virtual ~CIccMpeSpectralCLUT();
209
210 virtual void Describe(std::string &sDescription, int nVerboseness);
211
212 virtual bool Read(icUInt32Number size, CIccIO *pIO);
213 virtual bool Write(CIccIO *pIO);
214
215 virtual CIccApplyMpe* GetNewApply(CIccApplyTagMpe* pApplyTag);
216
217 virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const;
218
219 virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement* pMPE=NULL, const CIccProfile* pProfile = NULL) const;
220
221 void SetData(CIccCLUT *pCLUT, icUInt16Number nStorageType,
222 const icSpectralRange &range, icFloatNumber *pWhite,
223 icUInt16Number nOutputChannels=3);
224 CIccCLUT *GetCLUT() { return m_pCLUT; }
225 CIccCLUT *GetApplyCLUT() { return m_pApplyCLUT; }
226 icFloatNumber *GetWhite() { return m_pWhite; }
227
228 virtual bool IsLateBinding() const { return true; }
229
230protected:
231 void copyData(const CIccMpeSpectralCLUT &ITPC);
232 virtual const char *GetDescribeName() const = 0;
233
237
239
242
244};
245
246/**
247****************************************************************************
248*Class: CIccApplyMpeSpectralCLUT
249*
250*Purpose : The SpectralCLUT element apply data
251*****************************************************************************
252*/
254{
256public:
258
259 virtual icElemTypeSignature GetType() const { return m_pElem->GetType(); }
260 virtual const icChar* GetClassName() const { return "CIccApplyMpeSpectralCLUT"; }
261
262protected:
264
266};
267
268
269
270/**
271****************************************************************************
272* Class: CIccMpeEmissionCLUT
273*
274* Purpose: The Emission CLUT Element
275*****************************************************************************
276*/
278{
279public:
282 CIccMpeEmissionCLUT &operator=(const CIccMpeEmissionCLUT &ITPC) { copyData(ITPC); return *this; }
283 virtual CIccMultiProcessElement *NewCopy() const { return new CIccMpeEmissionCLUT(*this);}
285
287 virtual const icChar *GetClassName() const { return "CIccMpeEmissionCLUT"; }
288
289 virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE);
290
291protected:
292 virtual const char *GetDescribeName() const { return "ELEM_EMISSION_CLUT"; }
293};
294
295
296/**
297****************************************************************************
298* Class: CIccMpeReflectanceCLUT
299*
300* Purpose: The Reflectance CLUT Element
301*****************************************************************************
302*/
304{
305public:
308 CIccMpeReflectanceCLUT &operator=(const CIccMpeReflectanceCLUT &ITPC) { copyData(ITPC); return *this; }
309 virtual CIccMpeReflectanceCLUT *NewCopy() const { return new CIccMpeReflectanceCLUT(*this);}
311
313 virtual const icChar *GetClassName() const { return "CIccMpeReflectanceCLUT"; }
314
315 virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE);
316
317 virtual bool IsLateBindingReflectance() const { return true; }
318
319protected:
320 virtual const char *GetDescribeName() const { return "ELEM_REFLECTANCE_CLUT"; }
321};
322
323
324/**
325****************************************************************************
326* Class: CIccMpeSpectralObserver
327*
328* Purpose: The Spectral Observer Element
329*****************************************************************************
330*/
332{
333public:
336 virtual ~CIccMpeSpectralObserver();
337
338 virtual void Describe(std::string &sDescription, int nVerboseness);
339
340 virtual bool Read(icUInt32Number size, CIccIO *pIO);
341 virtual bool Write(CIccIO *pIO);
342
343 const icSpectralRange &GetRange() { return m_Range;}
344
345 bool SetSize(icUInt16Number nInputChannels, icUInt16Number nOutputChannels, const icSpectralRange &range );
346
347 icFloatNumber *GetWhite() { return m_pWhite;}
348
349 virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE) = 0;
350 virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const;
351
352 virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement* pMPE=NULL, const CIccProfile* pProfile = NULL) const;
353
354 virtual bool IsLateBinding() const { return true; }
355
356protected:
357 void copyData(const CIccMpeSpectralObserver &ITPC);
358 virtual const char *GetDescribeName() const = 0;
359
362
364
366 icFloatNumber m_xyzw[3];
367 icFloatNumber m_xyzscale[3];
368};
369
370
371/**
372****************************************************************************
373* Class: CIccMpeEmissionObserver
374*
375* Purpose: The Emission Observer Element
376*****************************************************************************
377*/
379{
380public:
383 CIccMpeEmissionObserver &operator=(const CIccMpeEmissionObserver &ITPC) { copyData(ITPC); return *this; }
384 virtual CIccMultiProcessElement *NewCopy() const { return new CIccMpeEmissionObserver(*this);}
386
388 virtual const icChar *GetClassName() const { return "CIccMpeEmissionObserver"; }
389
390 virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE);
391
392protected:
393 virtual const char *GetDescribeName() const { return "ELEM_EMISSION_OBSERVER"; }
394};
395
396
397/**
398****************************************************************************
399* Class: CIccMpeReflectanceObserver
400*
401* Purpose: The Reflectance Observer Element
402*****************************************************************************
403*/
405{
406public:
409 CIccMpeReflectanceObserver &operator=(const CIccMpeReflectanceObserver &ITPC) { copyData(ITPC); return *this; }
410 virtual CIccMpeReflectanceObserver *NewCopy() const { return new CIccMpeReflectanceObserver(*this);}
412
414 virtual const icChar *GetClassName() const { return "CIccMpeReflectanceObserver"; }
415
416 virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE);
417
418 virtual bool IsLateBindingReflectance() const { return true; }
419
420protected:
421 virtual const char *GetDescribeName() const { return "ELEM_REFLECTANCE_OBSERVER"; }
422};
423
424
425//CIccMPElements support
426#ifdef USEREFICCMAXNAMESPACE
427}
428#endif
429
430
431
432#endif //_ICCELEMSPECTRAL_H
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
char icChar
Definition IccDefs.h:109
icValidateStatus
Definition IccDefs.h:118
icCLUTElemType
File: IccTagMPE.h.
icElemInterp
Definition IccTagMPE.h:93
unsigned int icUInt32Number
Class: CIccApplyCLUT.
Definition IccTagLut.h:302
Class: CIccApplyMpe.
Definition IccTagMPE.h:203
Class: CIccApplyMpeSpectralCLUT.
virtual const icChar * GetClassName() const
virtual icElemTypeSignature GetType() const
Class: CIccTagMultiProcessElement.
Definition IccTagMPE.h:321
Class: CIccCLUT.
Definition IccTagLut.h:326
Type: Class.
Definition IccIO.h:97
Type: Class.
Class: CIccMpeEmissionCLUT.
virtual ~CIccMpeEmissionCLUT()
virtual const icChar * GetClassName() const
virtual CIccMultiProcessElement * NewCopy() const
virtual const char * GetDescribeName() const
CIccMpeEmissionCLUT & operator=(const CIccMpeEmissionCLUT &ITPC)
CIccMpeEmissionCLUT(const CIccMpeEmissionCLUT &ITPC)
virtual icElemTypeSignature GetType() const
Class: CIccMpeEmissionMatrix.
virtual icElemTypeSignature GetType() const
virtual const char * GetDescribeName() const
CIccMpeEmissionMatrix(const CIccMpeEmissionMatrix &ITPC)
CIccMpeEmissionMatrix & operator=(const CIccMpeEmissionMatrix &ITPC)
virtual CIccMultiProcessElement * NewCopy() const
virtual icUInt16Number numVectors() const
virtual const icChar * GetClassName() const
Class: CIccMpeEmissionObserver.
virtual icElemTypeSignature GetType() const
CIccMpeEmissionObserver & operator=(const CIccMpeEmissionObserver &ITPC)
virtual const char * GetDescribeName() const
CIccMpeEmissionObserver(const CIccMpeEmissionObserver &ITPC)
virtual const icChar * GetClassName() const
virtual CIccMultiProcessElement * NewCopy() const
Class: CIccMpeInvEmissionMatrix.
virtual icUInt16Number numVectors() const
CIccMpeInvEmissionMatrix & operator=(const CIccMpeInvEmissionMatrix &ITPC)
CIccMpeInvEmissionMatrix(const CIccMpeInvEmissionMatrix &ITPC)
virtual icElemTypeSignature GetType() const
virtual CIccMultiProcessElement * NewCopy() const
virtual const char * GetDescribeName() const
virtual const icChar * GetClassName() const
Class: CIccMpeReflectanceCLUT.
virtual const icChar * GetClassName() const
CIccMpeReflectanceCLUT & operator=(const CIccMpeReflectanceCLUT &ITPC)
virtual icElemTypeSignature GetType() const
virtual const char * GetDescribeName() const
virtual CIccMpeReflectanceCLUT * NewCopy() const
CIccMpeReflectanceCLUT(const CIccMpeReflectanceCLUT &ITPC)
virtual bool IsLateBindingReflectance() const
Class: CIccMpeReflectanceObserver.
virtual const char * GetDescribeName() const
CIccMpeReflectanceObserver & operator=(const CIccMpeReflectanceObserver &ITPC)
virtual icElemTypeSignature GetType() const
CIccMpeReflectanceObserver(const CIccMpeReflectanceObserver &ITPC)
virtual bool IsLateBindingReflectance() const
virtual const icChar * GetClassName() const
virtual CIccMpeReflectanceObserver * NewCopy() const
Class: CIccMpeSpectralCLUT.
icFloatNumber * GetWhite()
virtual bool IsLateBinding() const
icUInt32Number m_flags
icUInt16Number m_nStorageType
virtual const char * GetDescribeName() const =0
icSpectralRange m_Range
CIccCLUT * GetApplyCLUT()
icCLUTElemType m_interpType
icFloatNumber * m_pWhite
Class: CIccMpeSpectralMatrix.
virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const =0
icUInt16Number m_nReserved2
icFloatNumber * GetOffset()
virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)=0
icFloatNumber * GetMatrix()
const icSpectralRange & GetRange()
icFloatNumber * GetWhite()
virtual bool IsLateBinding() const
icFloatNumber * m_pOffset
virtual const char * GetDescribeName() const =0
CIccMatrixMath * m_pApplyMtx
icSpectralRange m_Range
icFloatNumber * m_pWhite
virtual icUInt16Number numVectors() const =0
icFloatNumber * m_pMatrix
Class: CIccMpeSpectralObserver.
virtual const char * GetDescribeName() const =0
icFloatNumber * GetWhite()
virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)=0
virtual bool IsLateBinding() const
const icSpectralRange & GetRange()
CIccMatrixMath * m_pApplyMtx
Class: CIccMultiProcessElement.
Definition IccTagMPE.h:146
Class: CIccTagMultiProcessElement.
Definition IccTagMPE.h:358
unsigned short icUInt16Number
icElemTypeSignature
Multi-Processing Element type signatures.
@ icSigEmissionMatrixElemType
@ icSigEmissionCLUTElemType
@ icSigReflectanceCLUTElemType
@ icSigReflectanceObserverElemType
@ icSigEmissionObserverElemType
@ icSigInvEmissionMatrixElemType
spectral range