89 std::string file =
"ISO22028-Encoded-";
90 file += (
char*)szColorSpaceName;
129 if (!pTag || pTag->
GetSize()<1)
137 XYZ[0] = Y*xy[0] / xy[1];
139 XYZ[idxOffset<<1] = Y*(1.0f-xy[0]-xy[1]) / xy[1];
157 pMediaWhitePt = pWhitePt;
159 if (!pMediaWhitePt || pMediaWhitePt->
GetNumValues()<2) {
163 CIccProfile *pIcc =
new CIccProfile;
164 pIcc->m_Header = *pHeader;
170 newtime = gmtime( &long_time );
172 pIcc->m_Header.date.year = newtime->tm_year+1900;
173 pIcc->m_Header.date.month = newtime->tm_mon+1;
174 pIcc->m_Header.date.day = newtime->tm_mday;
175 pIcc->m_Header.date.hours = newtime->tm_hour;
176 pIcc->m_Header.date.minutes = newtime->tm_min;
177 pIcc->m_Header.date.seconds = newtime->tm_sec;
184 pIcc->m_Header.illuminant.X =
icDtoF(XYZWhite[0]);
185 pIcc->m_Header.illuminant.Y =
icDtoF(XYZWhite[1]);
186 pIcc->m_Header.illuminant.Z =
icDtoF(XYZWhite[2]);
195 (*pXYZ)[0].X =
icDtoF(XYZMedia[0]);
196 (*pXYZ)[0].Y =
icDtoF(XYZMedia[1]);
197 (*pXYZ)[0].Z =
icDtoF(XYZMedia[2]);
212 bool bHaveLumMtx =
false;
236 if (pSegCurve && pSegCurve->
GetCurve()) {
267 if (!pxy || pxy->
GetSize()<2) {
272 mtx[0]=(*pxy)[0] * XYZMedia[0];
273 mtx[3]=(*pxy)[1] * XYZMedia[1];
274 mtx[6]=(1.0f - (*pxy)[0] - (*pxy)[1]) * XYZMedia[2];
277 if (!pxy || pxy->
GetSize()<2) {
282 mtx[1]=(*pxy)[0] * XYZMedia[0];
283 mtx[4]=(*pxy)[1] * XYZMedia[1];
284 mtx[7]=(1.0f - (*pxy)[0] - (*pxy)[1]) * XYZMedia[2];
287 if (!pxy || pxy->
GetSize()<2) {
292 mtx[2]=(*pxy)[0] * XYZMedia[0];
293 mtx[5]=(*pxy)[1] * XYZMedia[1];
294 mtx[8]=(1.0f - (*pxy)[0] - (*pxy)[1]) * XYZMedia[2];
320 if (pSegCurve && pSegCurve->
GetCurve()) {
323 if (!pCurves || !pCurves->
SetSize(3)) {
373 if (pSurround && pSurround->
GetSize()>=2) {
417 if (!pCstmConvert2) {
422 *pCstmConvert2 = *pCstmConvert;
428 delete pCstmConvert2;
435 delete pCstmConvert2;
446 delete pCstmConvert2;
457 delete pCstmConvert2;
462 pCam->
SetCAM(pCstmConvert);
468 delete pCstmConvert2;
473 pCam->
SetCAM(pStdConvert);
486 delete pCstmConvert2;
491 pCam->
SetCAM(pStdConvert2);
496 delete pCstmConvert2;
500 pCam->
SetCAM(pCstmConvert2);
505#if 1 && defined(_DEBUG)
547 if (!strcmp((
const char*)szRefName,
"ISO 22028-1")) {
577 TagEntryList::iterator entry;
578 for (entry=pTags->begin(); entry!=pTags->end(); entry++) {
581 pStruct->
AttachElem(entry->TagInfo.sig, entry->pTag->NewCopy());
icFloatNumber icD50XYZ[3]
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
static void icYxy2XYZVector(icFloatNumber *XYZ, icFloatNumber Y, icFloatNumber *xy, icUInt8Number idxOffset=1)
static icFloatNumber icGetParamFloatNum(CIccTagStruct *pParams, icColorEncodingParamsMemberSignature sig, icFloatNumber defaultValue=0)
static IIccEncProfileCacheHandler * g_pEncProfileCacheHandler
static IIccEncProfileConverter * g_pEncProfileConverter
icStatusEncConvert icConvertEncodingProfile(CIccProfilePtr &newIcc, CIccProfile *pEncodeIcc)
@ icEncConvertNoBaseProfile
@ icEncConvertBadBaseProfile
@ icEncConvertMemoryError
bool SaveIccProfile(const icChar *szFilename, CIccProfile *pIcc, icProfileIDSaveMethod nWriteId)
Name: SaveIccProfile.
CIccProfile * OpenIccProfile(const icChar *szFilename, bool bUseSubProfile)
Name: OpenIccProfile.
bool icMatrixInvert3x3(icFloatNumber *M)
Name: icMatrixInvert3x3.
icS15Fixed16Number icDtoF(icFloatNumber num)
void SetParameter_Nc(icFloatNumber Nc)
void SetParameter_La(icFloatNumber La)
void SetParameter_F(icFloatNumber F)
void SetParameter_C(icFloatNumber c)
void SetParameter_Yb(icFloatNumber YB)
void SetParameter_WhitePoint(icFloatNumber *whitePoint)
CIccDefaultEncProfileCacheHandler()
virtual CIccProfile * GetEncodingProfile(const icUChar *szColorSpaceName)
virtual icStatusEncConvert ConvertFromParams(CIccProfilePtr &newIcc, CIccTagStruct *pParams, icHeader *pHeader)
CIccDefaultEncProfileConverter()
void SetCAM(CIccCamConverter *pCAM)
bool SetSize(int nNewSize)
Name: CIccMpeCurveSet::SetSize.
bool SetCurve(int nIndex, icCurveSetCurvePtr newCurve)
Name: CIccMpeCurveSet::SetCurve.
icFloatNumber * GetMatrix() const
bool SetSize(icUInt16Number nInputChannels, icUInt16Number nOutputChannels, bool bUseConstants=true)
Name: CIccMpeMatrix::SetSize.
virtual CIccMultiProcessElement * NewCopy() const
static CIccMultiProcessElement * Create(icElemTypeSignature sig)
Name: CIccMultiProcessElement::Create.
Class: CIccSegmentedCurve.
virtual CIccCurveSetCurve * NewCopy() const
virtual bool GetValues(icFloatNumber *DstVector, icUInt32Number nStart=0, icUInt32Number nVectorSize=1) const
Name: CIccTagFloatNum::GetValues.
virtual icUInt32Number GetNumValues() const
icUInt32Number GetSize() const
Returns the size of the data array.
static CIccTag * Create(icTagTypeSignature sig)
Name: CIccTag::Create.
virtual CIccTag * NewCopy() const
Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.
Class: CIccTagMultiProcessElement.
virtual void Attach(CIccMultiProcessElement *pElement)
Name: CIccTagMultiProcessElement::Attach.
void SetChannels(icUInt16Number nInputChannels, icUInt16Number nOutputChannels)
Class: CIccTagSegmentedCurve.
CIccSegmentedCurve * GetCurve()
Class: CIccTagSpectralViewingConditions.
icFloatXYZNumber m_surroundXYZ
icFloatXYZNumber m_illuminantXYZ
bool setIlluminant(icIlluminant illumId, const icSpectralRange &illumRange, const icFloatNumber *illum, icFloatNumber illumCCT=0.0f)
bool AttachElem(icSignature sig, CIccTag *pTag)
Name: CIccTagStruct::AttachTag.
CIccTag * FindElemOfType(icSignature sig, icTagTypeSignature sigType)
Name: CIccTagStruct::FindElemOfType.
icFloatNumber GetElemNumberValue(icSignature sig, icFloatNumber defaultValue=0)
Name: CIccTagStruct::GetElemNumberValue.
bool DeleteElem(icSignature sig)
Name: CIccTagStruct::DeleteSubTag.
TagEntryList * GetElemList()
virtual icStructSignature GetTagStructType() const
const icUChar * GetText() const
bool SetSize(icUInt32Number nSize, bool bZeroNew=true)
Name: CIccTagXYZ::SetSize.
virtual CIccProfile * GetEncodingProfile(const icUChar *szColorSpaceName)=0
static void SetEncCacheHandler(IIccEncProfileCacheHandler *pHandler)
static IIccEncProfileCacheHandler * GetHandler()
static void SetEncProfileConverter(IIccEncProfileConverter *pConverter)
static IIccEncProfileConverter * GetHandler()
virtual icStatusEncConvert ConvertFromParams(CIccProfilePtr &newIcc, CIccTagStruct *pParams, icHeader *pHeader)=0