-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathicc_profile.h
181 lines (156 loc) · 6.45 KB
/
icc_profile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/*
* ICC Examin ist eine ICC Profil Betrachter
*
* Copyright (C) 2004-2011 Kai-Uwe Behrmann
*
* Autor: Kai-Uwe Behrmann <[email protected]>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* -----------------------------------------------------------------------------
*
* profile interpretation
*
*/
// Date: Mai 2004
#ifndef ICC_PROFILE_H
#define ICC_PROFILE_H
#include "icc_utils.h"
#include "icc_formeln.h"
//#include "icc_helfer.h"
#include "icc_speicher.h"
#include "icc_measurement.h"
#include "icc_profile_header.h"
#include "icc_profile_tags.h"
#include <icc34.h>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <fstream>
/**
* @brief internal ICC profile struktur
**/
class ICCprofile;
// defined in icc_profile.cpp
class ICCprofile {
friend class ICCtag;
friend class ICCmeasurement;
ICCprofile & copy_ ( const ICCprofile & p );
public:
typedef enum {
ICCnullDATA,
ICCprofileDATA,
ICCcorruptedprofileDATA,
ICCmeasurementDATA,
ICCvrmlDATA,
ICCimageDATA
} ICCDataType;
ICCprofile ();
ICCprofile ( const Speicher & s);
ICCprofile ( const ICCprofile & p );
ICCprofile & operator= (const ICCprofile & );
virtual ~ICCprofile (void);
void clear (void);
ICCDataType load (const Speicher & profil);
ICCDataType data_type; //!< is set at least at load time
bool changing() { return changing_; }
private:
bool changing_;
std::string filename_;
// icc34.h definitions
char* data_;
size_t size_;
oyProfile_s * profile_;
public:
oyProfile_s * oyProfile() { oyProfile_Copy( profile_, 0 ); return profile_; }
private:
ICCheader header;
ICClist<ICCtag> tags;
private: // cgats via lcms
ICCmeasurement measurement;
public:
void measurementReparent() { measurement.profile_ = this; }
public: // informations
const char* filename ();
void filename (const char* s);
size_t size ();
//const char* cmm () {DBG_PROG return header.cmmName(); }
//void cmm (const char* s) {DBG_PROG header.cmmName (s); }
//int version () {DBG_PROG return (int) header.version(); }
//const char* creator () {DBG_PROG return header.creatorName(); }
//! rendering intent; see as well @see: ICCexamin.intent()
int intent () {return icValue(((const icHeader*)header
.headerRaw())-> renderingIntent ); }
icColorSpaceSignature colorSpace() {return header.colorSpace(); }
std::string printHeader ();
std::string printLongHeader ();
ICClist<std::string> getPCSNames();
icColorSpaceSignature getPCS() {return header.pcs(); }
// tag infos
int tagCount();
ICClist<std::string> printTags (); //!< list of tags (5)
ICClist<std::string> printTagInfo (int item); //!< name,typ
ICClist<std::string> getTagText (int item); //!< content
ICClist<std::string> getTagDescription (int item);
ICClist<double> getTagCIEXYZ (int item);
ICClist<double> getTagCurve (int item);
ICClist<ICClist<double> >
getTagCurves (int item, ICCtag::MftChain typ);
ICClist<ICClist<ICClist<ICClist<double> > > >
getTagTable ( int item,
ICCtag::MftChain typ,
ICClist<int> channels );
ICClist<double> getTagNumbers (int item, ICCtag::MftChain typ);
oyStructList_s * getTagNumbers (int item);
ICClist<std::string> getTagChannelNames(int item, ICCtag::MftChain typ);
bool hasTagName (std::string name); //!< name
int getTagIDByName (std::string name); //!< name
int getTagCount ();
//! profile infos
//char* getProfileInfo ();
char* getProfileDescription ();
ICClist<double> getWhitePkt (void);
int getColourChannelsCount ();
int hasCLUT ();
bool valid ();
public: // file I/O
int checkProfileDevice (char* type,
icProfileClassSignature deviceClass);
public: // measurement infos
bool hasMeasurement ();
bool tagBelongsToMeasurement (int tag);
std::string report ( bool export_ausserhalb,
oyOptions_s * opts );
ICCmeasurement& getMeasurement ();
std::string cgats ();
std::string cgats_max ();
public: // profile generation
void setHeader (const void* h);
ICCheader getHeader () { return header; };
void addTag (ICCtag & tag);
ICCtag& getTag (int item);
ICCtag& getTag (std::string name);
int removeTag (int item);
int removeTag (std::string name);
size_t getProfileSize ();
char* saveProfileToMem (size_t* size);
private:
void writeTags (void);
void writeHeader (void);
void writeTagTable (void);
};
ICCprofile::ICCDataType guessFileType( const char * filename );
#endif //ICC_PROFILE_H