334{
335 int nArg = 1;
336 long int verbosity = 100;
337
338 if (argc <= 2) {
339 printf("Usage: iccFromCube cube_file output_icc_file\n");
341
342 return -1;
343 }
344
346
347 if (!cube.parseHeader()) {
348 printf("Unable to parse '%s'\n", argv[1]);
349 return -2;
350 }
351
352 if (!cube.sizeLut3D()) {
353 printf("3DLUT not found in '%s'\n", argv[1]);
354 return -3;
355 }
356
358
359
360 profile.InitHeader();
365
366
368 if (cube.isCustomInputRange()) {
373
377
379
381 if (minVal[1] != minVal[0] || maxVal[1] != maxVal[0]) {
383
387 }
388
390
392
393 if (minVal[2] != minVal[0] || maxVal[2] != maxVal[0]) {
394 if (minVal[2] == minVal[1] && maxVal[2] == maxVal[1])
395 pCurve2 = pCurve1;
396 else {
398
402 }
403 }
404
406
408 }
409
412 pCLUT->
Init(cube.sizeLut3D());
414
417
419
420 cube.close();
421
422 if (!bSuccess) {
423 printf("Unable to parse LUT from '%s'\n", argv[1]);
424 return (-4);
425 }
426
427
429 std::string desc = cube.getDescription();
430 if (desc.size()) {
431 pTextTag->
SetText(desc.c_str());
432 }
433 else {
434 pTextTag->
SetText((std::string(
"Device link created from ") + argv[1]).c_str());
435 }
437
438
439
440 if (cube.getCopyright().size()) {
442 pTextTag->
SetText(cube.getCopyright().c_str());
444 }
445
447 printf("'%s' successfully created\n", argv[2]);
448 }
449 else {
450 printf("Unable to save profile '%s'\n", argv[2]);
451 return -5;
452 }
453
454 return 0;
455}
@ icSigLinkClass
Definition icProfileHeader.h:955
@ icSigRgbData
Definition icProfileHeader.h:851
#define icVersionNumberV5
Definition icProfileHeader.h:193
@ icSigAToB0Tag
Definition icProfileHeader.h:342
@ icSigProfileDescriptionTag
Definition icProfileHeader.h:452
@ icSigCopyrightTag
Definition icProfileHeader.h:392
#define ICCPROFLIBVER
Definition IccProfLibVer.h:2
class ICCPROFLIB_API CIccProfile
Definition IccPcc.h:80
bool SaveIccProfile(const icChar *szFilename, CIccProfile *pIcc, icProfileIDSaveMethod nWriteId)
Definition IccProfile.cpp:3681
float icFloatNumber
Definition IccDefs.h:101
Definition IccMpeBasic.h:287
virtual icFloatNumber * GetSamples()
Definition IccMpeBasic.h:309
virtual bool SetSize(icUInt32Number nSize, bool bZeroAlloc=true)
Definition IccMpeBasic.cpp:1488
Definition IccMpeBasic.h:425
bool SetCurve(int nIndex, icCurveSetCurvePtr newCurve)
Definition IccMpeBasic.cpp:3168
Definition IccMpeBasic.h:656
void SetCLUT(CIccCLUT *pCLUT)
Definition IccMpeBasic.cpp:5480
Definition IccTagBasic.h:1229
void SetText(const icChar *szText, icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
Definition IccTagBasic.cpp:7719
Definition IccTagLut.h:326
icUInt32Number NumPoints() const
Definition IccTagLut.h:348
icFloatNumber * GetData(int index)
Definition IccTagLut.h:347
bool Init(icUInt8Number nGridPoints, icUInt32Number nMaxSize=0, icUInt8Number nBytesPerPoint=4)
Definition IccTagLut.cpp:1806
Definition IccTagMPE.h:358
virtual void Attach(CIccMultiProcessElement *pElement)
Definition IccTagMPE.cpp:922
Definition iccFromCube.cpp:82