Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccTagBasic.cpp File Reference

File: IccTagBasic.cpp. More...

#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.

Classes

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 = { 0x5df0 , 0x6218 , 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.

Macro Definition Documentation

◆ __min

#define __min   min

Definition at line 95 of file IccTagBasic.cpp.

◆ BRIEF_STRING_SIZE

#define BRIEF_STRING_SIZE   (1024)

◆ NUM_KNOWN_ILLUM

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

Definition at line 11338 of file IccTagBasic.cpp.

Referenced by CIccTagSpectralViewingConditions::getIlluminant().

◆ NUM_KNOWN_OBSERVERS

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

Definition at line 11503 of file IccTagBasic.cpp.

Referenced by CIccTagSpectralViewingConditions::getObserver().

Function Documentation

◆ icGetTagText()

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

Definition at line 11550 of file IccTagBasic.cpp.

11551{
11552 if (!pTag) {
11553 text = "";
11554 return false;
11555 }
11556 switch (pTag->GetType()) {
11557 case icSigTextType:
11558 {
11559 CIccTagText *pTextTag = (CIccTagText*)pTag;
11560 const char *szText = pTextTag->GetText();
11561 if (szText) {
11562 text = szText;
11563 return true;
11564 }
11565 }
11566 text = "";
11567 return false;
11568
11569 case icSigUtf8TextType:
11570 {
11571 CIccTagUtf8Text *pTextTag = (CIccTagUtf8Text*)pTag;
11572 const char *szText = (const char*)pTextTag->GetText();
11573 if (szText) {
11574 text = szText;
11575 return true;
11576 }
11577 }
11578 text = "";
11579 return false;
11580
11582 {
11583 CIccTagZipUtf8Text *pTextTag = (CIccTagZipUtf8Text*)pTag;
11584 bool rv = pTextTag->GetText(text);
11585 return rv;
11586 }
11587
11588 case icSigUtf16TextType:
11589 {
11590 CIccTagUtf16Text *pTextTag = (CIccTagUtf16Text*)pTag;
11591 const icChar *szText = pTextTag->GetText(text);
11592 if (szText)
11593 return true;
11594 }
11595 return false;
11596
11598 {
11600 const char *szText = pTextTag->GetText();
11601 if (szText) {
11602 text = szText;
11603 return true;
11604 }
11605 }
11606 text = "";
11607 return false;
11608
11610 {
11612 CIccLocalizedUnicode *pText = pTextTag->Find();
11613 if (pText) {
11614 bool rv = pText->GetText(text);
11615 return rv;
11616 }
11617 }
11618 text = "";
11619 return false;
11620
11621 default:
11622 text = "";
11623 return false;
11624 }
11625}
char icChar
Definition IccDefs.h:109
Data Class: CIccLocalizedUnicode.
bool GetText(std::string &text)
Name: CIccLocalizedUnicode::GetText.
virtual icTagTypeSignature GetType() const
Function: GetType()
Class: CIccTagMultiLocalizedUnicode.
CIccLocalizedUnicode * Find(icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
Name: refIccMAX::CIccTagMultiLocalizedUnicode::Find.
Class: CIccTagTextDescription()
const icChar * GetText() const
Class: CIccTagText()
const icChar * GetText() const
Class: CIccTagUtf16Text()
const icChar * GetText(std::string &bufStr) const
Name: CIccTagUtf16Text::GetText.
Class: CIccTagUtf8Text()
const icUChar * GetText() const
Class: CIccTagZipUtf8Text()
virtual bool GetText(std::string &str) const
Name: CIccTagZipUtf8Text::GetText.
@ icSigUtf8TextType
@ icSigMultiLocalizedUnicodeType
@ icSigUtf16TextType
@ icSigTextDescriptionType
@ icSigTextType
@ icSigZipUtf8TextType

References CIccTagMultiLocalizedUnicode::Find(), CIccLocalizedUnicode::GetText(), CIccTagText::GetText(), CIccTagTextDescription::GetText(), CIccTagUtf16Text::GetText(), CIccTagUtf8Text::GetText(), CIccTagZipUtf8Text::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

◆ code

const char* code

Definition at line 4234 of file IccTagBasic.cpp.

Referenced by CIccTagCicp::Describe().

◆ [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},
}

Referenced by CIccTagCicp::Describe().

◆ icFaultyXmlZipData

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

Definition at line 1040 of file IccTagBasic.cpp.

1040{ 0,0,0,1 };

Referenced by CIccTagZipUtf8Text::Describe(), CIccTagZipUtf8Text::GetText(), and CIccTagZipUtf8Text::Validate().

◆ icKnownIllumObsRange

icSpectralRange icKnownIllumObsRange = { 0x5df0 , 0x6218 , 81 }
static

Definition at line 11340 of file IccTagBasic.cpp.

11340{ icRange380nm, icRange780nm, 81 };
#define icRange380nm
Useful spectral range numbers.
#define icRange780nm

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

◆ icKnownIllums

icIllumDef icKnownIllums[]
static

Definition at line 11280 of file IccTagBasic.cpp.

11280 {
11282 { 24.457147f, 27.147280f, 29.837414f, 39.547443f, 49.257472f, 52.859364f, 56.461255f,
11283 58.222678f, 59.984100f, 58.878685f, 57.773270f, 66.274622f, 74.775973f, 80.987003f,
11284 87.198034f, 88.882488f, 90.566943f, 90.947782f, 91.328622f, 93.200755f, 95.072887f,
11285 93.503707f, 91.934527f, 93.817670f, 95.700813f, 96.147589f, 96.594366f, 96.854869f,
11286 97.115372f, 99.602130f, 102.088888f, 101.418624f, 100.748359f, 101.531110f, 102.313861f,
11287 101.156931f, 100.000000f, 98.868725f, 97.737450f, 98.330520f, 98.923589f, 96.216919f,
11288 93.510248f, 95.607997f, 97.705746f, 98.498795f, 99.291845f, 99.179895f, 99.067945f,
11289 97.409311f, 95.750676f, 97.322057f, 98.893438f, 97.299430f, 95.705421f, 96.969799f,
11290 98.234177f, 100.644248f, 103.054319f, 101.119636f, 99.184954f, 93.304566f, 87.424178f,
11291 89.538557f, 91.652935f, 92.293256f, 92.933577f, 84.912496f, 76.891415f, 81.721450f,
11292 86.551486f, 89.586840f, 92.622195f, 85.443791f, 78.265387f, 67.992302f, 57.719217f,
11293 70.340670f, 82.962124f, 80.636096f, 78.310068f }
11294 },
11296 { 49.975500f, 52.311800f, 54.648200f, 68.701500f, 82.754900f, 87.120400f, 91.486000f,
11297 92.458900f, 93.431800f, 90.057000f, 86.682300f, 95.773600f, 104.865000f, 110.936000f,
11298 117.008000f, 117.410000f, 117.812000f, 116.336000f, 114.861000f, 115.392000f, 115.923000f,
11299 112.367000f, 108.811000f, 109.082000f, 109.354000f, 108.578000f, 107.802000f, 106.296000f,
11300 104.790000f, 106.239000f, 107.689000f, 106.047000f, 104.405000f, 104.225000f, 104.046000f,
11301 102.023000f, 100.000000f, 98.167100f, 96.334200f, 96.061100f, 95.788000f, 92.236800f,
11302 88.685600f, 89.345900f, 90.006200f, 89.802600f, 89.599100f, 88.648900f, 87.698700f,
11303 85.493600f, 83.288600f, 83.493900f, 83.699200f, 81.863000f, 80.026800f, 80.120700f,
11304 80.214600f, 81.246200f, 82.277800f, 80.281000f, 78.284200f, 74.002700f, 69.721300f,
11305 70.665200f, 71.609100f, 72.979000f, 74.349000f, 67.976500f, 61.604000f, 65.744800f,
11306 69.885600f, 72.486300f, 75.087000f, 69.339800f, 63.592700f, 55.005400f, 46.418200f,
11307 56.611800f, 66.805400f, 65.094100f, 63.382800f }
11308 },
11310 { 92.424314f, 92.694368f, 92.964422f, 111.383899f, 129.803377f, 135.801152f, 141.798926f,
11311 141.447583f, 141.096240f, 133.975439f, 126.854638f, 135.602812f, 144.350987f, 149.960021f,
11312 155.569056f, 154.184112f, 152.799168f, 148.783207f, 144.767246f, 143.338753f, 141.910261f,
11313 136.139746f, 130.369231f, 128.545220f, 126.721209f, 124.329813f, 121.938418f, 117.937629f,
11314 113.936841f, 114.043847f, 114.150853f, 111.519464f, 108.888075f, 107.474441f, 106.060808f,
11315 103.030404f, 100.000000f, 97.314129f, 94.628259f, 93.347855f, 92.067450f, 88.659570f,
11316 85.251689f, 84.758623f, 84.265557f, 83.380599f, 82.495642f, 80.837162f, 79.178681f,
11317 76.519588f, 73.860495f, 73.447089f, 73.033684f, 71.360089f, 69.686495f, 69.189247f,
11318 68.692000f, 68.742482f, 68.792965f, 67.049716f, 65.306467f, 61.725711f, 58.144955f,
11319 58.497707f, 58.850460f, 60.339599f, 61.828738f, 56.573774f, 51.318811f, 54.969052f,
11320 58.619293f, 60.929241f, 63.239189f, 58.464199f, 53.689209f, 46.273925f, 38.858642f,
11321 47.398674f, 55.938706f, 54.609104f, 53.279502f,
11322 }
11323 },
11324 { icIlluminantA,
11325 { 9.7951f, 10.8996f, 12.0853f, 13.3543f, 14.7080f, 16.1480f, 17.6753f, 19.2907f,
11326 20.9950f, 22.7883f, 24.6709f, 26.6425f, 28.7027f, 30.8508f, 33.0859f, 35.4068f,
11327 37.8121f, 40.3002f, 42.8693f, 45.5174f, 48.2423f, 51.0418f, 53.9132f, 56.8539f,
11328 59.8611f, 62.9320f, 66.0635f, 69.2525f, 72.4959f, 75.7903f, 79.1326f, 82.5193f,
11329 85.9470f, 89.4124f, 92.9120f, 96.4423f, 100.0000f, 103.5820f, 107.1840f, 110.8030f,
11330 114.4360f, 118.0800f, 121.7310f, 125.3860f, 129.0430f, 132.6970f, 136.3460f, 139.9880f,
11331 143.6180f, 147.2350f, 150.8360f, 154.4180f, 157.9790f, 161.5160f, 165.0280f, 168.5100f,
11332 171.9630f, 175.3830f, 178.7690f, 182.1180f, 185.4290f, 188.7010f, 191.9310f, 195.1180f,
11333 198.2610f, 201.3590f, 204.4090f, 207.4110f, 210.3650f, 213.2680f, 216.1200f, 218.9200f,
11334 221.6670f, 224.3610f, 227.0000f, 229.5850f, 232.1150f, 234.5890f, 237.0080f, 239.3700f,
11335 241.6750f, }
11336 },
11337};
@ icIlluminantA
@ icIlluminantD65
@ icIlluminantD93
@ icIlluminantD50

Referenced by CIccTagSpectralViewingConditions::getIlluminant().

◆ icKnownObservers

icObserverDef icKnownObservers[]
static

Definition at line 11425 of file IccTagBasic.cpp.

11425 {
11427 { 0.001368f, 0.002236f, 0.004243f, 0.007650f, 0.014310f, 0.023190f, 0.043510f,
11428 0.077630f, 0.134380f, 0.214770f, 0.283900f, 0.328500f, 0.348280f, 0.348060f,
11429 0.336200f, 0.318700f, 0.290800f, 0.251100f, 0.195360f, 0.142100f, 0.095640f,
11430 0.057950f, 0.032010f, 0.014700f, 0.004900f, 0.002400f, 0.009300f, 0.029100f,
11431 0.063270f, 0.109600f, 0.165500f, 0.225750f, 0.290400f, 0.359700f, 0.433450f,
11432 0.512050f, 0.594500f, 0.678400f, 0.762100f, 0.842500f, 0.916300f, 0.978600f,
11433 1.026300f, 1.056700f, 1.062200f, 1.045600f, 1.002600f, 0.938400f, 0.854450f,
11434 0.751400f, 0.642400f, 0.541900f, 0.447900f, 0.360800f, 0.283500f, 0.218700f,
11435 0.164900f, 0.121200f, 0.087400f, 0.063600f, 0.046770f, 0.032900f, 0.022700f,
11436 0.015840f, 0.011359f, 0.008111f, 0.005790f, 0.004109f, 0.002899f, 0.002049f,
11437 0.001440f, 0.001000f, 0.000690f, 0.000476f, 0.000332f, 0.000235f, 0.000166f,
11438 0.000117f, 0.000083f, 0.000059f, 0.000042f,
11439 0.000039f, 0.000064f, 0.000120f, 0.000217f, 0.000396f, 0.000640f, 0.001210f,
11440 0.002180f, 0.004000f, 0.007300f, 0.011600f, 0.016840f, 0.023000f, 0.029800f,
11441 0.038000f, 0.048000f, 0.060000f, 0.073900f, 0.090980f, 0.112600f, 0.139020f,
11442 0.169300f, 0.208020f, 0.258600f, 0.323000f, 0.407300f, 0.503000f, 0.608200f,
11443 0.710000f, 0.793200f, 0.862000f, 0.914850f, 0.954000f, 0.980300f, 0.994950f,
11444 1.000000f, 0.995000f, 0.978600f, 0.952000f, 0.915400f, 0.870000f, 0.816300f,
11445 0.757000f, 0.694900f, 0.631000f, 0.566800f, 0.503000f, 0.441200f, 0.381000f,
11446 0.321000f, 0.265000f, 0.217000f, 0.175000f, 0.138200f, 0.107000f, 0.081600f,
11447 0.061000f, 0.044580f, 0.032000f, 0.023200f, 0.017000f, 0.011920f, 0.008210f,
11448 0.005723f, 0.004102f, 0.002929f, 0.002091f, 0.001484f, 0.001047f, 0.000740f,
11449 0.000520f, 0.000361f, 0.000249f, 0.000172f, 0.000120f, 0.000085f, 0.000060f,
11450 0.000042f, 0.000030f, 0.000021f, 0.000015f,
11451 0.006450f, 0.010550f, 0.020050f, 0.036210f, 0.067850f, 0.110200f, 0.207400f,
11452 0.371300f, 0.645600f, 1.039050f, 1.385600f, 1.622960f, 1.747060f, 1.782600f,
11453 1.772110f, 1.744100f, 1.669200f, 1.528100f, 1.287640f, 1.041900f, 0.812950f,
11454 0.616200f, 0.465180f, 0.353300f, 0.272000f, 0.212300f, 0.158200f, 0.111700f,
11455 0.078250f, 0.057250f, 0.042160f, 0.029840f, 0.020300f, 0.013400f, 0.008750f,
11456 0.005750f, 0.003900f, 0.002750f, 0.002100f, 0.001800f, 0.001650f, 0.001400f,
11457 0.001100f, 0.001000f, 0.000800f, 0.000600f, 0.000340f, 0.000240f, 0.000190f,
11458 0.000100f, 0.000050f, 0.000030f, 0.000020f, 0.000010f, 0.000000f, 0.000000f,
11459 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11460 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11461 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11462 0.000000f, 0.000000f, 0.000000f, 0.000000f }
11463 },
11465 { 0.000160f, 0.000662f, 0.002362f, 0.007242f, 0.019110f, 0.043400f, 0.084736f,
11466 0.140638f, 0.204492f, 0.264737f, 0.314679f, 0.357719f, 0.383734f, 0.386726f,
11467 0.370702f, 0.342957f, 0.302273f, 0.254085f, 0.195618f, 0.132349f, 0.080507f,
11468 0.041072f, 0.016172f, 0.005132f, 0.003816f, 0.015444f, 0.037465f, 0.071358f,
11469 0.117749f, 0.172953f, 0.236491f, 0.304213f, 0.376772f, 0.451584f, 0.529826f,
11470 0.616053f, 0.705224f, 0.793832f, 0.878655f, 0.951162f, 1.014160f, 1.074300f,
11471 1.118520f, 1.134300f, 1.123990f, 1.089100f, 1.030480f, 0.950740f, 0.856297f,
11472 0.754930f, 0.647467f, 0.535110f, 0.431567f, 0.343690f, 0.268329f, 0.204300f,
11473 0.152568f, 0.112210f, 0.081261f, 0.057930f, 0.040851f, 0.028623f, 0.019941f,
11474 0.013842f, 0.009577f, 0.006605f, 0.004553f, 0.003145f, 0.002175f, 0.001506f,
11475 0.001045f, 0.000727f, 0.000508f, 0.000356f, 0.000251f, 0.000178f, 0.000126f,
11476 0.000090f, 0.000065f, 0.000046f, 0.000033f,
11477 0.000017f, 0.000072f, 0.000253f, 0.000769f, 0.002004f, 0.004509f, 0.008756f,
11478 0.014456f, 0.021391f, 0.029497f, 0.038676f, 0.049602f, 0.062077f, 0.074704f,
11479 0.089456f, 0.106256f, 0.128201f, 0.152761f, 0.185190f, 0.219940f, 0.253589f,
11480 0.297665f, 0.339133f, 0.395379f, 0.460777f, 0.531360f, 0.606741f, 0.685660f,
11481 0.761757f, 0.823330f, 0.875211f, 0.923810f, 0.961988f, 0.982200f, 0.991761f,
11482 0.999110f, 0.997340f, 0.982380f, 0.955552f, 0.915175f, 0.868934f, 0.825623f,
11483 0.777405f, 0.720353f, 0.658341f, 0.593878f, 0.527963f, 0.461834f, 0.398057f,
11484 0.339554f, 0.283493f, 0.228254f, 0.179828f, 0.140211f, 0.107633f, 0.081187f,
11485 0.060281f, 0.044096f, 0.031800f, 0.022602f, 0.015905f, 0.011130f, 0.007749f,
11486 0.005375f, 0.003718f, 0.002565f, 0.001768f, 0.001222f, 0.000846f, 0.000586f,
11487 0.000407f, 0.000284f, 0.000199f, 0.000140f, 0.000098f, 0.000070f, 0.000050f,
11488 0.000036f, 0.000025f, 0.000018f, 0.000013f,
11489 0.000705f, 0.002928f, 0.010482f, 0.032344f, 0.086011f, 0.197120f, 0.389366f,
11490 0.656760f, 0.972542f, 1.282500f, 1.553480f, 1.798500f, 1.967280f, 2.027300f,
11491 1.994800f, 1.900700f, 1.745370f, 1.554900f, 1.317560f, 1.030200f, 0.772125f,
11492 0.570060f, 0.415254f, 0.302356f, 0.218502f, 0.159249f, 0.112044f, 0.082248f,
11493 0.060709f, 0.043050f, 0.030451f, 0.020584f, 0.013676f, 0.007918f, 0.003988f,
11494 0.001091f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11495 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11496 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11497 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11498 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11499 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
11500 0.000000f, 0.000000f, 0.000000f, 0.000000f, }
11501 },
11502};
@ icStdObs1964TenDegrees
@ icStdObs1931TwoDegrees

Referenced by CIccTagSpectralViewingConditions::getObserver().

◆ interp

const char* interp

Definition at line 4235 of file IccTagBasic.cpp.