Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccTagMPE.h
Go to the documentation of this file.
1/** @file
2File: IccTagMPE.h
3
4Contains: Header for implementation of CIccTagMultiProcessElement
5and 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// -Jan 30, 2005
69// Initial CIccFloatTag prototype development
70//
71// -Nov 6, 2006
72// Prototype Merged into release
73//
74//////////////////////////////////////////////////////////////////////
75
76#ifndef _ICCTAGMPE_H
77#define _ICCTAGMPE_H
78
79#include "IccProfLibConf.h"
80
81#include "IccTag.h"
82#include "IccTagFactory.h"
83#include "icProfileHeader.h"
84#include <memory>
85#include <list>
86
87
88//CIccFloatTag support
89#ifdef USEREFICCMAXNAMESPACE
90namespace refIccMAX {
91#endif
92
97
100
101class CIccApplyTagMpe;
102class CIccApplyMpe;
103
105
106/**
107****************************************************************************
108* Class: CIccProcessElementPtr
109*
110* Purpose: Get std list class to work with pointers to elements rather than
111* element objects so they can be shared.
112*****************************************************************************
113*/
119
120typedef std::list<CIccMultiProcessElementPtr> CIccMultiProcessElementList;
121typedef CIccMultiProcessElementList::iterator CIccMultiProcessElementIter;
122
124{
125public:
127};
128
129typedef std::list<CIccApplyMpePtr> CIccApplyMpeList;
130typedef CIccApplyMpeList::iterator CIccApplyMpeIter;
131
133{
134public:
135 virtual const char *GetExtClassName()=0;
136};
137
138/**
139****************************************************************************
140* Class: CIccMultiProcessElement
141*
142* Purpose: Base Class for Multi Process Elements
143*****************************************************************************
144*/
146{
147public:
148 CIccMultiProcessElement() { m_nReserved = 0; m_nInputChannels = 0; m_nOutputChannels = 0; }
149
151
153
154 virtual CIccMultiProcessElement *NewCopy() const = 0;
155
156 virtual icElemTypeSignature GetType() const = 0;
157 virtual const icChar *GetClassName() const = 0;
158
159 virtual icUInt16Number NumInputChannels() const { return m_nInputChannels; }
160 virtual icUInt16Number NumOutputChannels() const { return m_nOutputChannels; }
161
162 virtual bool IsSupported() { return true; }
163
164 virtual void Describe(std::string &sDescription, int nVerboseness) = 0;
165
166 virtual bool Read(icUInt32Number size, CIccIO *pIO) = 0;
167 virtual bool Write(CIccIO *pIO) = 0;
168
170
171 virtual CIccApplyMpe* GetNewApply(CIccApplyTagMpe *pApplyTag);
172 virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) const = 0;
173
174 virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement* pMPE=NULL, const CIccProfile* pProfile = NULL) const = 0;
175
176 //Future Acs Expansion Element Accessors
177 virtual bool IsAcs() { return false; }
180
181 // Allow MPE objects to be extended and get extended object type.
182 virtual IIccExtensionMpe *GetExtension() { return NULL; }
183
184 virtual bool IsLateBinding() const { return false; }
185 virtual bool IsLateBindingReflectance() const { return false; }
186
187 //All elements start with a reserved value. Allocate a place to put it.
189
190protected:
193};
194
195/**
196****************************************************************************
197* Class: CIccApplyMpe
198*
199* Purpose: Base Class for Apply storage for Multi Process Elements
200*****************************************************************************
201*/
203{
204public:
206 virtual ~CIccApplyMpe();
207
209 virtual const icChar *GetClassName() const { return "CIccApplyMpe"; }
210
211 CIccMultiProcessElement *GetElem() const { return m_pElem; }
212
213 void Apply(icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) { m_pElem->Apply(this, pDestPixel, pSrcPixel); }
214
215protected:
217
219};
220
221
222/**
223****************************************************************************
224* Class: CIccMpeUnknown
225*
226* Purpose: Base Class for Process Elements
227*****************************************************************************
228*/
230{
231public:
233 CIccMpeUnknown(const CIccMpeUnknown &elem);
234 CIccMpeUnknown &operator=(const CIccMpeUnknown &elem);
235 virtual CIccMultiProcessElement *NewCopy() const { return new CIccMpeUnknown(*this);}
236 virtual ~CIccMpeUnknown();
237
238 virtual icElemTypeSignature GetType() const { return m_sig; }
239 virtual const icChar *GetClassName() const { return "CIccMpeUnknown"; }
240
241 virtual bool IsSupported() { return false; }
242
243 virtual void Describe(std::string &sDescription, int nVerboseness);
244
245 void SetType(icElemTypeSignature sig);
246 void SetChannels(icUInt16Number nInputChannels, icUInt16Number nOutputChannels);
247
248 bool SetDataSize(icUInt32Number nSize, bool bZeroData=true);
249 icUInt8Number *GetData() { return m_pData; }
250
251 virtual bool Read(icUInt32Number nSize, CIccIO *pIO);
252 virtual bool Write(CIccIO *pIO);
253
254 virtual bool Begin(icElemInterp nIterp=icElemInterpLinear, CIccTagMultiProcessElement *pMPE=NULL) { return false; }
255 virtual CIccApplyMpe *GetNewApply() { return NULL; }
256 virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) const {}
257
258 virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement* pMPE=NULL, const CIccProfile* pProfile = NULL) const;
259
260protected:
267};
268
269
270/**
271****************************************************************************
272* Class: CIccDblPixelBuffer
273*
274* Purpose: The general purpose pixel storage buffer for pixel apply
275*****************************************************************************
276*/
278{
279public:
282 CIccDblPixelBuffer &operator=(const CIccDblPixelBuffer &buf);
283 virtual ~CIccDblPixelBuffer();
284
285 void Clean();
286 void Reset() { m_nLastNumChannels = 0; }
287
288 void UpdateChannels(icUInt16Number nNumChannels) {
289 m_nLastNumChannels = nNumChannels;
290 if (nNumChannels>m_nMaxChannels)
291 m_nMaxChannels=nNumChannels;
292 }
293
294 bool Begin();
295
296 icUInt16Number GetMaxChannels() { return m_nMaxChannels; }
297 icFloatNumber *GetSrcBuf() { return m_pixelBuf1; }
298 icFloatNumber *GetDstBuf() { return m_pixelBuf2; }
299
300 void Switch() { icFloatNumber *tmp; tmp=m_pixelBuf2; m_pixelBuf2=m_pixelBuf1; m_pixelBuf1=tmp; }
301
302 icUInt16Number GetAvailChannels() { return m_nLastNumChannels & 0x7fff; }
303
304protected:
305 //For application
310};
311
312
313/**
314****************************************************************************
315* Class: CIccTagMultiProcessElement
316*
317* Purpose: Apply storage for MPE general purpose processing tags
318*****************************************************************************
319*/
321{
322public:
324 virtual ~CIccApplyTagMpe();
325
326 CIccTagMultiProcessElement *GetTag() { return m_pTag; }
327
328 virtual bool AppendElem(CIccMultiProcessElement *pElem);
329
330 CIccDblPixelBuffer *GetBuf() { return &m_applyBuf; }
331 CIccApplyMpeList *GetList() { return m_list; }
332
333 CIccApplyMpeIter begin() { return m_list->begin(); }
334 CIccApplyMpeIter end() { return m_list->end(); }
335
336protected:
338
339 //List of processing elements
341
342 //Pixel data for Apply
344};
345
346
347// Forward reference for CIccTagMultiProcessElement
349
350/**
351****************************************************************************
352* Class: CIccTagMultiProcessElement
353*
354* Purpose: A general purpose processing tag
355*****************************************************************************
356*/
358{
359public:
360 CIccTagMultiProcessElement(icUInt16Number nInputChannels=0, icUInt16Number nOutputChannels=0);
363 virtual CIccTag *NewCopy() const { return new CIccTagMultiProcessElement(*this);}
365
366 virtual bool IsSupported();
367
369 virtual const icChar *GetClassName() const { return "CIccTagMultiProcessElement"; }
370
371 virtual void Describe(std::string &sDescription, int nVerboseness);
372
373 virtual bool Read(icUInt32Number size, CIccIO *pIO);
374 virtual bool Write(CIccIO *pIO);
375
376 virtual void Attach(CIccMultiProcessElement *pElement); //put element at end
377
378 virtual void Insert(CIccMultiProcessElement *pElement); //put element at beginning
379
380 CIccMultiProcessElement *GetElement(int nIndex);
381 void DeleteElement(int nIndex);
382
383 virtual bool Begin(icElemInterp nInterp = icElemInterpLinear,
384 IIccProfileConnectionConditions *pProfilePCC = NULL,
385 IIccProfileConnectionConditions *pAppliedPCC = NULL,
386 IIccCmmEnvVarLookup *pCmmEnvVarLookup = NULL);
387 virtual CIccApplyTagMpe *GetNewApply();
388
389 virtual void Apply(CIccApplyTagMpe *pApply, icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) const;
390
391 virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile* pProfile=NULL) const;
392
393 icUInt16Number NumInputChannels() const { return m_nInputChannels; }
394 icUInt16Number NumOutputChannels() const { return m_nOutputChannels; }
395
396 void SetChannels(icUInt16Number nInputChannels, icUInt16Number nOutputChannels) {m_nInputChannels = nInputChannels; m_nOutputChannels = nOutputChannels;}
397
398 icUInt32Number NumElements() const { return m_list ? (icUInt32Number)(m_list->size()) : 0; }
399
400 bool IsLateBinding() const;
401 bool IsLateBindingReflectance() const;
404
405 IIccCmmEnvVarLookup *GetCmmEnvLookup() { return m_pCmmEnvVarLookup; }
406
407protected:
408 virtual void Clean();
409 virtual void GetNextElemIterator(CIccMultiProcessElementList::iterator &itr);
410 virtual icInt32Number ElementIndex(CIccMultiProcessElement *pElem);
411
412 virtual CIccMultiProcessElementList::iterator GetFirstElem();
413 virtual CIccMultiProcessElementList::iterator GetLastElem();
414
417
418 //List of processing elements
420
421 //Offsets of loaded elements
424
425 //Number of Buffer Channels needed
427
430
432};
433
434
435//CIccMpeTag support
436#ifdef USEREFICCMAXNAMESPACE
437}
438#endif
439
440#endif //_ICCTAGMPE_H
icArraySignature sig
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
File: IccProfLibConf.h.
#define ICCPROFLIB_API
File: IccTag.h.
File: IccTagFactory.h.
std::list< CIccMultiProcessElementPtr > CIccMultiProcessElementList
Definition IccTagMPE.h:120
CIccApplyMpeList::iterator CIccApplyMpeIter
Definition IccTagMPE.h:130
CIccMultiProcessElementList::iterator CIccMultiProcessElementIter
Definition IccTagMPE.h:121
icElemInterp
Definition IccTagMPE.h:93
@ icElemInterpTetra
Definition IccTagMPE.h:95
@ icElemInterpLinear
Definition IccTagMPE.h:94
std::list< CIccApplyMpePtr > CIccApplyMpeList
Definition IccTagMPE.h:129
icTagTypeSignature
unsigned int icUInt32Number
Class: CIccApplyMpe.
Definition IccTagMPE.h:203
virtual icElemTypeSignature GetType() const
Definition IccTagMPE.h:208
CIccMultiProcessElement * m_pElem
Definition IccTagMPE.h:218
CIccMultiProcessElement * GetElem() const
Definition IccTagMPE.h:211
void Apply(icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel)
Definition IccTagMPE.h:213
virtual const icChar * GetClassName() const
Definition IccTagMPE.h:209
CIccApplyTagMpe * m_pApplyTag
Definition IccTagMPE.h:216
CIccApplyMpe * ptr
Definition IccTagMPE.h:126
Class: CIccTagMultiProcessElement.
Definition IccTagMPE.h:321
CIccDblPixelBuffer * GetBuf()
Definition IccTagMPE.h:330
CIccDblPixelBuffer m_applyBuf
Definition IccTagMPE.h:343
CIccTagMultiProcessElement * m_pTag
Definition IccTagMPE.h:337
CIccApplyMpeIter end()
Definition IccTagMPE.h:334
CIccTagMultiProcessElement * GetTag()
Definition IccTagMPE.h:326
CIccApplyMpeList * GetList()
Definition IccTagMPE.h:331
CIccApplyMpeList * m_list
Definition IccTagMPE.h:340
CIccApplyMpeIter begin()
Definition IccTagMPE.h:333
Class: CIccDblPixelBuffer.
Definition IccTagMPE.h:278
icUInt16Number m_nLastNumChannels
Definition IccTagMPE.h:307
icUInt16Number GetAvailChannels()
Definition IccTagMPE.h:302
void UpdateChannels(icUInt16Number nNumChannels)
Definition IccTagMPE.h:288
icFloatNumber * GetSrcBuf()
Definition IccTagMPE.h:297
icUInt16Number m_nMaxChannels
Definition IccTagMPE.h:306
icFloatNumber * m_pixelBuf2
Definition IccTagMPE.h:309
icFloatNumber * m_pixelBuf1
Definition IccTagMPE.h:308
icUInt16Number GetMaxChannels()
Definition IccTagMPE.h:296
icFloatNumber * GetDstBuf()
Definition IccTagMPE.h:298
Type: Class.
Definition IccIO.h:97
Class: CIccMpeUnknown.
Definition IccTagMPE.h:230
virtual bool Begin(icElemInterp nIterp=icElemInterpLinear, CIccTagMultiProcessElement *pMPE=NULL)
Definition IccTagMPE.h:254
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:264
icUInt32Number m_nReserved
Definition IccTagMPE.h:262
icElemTypeSignature m_sig
Definition IccTagMPE.h:261
virtual const icChar * GetClassName() const
Definition IccTagMPE.h:239
virtual CIccMultiProcessElement * NewCopy() const
Definition IccTagMPE.h:235
icUInt8Number * GetData()
Definition IccTagMPE.h:249
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:263
icUInt32Number m_nSize
Definition IccTagMPE.h:265
virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) const
Definition IccTagMPE.h:256
virtual icElemTypeSignature GetType() const
Definition IccTagMPE.h:238
virtual CIccApplyMpe * GetNewApply()
Definition IccTagMPE.h:255
virtual bool IsSupported()
Definition IccTagMPE.h:241
icUInt8Number * m_pData
Definition IccTagMPE.h:266
Class: CIccMultiProcessElement.
Definition IccTagMPE.h:146
virtual icUInt16Number NumInputChannels() const
Definition IccTagMPE.h:159
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) const =0
virtual icUInt16Number NumOutputChannels() const
Definition IccTagMPE.h:160
virtual icAcsSignature GetEAcsSig()
Definition IccTagMPE.h:179
virtual CIccMultiProcessElement * NewCopy() const =0
virtual bool Write(CIccIO *pIO)=0
virtual icAcsSignature GetBAcsSig()
Definition IccTagMPE.h:178
virtual bool Begin(icElemInterp nIterp=icElemInterpLinear, CIccTagMultiProcessElement *pMPE=NULL)=0
virtual bool Read(icUInt32Number size, CIccIO *pIO)=0
virtual bool IsLateBindingReflectance() const
Definition IccTagMPE.h:185
virtual IIccExtensionMpe * GetExtension()
Definition IccTagMPE.h:182
virtual bool IsLateBinding() const
Definition IccTagMPE.h:184
virtual bool IsAcs()
Definition IccTagMPE.h:177
virtual ~CIccMultiProcessElement()
Definition IccTagMPE.h:150
virtual icElemTypeSignature GetType() const =0
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
virtual void Describe(std::string &sDescription, int nVerboseness)=0
virtual const icChar * GetClassName() const =0
virtual bool IsSupported()
Definition IccTagMPE.h:162
icUInt32Number m_nReserved
Definition IccTagMPE.h:188
Class: CIccProcessElementPtr.
Definition IccTagMPE.h:115
CIccMultiProcessElement * ptr
Definition IccTagMPE.h:117
Class: CIccTag.
Class: CIccTagMultiProcessElement.
Definition IccTagMPE.h:358
icUInt16Number NumInputChannels() const
Definition IccTagMPE.h:393
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:415
IIccCmmEnvVarLookup * m_pCmmEnvVarLookup
Definition IccTagMPE.h:431
IIccProfileConnectionConditions * GetAppliedPCC()
Definition IccTagMPE.h:403
virtual const icChar * GetClassName() const
Definition IccTagMPE.h:369
icUInt16Number NumOutputChannels() const
Definition IccTagMPE.h:394
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:416
void DeleteElement(int nIndex)
IIccCmmEnvVarLookup * GetCmmEnvLookup()
Definition IccTagMPE.h:405
CIccMultiProcessElementList * m_list
Definition IccTagMPE.h:419
IIccProfileConnectionConditions * GetProfilePCC()
Definition IccTagMPE.h:402
virtual CIccTag * NewCopy() const
Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.
Definition IccTagMPE.h:363
icUInt32Number NumElements() const
Definition IccTagMPE.h:398
IIccProfileConnectionConditions * m_pAppliedPCC
Definition IccTagMPE.h:429
void SetChannels(icUInt16Number nInputChannels, icUInt16Number nOutputChannels)
Definition IccTagMPE.h:396
icUInt32Number m_nProcElements
Definition IccTagMPE.h:422
icUInt16Number m_nBufChannels
Definition IccTagMPE.h:426
icPositionNumber * m_position
Definition IccTagMPE.h:423
virtual icTagTypeSignature GetType() const
Function: GetType()
Definition IccTagMPE.h:368
IIccProfileConnectionConditions * m_pProfilePCC
Definition IccTagMPE.h:428
Type: Class.
Definition IccUtil.h:401
virtual const char * GetExtClassName()=0
File: icProfileHeader.h.
unsigned char icUInt8Number
Number definitions.
icSignature icAcsSignature
MPE Future Extension Acs signature.
unsigned short icUInt16Number
long icInt32Number
icElemTypeSignature
Multi-Processing Element type signatures.
#define icSigUnknownElemType
Convenience Enum Definitions - Not defined in proposal.
@ icSigMultiProcessElementType
#define icSigAcsZero
Convenience Definition - Not defined in ICC specification.