IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
IccTagBasic.cpp File Reference
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "IccTag.h"
#include "IccUtil.h"
#include "IccProfile.h"
#include "IccTagFactory.h"
#include "IccConvertUTF.h"
#include "IccSparseMatrix.h"
#include "IccCmm.h"
#include <algorithm>
+ Include dependency graph for IccTagBasic.cpp:

Go to the source code of this file.

Data Structures

struct  icIllumDef
 
struct  icObserverDef
 

Macros

#define __min   min
 
#define BRIEF_STRING_SIZE   (1024)
 
#define NUM_KNOWN_ILLUM   (sizeof(icKnownIllums)/sizeof(icKnownIllums[0]))
 
#define NUM_KNOWN_OBSERVERS   (sizeof(icKnownObservers)/sizeof(icKnownObservers[0]))
 

Functions

bool icGetTagText (const CIccTag *pTag, std::string &text)
 

Variables

struct { 
 
const char * code
 
const char * interp
 
icExampleCicpCodes [] 
 
static unsigned char icFaultyXmlZipData [4] = { 0,0,0,1 }
 
static icSpectralRange icKnownIllumObsRange = { icRange380nm, icRange780nm, 81 }
 
static icIllumDef icKnownIllums []
 
static icObserverDef icKnownObservers []
 

Detailed Description

File: IccTagBasic.cpp

Contains: Implementation of the CIccTag class and basic inherited classes

Version: V1

Copyright: © see ICC Software License

Definition in file IccTagBasic.cpp.


Data Structure Documentation

◆ icIllumDef

struct icIllumDef
Data Fields
icIlluminant illum
icFloatNumber spd[81]

◆ icObserverDef

struct icObserverDef
Data Fields
icFloatNumber cmf[81 *3]
icStandardObserver obs

Macro Definition Documentation

◆ __min

#define __min   min

◆ BRIEF_STRING_SIZE

#define BRIEF_STRING_SIZE   (1024)

◆ NUM_KNOWN_ILLUM

#define NUM_KNOWN_ILLUM   (sizeof(icKnownIllums)/sizeof(icKnownIllums[0]))

◆ NUM_KNOWN_OBSERVERS

#define NUM_KNOWN_OBSERVERS   (sizeof(icKnownObservers)/sizeof(icKnownObservers[0]))

Function Documentation

◆ icGetTagText()

bool icGetTagText ( const CIccTag pTag,
std::string &  text 
)
11614{
11615 if (!pTag) {
11616 text = "";
11617 return false;
11618 }
11619 switch (pTag->GetType()) {
11620 case icSigTextType:
11621 {
11622 CIccTagText *pTextTag = (CIccTagText*)pTag;
11623 const char *szText = pTextTag->GetText();
11624 if (szText) {
11625 text = szText;
11626 return true;
11627 }
11628 }
11629 text = "";
11630 return false;
11631
11632 case icSigUtf8TextType:
11633 {
11634 CIccTagUtf8Text *pTextTag = (CIccTagUtf8Text*)pTag;
11635 const char *szText = (const char*)pTextTag->GetText();
11636 if (szText) {
11637 text = szText;
11638 return true;
11639 }
11640 }
11641 text = "";
11642 return false;
11643
11645 {
11646 CIccTagZipUtf8Text *pTextTag = (CIccTagZipUtf8Text*)pTag;
11647 bool rv = pTextTag->GetText(text);
11648 return rv;
11649 }
11650
11651 case icSigUtf16TextType:
11652 {
11653 CIccTagUtf16Text *pTextTag = (CIccTagUtf16Text*)pTag;
11654 const icChar *szText = pTextTag->GetText(text);
11655 if (szText)
11656 return true;
11657 }
11658 return false;
11659
11661 {
11663 const char *szText = pTextTag->GetText();
11664 if (szText) {
11665 text = szText;
11666 return true;
11667 }
11668 }
11669 text = "";
11670 return false;
11671
11673 {
11675 CIccLocalizedUnicode *pText = pTextTag->Find();
11676 if (pText) {
11677 bool rv = pText->GetText(text);
11678 return rv;
11679 }
11680 }
11681 text = "";
11682 return false;
11683
11684 default:
11685 text = "";
11686 return false;
11687 }
11688}
@ icSigUtf8TextType
Definition icProfileHeader.h:574
@ icSigMultiLocalizedUnicodeType
Definition icProfileHeader.h:549
@ icSigUtf16TextType
Definition icProfileHeader.h:575
@ icSigTextDescriptionType
Definition icProfileHeader.h:566
@ icSigTextType
Definition icProfileHeader.h:565
@ icSigZipUtf8TextType
Definition icProfileHeader.h:578
char icChar
Definition IccDefs.h:110
virtual icTagTypeSignature GetType() const
Definition IccTagBasic.h:131
Definition IccTagBasic.h:284
const icChar * GetText() const
Definition IccTagBasic.h:300
Definition IccTagBasic.h:322
const icUChar * GetText() const
Definition IccTagBasic.h:338
Definition IccTagBasic.h:367
virtual bool GetText(std::string &str) const
Definition IccTagBasic.cpp:1245
Definition IccTagBasic.h:434
const icChar * GetText(std::string &bufStr) const
Definition IccTagBasic.cpp:1728
Definition IccTagBasic.h:481
const icChar * GetText() const
Definition IccTagBasic.h:497
Definition IccTagBasic.h:1169
bool GetText(std::string &text)
Definition IccTagBasic.cpp:7083
Definition IccTagBasic.h:1229
CIccLocalizedUnicode * Find(icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
Definition IccTagBasic.cpp:7692

References CIccTagMultiLocalizedUnicode::Find(), CIccTagText::GetText(), CIccTagUtf8Text::GetText(), CIccTagTextDescription::GetText(), CIccTagUtf16Text::GetText(), CIccTagZipUtf8Text::GetText(), CIccLocalizedUnicode::GetText(), CIccTag::GetType(), icSigMultiLocalizedUnicodeType, icSigTextDescriptionType, icSigTextType, icSigUtf16TextType, icSigUtf8TextType, and icSigZipUtf8TextType.

Referenced by CCubeWriter::iterate(), and main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ [struct]

struct { ... } icExampleCicpCodes[]
Initial value:
= {
{ "1-1-0-0", "RGB narrow range representation specified in Recommendation ITU-R BT.709-6, Item 3.4"},
{ "1-13-0-1", "RGB full range representation specified in IEC 61966-2-1 sRGB"},
{ "9-14-0-0", "R’G’B’ narrow range representation specified in Recommendation ITU-R BT.2020-2, Table 5"},
{ "9-16-0-0", "PQ R’G’B’ narrow range representation specified in Recommendation ITU-R BT.2100-2, Table 9"},
{ "9-16-0-1", "PQ R’G’B’ full range representation specified in Recommendation ITU-R BT.2100-2, Table 9"},
{ "9-18-0-0 ", "HLG R’G’B’ narrow range representation specified in Recommendation ITU-R BT.2100-2 "},
{ "9-18-0-1", "HLG R’G’B’ full range representation specified in Recommendation ITU-R BT.2100-2"},
{ "1-1-1-0 ", "YCbCr representation specified in Recommendation ITU-R BT.709-6, Item 3.4"},
{ "9-14-9-0", "Y’Cb’Cr’ narrow range representation specified in Recommendation ITU-R BT.2020-2, Table 5"},
{ "9-16-9-0", "PQ Y’Cb’Cr’ narrow range representation specified in Recommendation ITU-R BT.2100-2, Table 9"},
{ "9-16-14-0", "PQ ICtCp narrow range representation specified in Recommendation ITU-R BT.2100-2, Table 9"},
{ "9-18-9-0", "HLG Y’Cb’Cr’ narrow range representation specified in Recommendation ITU-R BT.2100-2"},
{ "9-18-14-0 ", "HLG ICtCp narrow range representation specified in Recommendation ITU-R BT.2100-2"},
{ NULL, NULL},
}

◆ icFaultyXmlZipData

unsigned char icFaultyXmlZipData[4] = { 0,0,0,1 }
static
1046{ 0,0,0,1 };

◆ icKnownIllumObsRange

icSpectralRange icKnownIllumObsRange = { icRange380nm, icRange780nm, 81 }
static
11403{ icRange380nm, icRange780nm, 81 };
#define icRange380nm
Definition icProfileHeader.h:1473
#define icRange780nm
Definition icProfileHeader.h:1476

Referenced by CIccTagSpectralViewingConditions::getIlluminant(), and CIccTagSpectralViewingConditions::getObserver().

◆ icKnownIllums

icIllumDef icKnownIllums[]
static
11343 {
11345 { 24.457147f, 27.147280f, 29.837414f, 39.547443f, 49.257472f, 52.859364f, 56.461255f,
11346 58.222678f, 59.984100f, 58.878685f, 57.773270f, 66.274622f, 74.775973f, 80.987003f,
11347 87.198034f, 88.882488f, 90.566943f, 90.947782f, 91.328622f, 93.200755f, 95.072887f,
11348 93.503707f, 91.934527f, 93.817670f, 95.700813f, 96.147589f, 96.594366f, 96.854869f,
11349 97.115372f, 99.602130f, 102.088888f, 101.418624f, 100.748359f, 101.531110f, 102.313861f,
11350 101.156931f, 100.000000f, 98.868725f, 97.737450f, 98.330520f, 98.923589f, 96.216919f,
11351 93.510248f, 95.607997f, 97.705746f, 98.498795f, 99.291845f, 99.179895f, 99.067945f,
11352 97.409311f, 95.750676f, 97.322057f, 98.893438f, 97.299430f, 95.705421f, 96.969799f,
11353 98.234177f, 100.644248f, 103.054319f, 101.119636f, 99.184954f, 93.304566f, 87.424178f,
11354 89.538557f, 91.652935f, 92.293256f, 92.933577f, 84.912496f, 76.891415f, 81.721450f,
11355 86.551486f, 89.586840f, 92.622195f, 85.443791f, 78.265387f, 67.992302f, 57.719217f,
11356 70.340670f, 82.962124f, 80.636096f, 78.310068f }
11357 },
11359 { 49.975500f, 52.311800f, 54.648200f, 68.701500f, 82.754900f, 87.120400f, 91.486000f,
11360 92.458900f, 93.431800f, 90.057000f, 86.682300f, 95.773600f, 104.865000f, 110.936000f,
11361 117.008000f, 117.410000f, 117.812000f, 116.336000f, 114.861000f, 115.392000f, 115.923000f,
11362 112.367000f, 108.811000f, 109.082000f, 109.354000f, 108.578000f, 107.802000f, 106.296000f,
11363 104.790000f, 106.239000f, 107.689000f, 106.047000f, 104.405000f, 104.225000f, 104.046000f,
11364 102.023000f, 100.000000f, 98.167100f, 96.334200f, 96.061100f, 95.788000f, 92.236800f,
11365 88.685600f, 89.345900f, 90.006200f, 89.802600f, 89.599100f, 88.648900f, 87.698700f,
11366 85.493600f, 83.288600f, 83.493900f, 83.699200f, 81.863000f, 80.026800f, 80.120700f,
11367 80.214600f, 81.246200f, 82.277800f, 80.281000f, 78.284200f, 74.002700f, 69.721300f,
11368 70.665200f, 71.609100f, 72.979000f, 74.349000f, 67.976500f, 61.604000f, 65.744800f,
11369 69.885600f, 72.486300f, 75.087000f, 69.339800f, 63.592700f, 55.005400f, 46.418200f,
11370 56.611800f, 66.805400f, 65.094100f, 63.382800f }
11371 },
11373 { 92.424314f, 92.694368f, 92.964422f, 111.383899f, 129.803377f, 135.801152f, 141.798926f,
11374 141.447583f, 141.096240f, 133.975439f, 126.854638f, 135.602812f, 144.350987f, 149.960021f,
11375 155.569056f, 154.184112f, 152.799168f, 148.783207f, 144.767246f, 143.338753f, 141.910261f,
11376 136.139746f, 130.369231f, 128.545220f, 126.721209f, 124.329813f, 121.938418f, 117.937629f,
11377 113.936841f, 114.043847f, 114.150853f, 111.519464f, 108.888075f, 107.474441f, 106.060808f,
11378 103.030404f, 100.000000f, 97.314129f, 94.628259f, 93.347855f, 92.067450f, 88.659570f,
11379 85.251689f, 84.758623f, 84.265557f, 83.380599f, 82.495642f, 80.837162f, 79.178681f,
11380 76.519588f, 73.860495f, 73.447089f, 73.033684f, 71.360089f, 69.686495f, 69.189247f,
11381 68.692000f, 68.742482f, 68.792965f, 67.049716f, 65.306467f, 61.725711f, 58.144955f,
11382 58.497707f, 58.850460f, 60.339599f, 61.828738f, 56.573774f, 51.318811f, 54.969052f,
11383 58.619293f, 60.929241f, 63.239189f, 58.464199f, 53.689209f, 46.273925f, 38.858642f,
11384 47.398674f, 55.938706f, 54.609104f, 53.279502f,
11385 }
11386 },
11387 { icIlluminantA,
11388 { 9.7951f, 10.8996f, 12.0853f, 13.3543f, 14.7080f, 16.1480f, 17.6753f, 19.2907f,
11389 20.9950f, 22.7883f, 24.6709f, 26.6425f, 28.7027f, 30.8508f, 33.0859f, 35.4068f,
11390 37.8121f, 40.3002f, 42.8693f, 45.5174f, 48.2423f, 51.0418f, 53.9132f, 56.8539f,
11391 59.8611f, 62.9320f, 66.0635f, 69.2525f, 72.4959f, 75.7903f, 79.1326f, 82.5193f,
11392 85.9470f, 89.4124f, 92.9120f, 96.4423f, 100.0000f, 103.5820f, 107.1840f, 110.8030f,
11393 114.4360f, 118.0800f, 121.7310f, 125.3860f, 129.0430f, 132.6970f, 136.3460f, 139.9880f,
11394 143.6180f, 147.2350f, 150.8360f, 154.4180f, 157.9790f, 161.5160f, 165.0280f, 168.5100f,
11395 171.9630f, 175.3830f, 178.7690f, 182.1180f, 185.4290f, 188.7010f, 191.9310f, 195.1180f,
11396 198.2610f, 201.3590f, 204.4090f, 207.4110f, 210.3650f, 213.2680f, 216.1200f, 218.9200f,
11397 221.6670f, 224.3610f, 227.0000f, 229.5850f, 232.1150f, 234.5890f, 237.0080f, 239.3700f,
11398 241.6750f, }
11399 },
11400};
@ icIlluminantA
Definition icProfileHeader.h:1197
@ icIlluminantD65
Definition icProfileHeader.h:1193
@ icIlluminantD93
Definition icProfileHeader.h:1194
@ icIlluminantD50
Definition icProfileHeader.h:1192

Referenced by CIccTagSpectralViewingConditions::getIlluminant().

◆ icKnownObservers

icObserverDef icKnownObservers[]
static
11488 {
11490 { 0.001368f, 0.002236f, 0.004243f, 0.007650f, 0.014310f, 0.023190f, 0.043510f,
11491 0.077630f, 0.134380f, 0.214770f, 0.283900f, 0.328500f, 0.348280f, 0.348060f,
11492 0.336200f, 0.318700f, 0.290800f, 0.251100f, 0.195360f, 0.142100f, 0.095640f,
11493 0.057950f, 0.032010f, 0.014700f, 0.004900f, 0.002400f, 0.009300f, 0.029100f,
11494 0.063270f, 0.109600f, 0.165500f, 0.225750f, 0.290400f, 0.359700f, 0.433450f,
11495 0.512050f, 0.594500f, 0.678400f, 0.762100f, 0.842500f, 0.916300f, 0.978600f,
11496 1.026300f, 1.056700f, 1.062200f, 1.045600f, 1.002600f, 0.938400f, 0.854450f,
11497 0.751400f, 0.642400f, 0.541900f, 0.447900f, 0.360800f, 0.283500f, 0.218700f,
11498 0.164900f, 0.121200f, 0.087400f, 0.063600f, 0.046770f, 0.032900f, 0.022700f,
11499 0.015840f, 0.011359f, 0.008111f, 0.005790f, 0.004109f, 0.002899f, 0.002049f,
11500 0.001440f, 0.001000f, 0.000690f, 0.000476f, 0.000332f, 0.000235f, 0.000166f,
11501 0.000117f, 0.000083f, 0.000059f, 0.000042f,
11502 0.000039f, 0.000064f, 0.000120f, 0.000217f, 0.000396f, 0.000640f, 0.001210f,
11503 0.002180f, 0.004000f, 0.007300f, 0.011600f, 0.016840f, 0.023000f, 0.029800f,
11504 0.038000f, 0.048000f, 0.060000f, 0.073900f, 0.090980f, 0.112600f, 0.139020f,
11505 0.169300f, 0.208020f, 0.258600f, 0.323000f, 0.407300f, 0.503000f, 0.608200f,
11506 0.710000f, 0.793200f, 0.862000f, 0.914850f, 0.954000f, 0.980300f, 0.994950f,
11507 1.000000f, 0.995000f, 0.978600f, 0.952000f, 0.915400f, 0.870000f, 0.816300f,
11508 0.757000f, 0.694900f, 0.631000f, 0.566800f, 0.503000f, 0.441200f, 0.381000f,
11509 0.321000f, 0.265000f, 0.217000f, 0.175000f, 0.138200f, 0.107000f, 0.081600f,
11510 0.061000f, 0.044580f, 0.032000f, 0.023200f, 0.017000f, 0.011920f, 0.008210f,
11511 0.005723f, 0.004102f, 0.002929f, 0.002091f, 0.001484f, 0.001047f, 0.000740f,
11512 0.000520f, 0.000361f, 0.000249f, 0.000172f, 0.000120f, 0.000085f, 0.000060f,
11513 0.000042f, 0.000030f, 0.000021f, 0.000015f,
11514 0.006450f, 0.010550f, 0.020050f, 0.036210f, 0.067850f, 0.110200f, 0.207400f,
11515 0.371300f, 0.645600f, 1.039050f, 1.385600f, 1.622960f, 1.747060f, 1.782600f,
11516 1.772110f, 1.744100f, 1.669200f, 1.528100f, 1.287640f, 1.041900f, 0.812950f,
11517 0.616200f, 0.465180f, 0.353300f, 0.272000f, 0.212300f, 0.158200f, 0.111700f,
11518 0.078250f, 0.057250f, 0.042160f, 0.029840f, 0.020300f, 0.013400f, 0.008750f,
11519 0.005750f, 0.003900f, 0.002750f, 0.002100f, 0.001800f, 0.001650f, 0.001400f,
11520 0.001100f, 0.001000f, 0.000800f, 0.000600f, 0.000340f, 0.000240f, 0.000190f,
11521 0.000100f, 0.000050f, 0.000030f, 0.000020f, 0.000010f, 0.000000f, 0.000000f,
11522 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11523 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11524 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11525 0.000000f, 0.000000f, 0.000000f, 0.000000f }
11526 },
11528 { 0.000160f, 0.000662f, 0.002362f, 0.007242f, 0.019110f, 0.043400f, 0.084736f,
11529 0.140638f, 0.204492f, 0.264737f, 0.314679f, 0.357719f, 0.383734f, 0.386726f,
11530 0.370702f, 0.342957f, 0.302273f, 0.254085f, 0.195618f, 0.132349f, 0.080507f,
11531 0.041072f, 0.016172f, 0.005132f, 0.003816f, 0.015444f, 0.037465f, 0.071358f,
11532 0.117749f, 0.172953f, 0.236491f, 0.304213f, 0.376772f, 0.451584f, 0.529826f,
11533 0.616053f, 0.705224f, 0.793832f, 0.878655f, 0.951162f, 1.014160f, 1.074300f,
11534 1.118520f, 1.134300f, 1.123990f, 1.089100f, 1.030480f, 0.950740f, 0.856297f,
11535 0.754930f, 0.647467f, 0.535110f, 0.431567f, 0.343690f, 0.268329f, 0.204300f,
11536 0.152568f, 0.112210f, 0.081261f, 0.057930f, 0.040851f, 0.028623f, 0.019941f,
11537 0.013842f, 0.009577f, 0.006605f, 0.004553f, 0.003145f, 0.002175f, 0.001506f,
11538 0.001045f, 0.000727f, 0.000508f, 0.000356f, 0.000251f, 0.000178f, 0.000126f,
11539 0.000090f, 0.000065f, 0.000046f, 0.000033f,
11540 0.000017f, 0.000072f, 0.000253f, 0.000769f, 0.002004f, 0.004509f, 0.008756f,
11541 0.014456f, 0.021391f, 0.029497f, 0.038676f, 0.049602f, 0.062077f, 0.074704f,
11542 0.089456f, 0.106256f, 0.128201f, 0.152761f, 0.185190f, 0.219940f, 0.253589f,
11543 0.297665f, 0.339133f, 0.395379f, 0.460777f, 0.531360f, 0.606741f, 0.685660f,
11544 0.761757f, 0.823330f, 0.875211f, 0.923810f, 0.961988f, 0.982200f, 0.991761f,
11545 0.999110f, 0.997340f, 0.982380f, 0.955552f, 0.915175f, 0.868934f, 0.825623f,
11546 0.777405f, 0.720353f, 0.658341f, 0.593878f, 0.527963f, 0.461834f, 0.398057f,
11547 0.339554f, 0.283493f, 0.228254f, 0.179828f, 0.140211f, 0.107633f, 0.081187f,
11548 0.060281f, 0.044096f, 0.031800f, 0.022602f, 0.015905f, 0.011130f, 0.007749f,
11549 0.005375f, 0.003718f, 0.002565f, 0.001768f, 0.001222f, 0.000846f, 0.000586f,
11550 0.000407f, 0.000284f, 0.000199f, 0.000140f, 0.000098f, 0.000070f, 0.000050f,
11551 0.000036f, 0.000025f, 0.000018f, 0.000013f,
11552 0.000705f, 0.002928f, 0.010482f, 0.032344f, 0.086011f, 0.197120f, 0.389366f,
11553 0.656760f, 0.972542f, 1.282500f, 1.553480f, 1.798500f, 1.967280f, 2.027300f,
11554 1.994800f, 1.900700f, 1.745370f, 1.554900f, 1.317560f, 1.030200f, 0.772125f,
11555 0.570060f, 0.415254f, 0.302356f, 0.218502f, 0.159249f, 0.112044f, 0.082248f,
11556 0.060709f, 0.043050f, 0.030451f, 0.020584f, 0.013676f, 0.007918f, 0.003988f,
11557 0.001091f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11558 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11559 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11560 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11561 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11562 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11563 0.000000f, 0.000000f, 0.000000f, 0.000000f, }
11564 },
11565};
@ icStdObs1964TenDegrees
Definition icProfileHeader.h:1178
@ icStdObs1931TwoDegrees
Definition icProfileHeader.h:1177

Referenced by CIccTagSpectralViewingConditions::getObserver().