diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-02-01 16:05:58 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-02-01 16:05:58 +0200 |
| commit | 9c6d695fa74565077ce2f1df8af49f7906110359 (patch) | |
| tree | 898d832ce8ab1336d0b1db1d4947aba9663df54a /Software/Visual_Studio | |
| parent | 7fafc961ad556028ece677606830ac76105f139e (diff) | |
| parent | a6279ca51345ed7ce1ef3bdad8b426ae37cd7c0f (diff) | |
| download | Tango-9c6d695fa74565077ce2f1df8af49f7906110359.tar.gz Tango-9c6d695fa74565077ce2f1df8af49f7906110359.zip | |
Merged "Fast Process Parameters" to Light Links Branch.
Diffstat (limited to 'Software/Visual_Studio')
30 files changed, 3970 insertions, 204 deletions
diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp index 912b8b7aa..572d37dac 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp @@ -28,6 +28,10 @@ #include "GradientInputStop.pb-c.h" #include "GradientOutputStop.pb-c.h" #include "LiquidVolume.pb-c.h" +#include "RecommendedProcessTableInput.pb-c.h" +#include "RecommendedProcessTableOutput.pb-c.h" +#include "OutOfGamutInput.pb-c.h" +#include "OutOfGamutOutput.pb-c.h" #define _CRTDBG_MAP_ALLOC #include <stdlib.h> @@ -62,17 +66,23 @@ #define LightInksThr 5 -Tango::ColorLib::ColorConverter::ColorConverter() : - m_CalibCurves(NULL), m_Conv02(NULL), -m_maxNlPerCM(NULL), -m_nInks(0), m_nVolumes(0), - m_GradStops(NULL), m_nGradStops(0), m_colortable(NULL), m_ProcessRangesMaxP(NULL), - m_ProcessRangesMinP(NULL), m_nProcessRanges(0), m_NormGamutRegionMaxLim(NULL), +Tango::ColorLib::ColorConverter::ColorConverter() : + m_CalibCurves(NULL), m_Conv02(NULL), + m_maxNlPerCM(NULL), + m_nInks(0), m_nVolumes(0), + m_GradStops(NULL), m_nGradStops(0), m_colortable(NULL), m_ProcessRangesMaxP(NULL), + m_ProcessRangesMinP(NULL), m_nProcessRanges(0), m_NormGamutRegionMaxLim(NULL), m_LowVolThr_nlcm(NULL), m_LowVolThrHalf_nlcm(NULL), m_hasLightInks(false), m_InkNames(NULL) { m_whitepointLab.Set(-1, -1, -1); m_whitepointXYZ_Strip.Set(-1, -1, -1); m_WP.Set(-1, -1, -1); +#ifdef MEMORY_TEST + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG); + //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); + //_CrtSetBreakAlloc(7984); + +#endif // MEMORY_TEST } Tango::ColorLib::ColorConverter::~ColorConverter() @@ -87,15 +97,15 @@ Tango::ColorLib::ColorConverter::~ColorConverter() delete[] m_CalibCurves; m_CalibCurves = NULL; } - if(m_GradStops != NULL) + if (m_GradStops != NULL) { - delete [] m_GradStops; + delete[] m_GradStops; m_GradStops = NULL; } if (m_colortable != NULL) { delete m_colortable; - m_colortable = NULL; + m_colortable = NULL; } if (m_NormGamutRegionMaxLim != NULL) { @@ -117,7 +127,7 @@ Tango::ColorLib::ColorConverter::~ColorConverter() delete[]m_LowVolThr_nlcm; m_LowVolThr_nlcm = NULL; } - + if (m_LowVolThrHalf_nlcm != NULL) { delete[]m_LowVolThrHalf_nlcm; @@ -128,7 +138,7 @@ Tango::ColorLib::ColorConverter::~ColorConverter() delete[] m_InkNames; m_InkNames = NULL; } - + /* if (m_ProcessRangesMinP != NULL) { delete[] m_ProcessRangesMinP; @@ -144,7 +154,9 @@ Tango::ColorLib::ColorConverter::~ColorConverter() delete[] m_ProcessRangesMinInkUptake; m_ProcessRangesMinInkUptake = NULL; }*/ - //_CrtDumpMemoryLeaks(); +#ifdef MEMORY_TEST + _CrtDumpMemoryLeaks(); +#endif // MEMORY_TEST } void Tango::ColorLib::ColorConverter::ProcessHiveNeighbors(ConversionInput *conversionInput, VectorXd Lab, @@ -249,10 +261,10 @@ void Tango::ColorLib::ColorConverter::ProcessHiveNeighbors(ConversionInput *conv LimitLab(LabInFinal1); } */ -// ColConv.ChangeWP(Lab1P, Lab1P, m_WP, m_whitepointXYZ_CT); //to Relative + // ColConv.ChangeWP(Lab1P, Lab1P, m_WP, m_whitepointXYZ_CT); //to Relative ColConv.ChangeWP(Lab1P, Lab1P, m_WP, m_whitepointXYZ_Strip); //to Relative m_colortable->m_B2ATransform->evalLab2InkP(Lab1P, InkOut, GamutRegion[iHive]); //InkOut is in units of 16 bits - for (int iInk = 0; iInk <m_nInks; ++iInk) + for (int iInk = 0; iInk < m_nInks; ++iInk) { InkOut[iInk] *= m_colortable->GetNormFactor(); if (InkOut[iInk] <= m_NormGamutRegionMaxLim[0]) @@ -300,11 +312,11 @@ void Tango::ColorLib::ColorConverter::ProcessHiveNeighbors(ConversionInput *conv //m_Conv02->LabtoRGB(Lab1P, tmpRGB); for (int j = 0; j < 3; ++j) RGBTmpVec(iHive, j) = std::min(std::max(tmpRGB[j], 0.0), 255.0); - + for (int j = 0; j < m_TotalNumberofInks; ++j) VolumeHive(iHive, j) = VolumeLI(j); } - + VectorXd VolumeLI_s(m_TotalNumberofInks); if (m_hasLightInks) { @@ -316,13 +328,13 @@ void Tango::ColorLib::ColorConverter::ProcessHiveNeighbors(ConversionInput *conv VolumeLI_s(iVol) = Volume(iVol); } for (j = 0; j < m_TotalNumberofInks; ++j) - VolumeHive(nHive , j) = VolumeLI_s(j); + VolumeHive(nHive, j) = VolumeLI_s(j); for (j = 0; j < 3; ++j) { - RGBTmpVec(nHive , j) = RGB(j); - LabHive(nHive , j) = Lab(j); + RGBTmpVec(nHive, j) = RGB(j); + LabHive(nHive, j) = Lab(j); } - GamutRegion[nHive ] = InGamutRegion; + GamutRegion[nHive] = InGamutRegion; //Organize hive into 5x5 matrix //Hive Vector follows the ordering 0-(0,0) 1-(0,1) 2-(0,2),...., @@ -527,13 +539,40 @@ void Tango::ColorLib::ColorConverter::fillLab(OutputCoordinates *outputCoords, V outputCoords->has_b = true; outputCoords->b = LabOut(2); } + void Tango::ColorLib::ColorConverter::readColorTransformations(ConversionInput* conversionInput) { SetStripWhitepoint(conversionInput->threadl, conversionInput->threada, conversionInput->threadb); bool has_forwarddata = conversionInput->has_forwarddata; uint8_t *data = conversionInput->forwarddata.data; int nprocessranges = conversionInput->n_processranges; - if(nprocessranges <=0) + if (nprocessranges <= 0) + throw std::exception("number of process ranges is zero or less"); + + m_colortable->InitColorTables(has_forwarddata, data, nprocessranges); + SetNumberofInks(m_colortable->GetnA2BnSepOut()); +} + +void Tango::ColorLib::ColorConverter::readColorTransformations(OutOfGamutInput* Input) +{ + SetStripWhitepoint(Input->threadl, Input->threada, Input->threadb); + bool has_forwarddata = Input->has_forwarddata; + uint8_t *data = Input->forwarddata.data; + int nprocessranges = Input->n_processranges; + if (nprocessranges <= 0) + throw std::exception("number of process ranges is zero or less"); + + m_colortable->InitColorTables(has_forwarddata, data, nprocessranges); + SetNumberofInks(m_colortable->GetnA2BnSepOut()); +} + +void Tango::ColorLib::ColorConverter::readColorTransformations(RecommendedProcessTableInput* conversionInput) +{ + SetStripWhitepoint(conversionInput->threadl, conversionInput->threada, conversionInput->threadb); + bool has_forwarddata = conversionInput->has_forwarddata; + uint8_t *data = conversionInput->forwarddata.data; + int nprocessranges = conversionInput->n_processranges; + if (nprocessranges <= 0) throw std::exception("number of process ranges is zero or less"); m_colortable->InitColorTables(has_forwarddata, data, nprocessranges); @@ -543,7 +582,7 @@ void Tango::ColorLib::ColorConverter::readColorTransformations(ConversionInput* void Tango::ColorLib::ColorConverter::SetStripWhitepoint(double threadl, double threada, double threadb) { //Read thread white. Thread White is given in CIELab Space - if((threadl<=0 || threadl>100) || (threada<-127 || threada>128) || (threadb < -127 || threadb>128)) + if ((threadl <= 0 || threadl > 100) || (threada < -127 || threada>128) || (threadb < -127 || threadb>128)) throw std::exception("White Point Lab exceeds limits"); else m_whitepointLab.Set(threadl, threada, threadb); @@ -584,8 +623,8 @@ void Tango::ColorLib::ColorConverter::readCalibrationTables(InputLiquid **inputl return; } } - - if(m_CalibCurves == NULL) + + if (m_CalibCurves == NULL) m_CalibCurves = new CalibData[m_nInks]; //m_CalibCurves = DBG_NEW CalibData[m_nInks]; for (int i = 0; i < m_nInks; ++i) @@ -593,26 +632,26 @@ void Tango::ColorLib::ColorConverter::readCalibrationTables(InputLiquid **inputl InputLiquid* InkType = inputliquid[i]; m_CalibCurves[i].SetCalibName((int)(InkType->calibrationdata->liquidtype)); - + m_CalibCurves[i].SetMaxNlPerCM(inputliquid[i]->maxnanoliterpercentimeter); switch (InkType->calibrationdata->liquidtype) { - case LIQUID_TYPE__Cyan: - case LIQUID_TYPE__Magenta: - case LIQUID_TYPE__Yellow: - case LIQUID_TYPE__Black: - { - // calibration data. - CalibrationData* calibrationData = InkType->calibrationdata; - SetCalibData(calibrationData, i, &m_CalibCurves[i]); - m_CalibCurves[i].InitInterpolations(); - break; - } - default: - { - throw std::exception("could not fill all calibration tables"); - return; - } + case LIQUID_TYPE__Cyan: + case LIQUID_TYPE__Magenta: + case LIQUID_TYPE__Yellow: + case LIQUID_TYPE__Black: + { + // calibration data. + CalibrationData* calibrationData = InkType->calibrationdata; + SetCalibData(calibrationData, i, &m_CalibCurves[i]); + m_CalibCurves[i].InitInterpolations(); + break; + } + default: + { + throw std::exception("could not fill all calibration tables"); + return; + } } } return; @@ -621,7 +660,7 @@ void Tango::ColorLib::ColorConverter::readCalibrationTables(InputLiquid **inputl void Tango::ColorLib::ColorConverter::SetCalibData(CalibrationData *calibrationData, int i, CalibData *tmpCurve) { - if (calibrationData->n_calibrationpoints <2) + if (calibrationData->n_calibrationpoints < 2) { char msg[100]; strcpy_s(msg, 100, "Not enough Calibration points in table "); @@ -677,7 +716,7 @@ bool Tango::ColorLib::ColorConverter::CheckMonotonicity(CalibrationData *calibda yval[i] = calibdata->calibrationpoints[i]->y; } - diffy= yval[calibdata->n_calibrationpoints - 1] - yval[0]; + diffy = yval[calibdata->n_calibrationpoints - 1] - yval[0]; diffx = xval[calibdata->n_calibrationpoints - 1] - xval[0]; int CFx = 1; if (diffx < 0) @@ -703,10 +742,14 @@ bool Tango::ColorLib::ColorConverter::CheckMonotonicity(CalibrationData *calibda return(retvalue); } } + delete[] xval; + xval = NULL; + delete[] yval; + yval = NULL; return retvalue; } -void Tango::ColorLib::ColorConverter:: ConvertLabColorToLinearInks(InputCoordinates* inputcoordinates, +void Tango::ColorLib::ColorConverter::ConvertLabColorToLinearInks(InputCoordinates* inputcoordinates, VectorXd &InkOut, VectorXd &RGBOut, VectorXd &LabOut, int &GamutRegion, bool &InGamut, SURROUND sur, CAM02CS CS) { @@ -774,12 +817,12 @@ if (m_AdaptWP) //Reverse the conversion process to bring back Lab to STRIP white point // CConvertD65.ChangeWP(LabOutFinal, LabOutFinal, m_whitepointXYZ_CT, m_WP); CConvertD65.ChangeWP(LabOutFinal, LabOutFinal, m_whitepointXYZ_Strip, m_WP); -/* - if (m_AdaptWP) - { - CConvertD65.ChangeWP(LabOutFinal, LabOutFinal, m_whitepointXYZ_Strip, m_whitepointXYZ_CT); - } - */ + /* + if (m_AdaptWP) + { + CConvertD65.ChangeWP(LabOutFinal, LabOutFinal, m_whitepointXYZ_Strip, m_whitepointXYZ_CT); + } + */ LabOut = DoubleToVector(LabOutFinal, 3); CConvertD65.SetReferenceWhite(D65); //Convert to RGB @@ -829,7 +872,7 @@ if (m_AdaptWP) } -void Tango::ColorLib::ColorConverter::ConvertRGBColorToLinearInks(InputCoordinates* inputcoordinates, +void Tango::ColorLib::ColorConverter::ConvertRGBColorToLinearInks(InputCoordinates* inputcoordinates, VectorXd &InkOut, VectorXd &RGBOut, VectorXd &LabOut, int &GamutRegion, bool &InGamut, SURROUND sur, CAM02CS CS) { @@ -862,7 +905,7 @@ void Tango::ColorLib::ColorConverter::ConvertRGBColorToLinearInks(InputCoordinat double *LabOnGamut = new double[3]; InGamut = IsInGamut(LabIn, sur, CS, LabOnGamut); LimitLab(LabOnGamut); - + //convert to inks double *InkOutP = new double[m_nInks]; @@ -920,7 +963,7 @@ void Tango::ColorLib::ColorConverter::ConvertRGBColorToLinearInks(InputCoordinat delete[] LabIn; LabIn = NULL; } - + if (RGBOutP1 != NULL) { delete[] RGBOutP1; @@ -931,11 +974,11 @@ void Tango::ColorLib::ColorConverter::ConvertRGBColorToLinearInks(InputCoordinat delete[] LabInFinal; LabInFinal = NULL; } - } +} void Tango::ColorLib::ColorConverter::ConvertCMYKColorToLinearInks(InputCoordinates* inputcoordinates, - VectorXd &InkOut, VectorXd &RGBOut, - VectorXd &LabOut, int &GamutRegion, bool &InGamut, SURROUND sur, CAM02CS CS) + VectorXd &InkOut, VectorXd &RGBOut, + VectorXd &LabOut, int &GamutRegion, bool &InGamut, SURROUND sur, CAM02CS CS) { //no conversion //missing from structure light inks or special colors @@ -1026,7 +1069,7 @@ void Tango::ColorLib::ColorConverter::ConvertCMYKColorToLinearInks(InputCoordina LabOutFinal2 = NULL; } } -void Tango::ColorLib::ColorConverter::ConvertColorToLinearInks(InputCoordinates* inputcoordinates, ColorSpace colorspace, +void Tango::ColorLib::ColorConverter::ConvertColorToLinearInks(InputCoordinates* inputcoordinates, ColorSpace colorspace, VectorXd &InkOut, VectorXd &RGBOut, VectorXd &LabOut, int &GamutRegion, bool &InGamut) { @@ -1054,7 +1097,7 @@ void Tango::ColorLib::ColorConverter::ConvertColorToLinearInks(InputCoordinates* { ConvertCMYKColorToLinearInks(inputcoordinates, InkOut, RGBOut, LabOut, GamutRegion, InGamut, sur, CS); - + break; } case(COLOR_SPACE__Catalog): @@ -1087,7 +1130,7 @@ void Tango::ColorLib::ColorConverter::ConvertToNLInks(VectorXd InkIn, VectorXd { for (int i = 0; i < m_nInks; ++i) { - if (InkIn(i) <= m_NormGamutRegionMaxLim[0]) + if (InkIn(i) <= m_NormGamutRegionMaxLim[0]) m_CalibCurves[i].m_InvLinearInterp->Eval(InkIn(i), InkOut(i)); else InkOut(i) = InkIn(i); @@ -1135,7 +1178,7 @@ void Tango::ColorLib::ColorConverter::VolumeToNLInkP(VectorXd Volume, VectorXd & } for (int i = 0; i < m_nInks; ++i) { - InkP(i) = VolumeNoLI(i)* m_maxNlPerCM(i)/100; //Volume is in %, InkP is in [nl/cm] + InkP(i) = VolumeNoLI(i)* m_maxNlPerCM(i) / 100; //Volume is in %, InkP is in [nl/cm] if (InkMax < InkP(i)) { InkMax = InkP(i); @@ -1143,7 +1186,7 @@ void Tango::ColorLib::ColorConverter::VolumeToNLInkP(VectorXd Volume, VectorXd & } InkSum += InkP(i); } - NLInkP(MaxInd) =100* InkSum/ m_maxNlPerCM(MaxInd); //Back to % + NLInkP(MaxInd) = 100 * InkSum / m_maxNlPerCM(MaxInd); //Back to % if (InkSum == 0.0) { for (int i = 0; i < m_nVolumes; ++i) @@ -1186,7 +1229,7 @@ void Tango::ColorLib::ColorConverter::VolumeToNLInkP(VectorXd Volume, VectorXd & if (i != MaxInd) { ind += 1; - NLInkP(i) =100* Result(ind)/m_maxNlPerCM(i); //Back to % + NLInkP(i) = 100 * Result(ind) / m_maxNlPerCM(i); //Back to % } } return; @@ -1309,7 +1352,7 @@ void Tango::ColorLib::ColorConverter::ConvertVolumeToRGBDisplay(InputCoordinates for (int i = 4; i < m_TotalNumberofInks; ++i) { if ((Volume(i) > 0) & (Volume(i - 4) == 0)) - { + { VolumeNoLI(i - 4) = inputcoordinates->inputliquids[i]->volume / DilutionFactor; } } @@ -1327,7 +1370,7 @@ void Tango::ColorLib::ColorConverter::ConvertVolumeToRGBDisplay(InputCoordinates //for (int i = 0; i < m_nA2BnSepIn; ++i) // InkOutP[i] = NLInkP(i); double *LinInkP = new double[m_nInks]; -//Reflect the Calibration Curves of the thread in Catalog Items + //Reflect the Calibration Curves of the thread in Catalog Items if (colorspace == COLOR_SPACE__Catalog) { for (int i = 0; i < m_nInks; ++i) @@ -1358,15 +1401,15 @@ void Tango::ColorLib::ColorConverter::ConvertVolumeToRGBDisplay(InputCoordinates LimitInks(NLInkP, InkOutP); NLInkPToVolume(DoubleToVector(InkOutP, m_nInks), VolumeNoLI); GamutRegion = GetGamutRegion(VolumeNoLI, m_ProcessRangesMaxP); -// LimitLowVolume(Volume, GamutRegion, Volume); + // LimitLowVolume(Volume, GamutRegion, Volume); NLcmtoPercentage(VolumeNoLI, VolumeNoLI); -// LimitNLInks2Volume(NLInkP, GamutRegion, Volume); + // LimitNLInks2Volume(NLInkP, GamutRegion, Volume); VolumeToNLInkP(VolumeNoLI, NLInkP); VectorToDouble(NLInkP, InkOutP); //Convert to RGB //GamutRegion = 0; //Convert to Lab - + double *LabOutP = new double[3]; //double *InkOutP = DBG_NEW double[m_nA2BnSepIn]; //double *LabOutP = DBG_NEW double[m_nA2BnSepOut]; @@ -1479,7 +1522,8 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i m_TotalNumberofInks = numofInks; original_input_liquids_count = conversionInput->inputcoordinates->n_inputliquids; original_input_liquids = conversionInput->inputcoordinates->inputliquids; - m_InkNames = new LiquidType[m_TotalNumberofInks]; + if(m_InkNames == NULL) + m_InkNames = new LiquidType[m_TotalNumberofInks]; InputLiquid** filteredInputLiquids = (InputLiquid**)malloc(sizeof(InputLiquid*) * m_TotalNumberofInks); for (size_t i = 0; i < conversionInput->inputcoordinates->n_inputliquids; i++) @@ -1520,11 +1564,11 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i } conversionInput->inputcoordinates->inputliquids = filteredInputLiquids; - if(expected_liquids<=0) + if (expected_liquids <= 0) throw std::exception("expected_liquids is zero"); else conversionInput->inputcoordinates->n_inputliquids = expected_liquids; - + //Filter and arrange colors //Initialize Output... @@ -1538,21 +1582,21 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i m_WP.Set(0.9505, 1.00, 1.0888); //D65 - if(m_colortable ==NULL) + if (m_colortable == NULL) m_colortable = new ColorTable(); readColorTransformations(conversionInput); - if(conversionInput->n_processranges<=0) + if (conversionInput->n_processranges <= 0) throw std::exception("number of process ranges is zero"); else m_nProcessRanges = conversionInput->n_processranges; - if(m_NormGamutRegionMaxLim == NULL) + if (m_NormGamutRegionMaxLim == NULL) m_NormGamutRegionMaxLim = new double[m_nProcessRanges]; double *tmpVal = m_colortable->GetNormGamutRegionMaxLim(); for (int i = 0; i < m_nProcessRanges; ++i) m_NormGamutRegionMaxLim[i] = tmpVal[i]; //read calibration tables and store them in m_CalibCurves InputLiquid **inputliquids = conversionInput->inputcoordinates->inputliquids; - // int n_inputliquids = conversionInput->inputcoordinates->n_inputliquids; + // int n_inputliquids = conversionInput->inputcoordinates->n_inputliquids; int n_inputliquids = numofInks - numLightInks; readCalibrationTables(inputliquids, n_inputliquids); @@ -1560,31 +1604,31 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i Illum IL = D65; SURROUND sur = average; CAM02CS CS = UCS; - if(m_Conv02 ==NULL) + if (m_Conv02 == NULL) m_Conv02 = new ColorConvert(IL, IL, Y_b, L_A, sur, CS); //m_Conv02 = DBG_NEW ColorConvert(IL, IL, Y_b, L_A, sur, CS); - + // Compare Strip White point to Color Table White Point //CompareWhitePoints(); - if (n_inputliquids != m_nInks) + if (n_inputliquids != m_nInks) throw std::exception("Number of available inks does not match ink tables\0"); //Tables have been filled //Set Process Ranges for (int i = 0; i < m_nProcessRanges; ++i) { - if(conversionInput->processranges[i]->maxinkuptake<=0) + if (conversionInput->processranges[i]->maxinkuptake <= 0) throw std::exception("Process Range is zero\0"); } double diff = 0; for (int i = 1; i < m_nProcessRanges; ++i) { diff = conversionInput->processranges[i]->maxinkuptake - conversionInput->processranges[i - 1]->maxinkuptake; - if(diff<0) + if (diff < 0) throw std::exception("Process Ranges are not monotonic\0"); } - if(m_ProcessRangesMaxP == NULL) + if (m_ProcessRangesMaxP == NULL) m_ProcessRangesMaxP = new double[m_nProcessRanges]; for (int i = 0; i < m_nProcessRanges; ++i) { @@ -1596,9 +1640,9 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i { m_ProcessRangesMinP[i] = conversionInput->processranges[i]->mininkuptake; } - + SetLowVolThr_nlcm(); - + VectorXd InkOut(m_nInks); VectorXd RGBOut(3); VectorXd LabOut(3); @@ -1623,18 +1667,18 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i } else { - ConvertColorToLinearInks(conversionInput->inputcoordinates, conversionInput->colorspace, InkOut, RGBOut, + ConvertColorToLinearInks(conversionInput->inputcoordinates, conversionInput->colorspace, InkOut, RGBOut, LabOut, GamutRegion, InGamut); //Inks are in Linear Space , convert to nonlinear by using Calibration Tables, // Right now calibration is in the [0-100] range, values exceeding [0-100] are not transformed ConvertToNLInks(InkOut, NLInkOut); - - LimitNLInks2Volume(NLInkOut, GamutRegion, Volume); + + LimitNLInks2Volume(NLInkOut, GamutRegion, Volume); } //Split Volume into inks and Light Inks VectorXd VolumeLI(m_TotalNumberofInks); if (m_hasLightInks) - { + { SplitVolume(Volume, VolumeLI, GamutRegion); } else @@ -1908,11 +1952,199 @@ void Tango::ColorLib::ColorConverter::CountNumberofInks(GradientConversionInput* return; } +void Tango::ColorLib::ColorConverter::CountNumberofInks(OutOfGamutInput* conversionInput, int &numInks, int &numLightInks) +{ + int nLiquids = conversionInput->inputcoordinates->n_inputliquids; + // int numberofInks = 0; + //Cyan + int nCyan = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputcoordinates->inputliquids[i]->liquidtype == LIQUID_TYPE__Cyan) + nCyan++; + } + if (nCyan > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nMagenta = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputcoordinates->inputliquids[i]->liquidtype == LIQUID_TYPE__Magenta) + nMagenta++; + } + if (nMagenta > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nYellow = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputcoordinates->inputliquids[i]->liquidtype == LIQUID_TYPE__Yellow) + nYellow++; + } + if (nYellow > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nBlack = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputcoordinates->inputliquids[i]->liquidtype == LIQUID_TYPE__Black) + nBlack++; + } + if (nBlack > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nLightCyan = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputcoordinates->inputliquids[i]->liquidtype == LIQUID_TYPE__LightCyan) + nLightCyan++; + } + if (nLightCyan > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nLightMagenta = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputcoordinates->inputliquids[i]->liquidtype == LIQUID_TYPE__LightMagenta) + nLightMagenta++; + } + if (nLightMagenta > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nLightYellow = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputcoordinates->inputliquids[i]->liquidtype == LIQUID_TYPE__LightYellow) + nLightYellow++; + } + if (nLightYellow > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + numInks = nCyan + nMagenta + nYellow + nBlack + nLightCyan + nLightMagenta + nLightYellow; + numLightInks = nLightCyan + nLightMagenta + nLightYellow;; + return; +} + +void Tango::ColorLib::ColorConverter::CountNumberofInks(RecommendedProcessTableInput* conversionInput, int &numInks, int &numLightInks) +{ + int nLiquids = conversionInput->n_inputliquids; + // int numberofInks = 0; + //Cyan + int nCyan = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputliquids[i]->liquidtype == LIQUID_TYPE__Cyan) + nCyan++; + } + if (nCyan > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nMagenta = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputliquids[i]->liquidtype == LIQUID_TYPE__Magenta) + nMagenta++; + } + if (nMagenta > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nYellow = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputliquids[i]->liquidtype == LIQUID_TYPE__Yellow) + nYellow++; + } + if (nYellow > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nBlack = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputliquids[i]->liquidtype == LIQUID_TYPE__Black) + nBlack++; + } + if (nBlack > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nLightCyan = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputliquids[i]->liquidtype == LIQUID_TYPE__LightCyan) + nLightCyan++; + } + if (nLightCyan > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nLightMagenta = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputliquids[i]->liquidtype == LIQUID_TYPE__LightMagenta) + nLightMagenta++; + } + if (nLightMagenta > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + int nLightYellow = 0; + for (int i = 0; i < nLiquids; ++i) + { + if (conversionInput->inputliquids[i]->liquidtype == LIQUID_TYPE__LightYellow) + nLightYellow++; + } + if (nLightYellow > 1) + { + numInks = -1; + numLightInks = -1; + return; + } + numInks = nCyan + nMagenta + nYellow + nBlack + nLightCyan + nLightMagenta + nLightYellow; + numLightInks = nLightCyan + nLightMagenta + nLightYellow;; + return; +} + void Tango::ColorLib::ColorConverter::CountNumberofInks(ConversionInput* conversionInput, int &numInks, int &numLightInks) { int nLiquids = conversionInput->inputcoordinates->n_inputliquids; -// int numberofInks = 0; - //Cyan + // int numberofInks = 0; + //Cyan int nCyan = 0; for (int i = 0; i < nLiquids; ++i) { @@ -1923,7 +2155,7 @@ void Tango::ColorLib::ColorConverter::CountNumberofInks(ConversionInput* convers { numInks = -1; numLightInks = -1; - return; + return; } int nMagenta = 0; for (int i = 0; i < nLiquids; ++i) @@ -1935,7 +2167,7 @@ void Tango::ColorLib::ColorConverter::CountNumberofInks(ConversionInput* convers { numInks = -1; numLightInks = -1; - return; + return; } int nYellow = 0; for (int i = 0; i < nLiquids; ++i) @@ -1947,7 +2179,7 @@ void Tango::ColorLib::ColorConverter::CountNumberofInks(ConversionInput* convers { numInks = -1; numLightInks = -1; - return; + return; } int nBlack = 0; for (int i = 0; i < nLiquids; ++i) @@ -1971,7 +2203,7 @@ void Tango::ColorLib::ColorConverter::CountNumberofInks(ConversionInput* convers { numInks = -1; numLightInks = -1; - return; + return; } int nLightMagenta = 0; for (int i = 0; i < nLiquids; ++i) @@ -1983,7 +2215,7 @@ void Tango::ColorLib::ColorConverter::CountNumberofInks(ConversionInput* convers { numInks = -1; numLightInks = -1; - return; + return; } int nLightYellow = 0; for (int i = 0; i < nLiquids; ++i) @@ -1995,7 +2227,7 @@ void Tango::ColorLib::ColorConverter::CountNumberofInks(ConversionInput* convers { numInks = -1; numLightInks = -1; - return; + return; } numInks = nCyan + nMagenta + nYellow + nBlack + nLightCyan + nLightMagenta + nLightYellow; numLightInks = nLightCyan + nLightMagenta + nLightYellow;; @@ -2328,6 +2560,9 @@ size_t Tango::ColorLib::ColorConverter::P_IsInGamut(uint8_t * input_buffer, size //count number if inks int numofInks = 0; int numLightInks = 0; + if (m_colortable == NULL) + m_colortable = new ColorTable(); + CountNumberofInks(conversionInput, numofInks, numLightInks); readColorTransformations(conversionInput); @@ -2335,14 +2570,14 @@ size_t Tango::ColorLib::ColorConverter::P_IsInGamut(uint8_t * input_buffer, size int n_inputliquids = numofInks - numLightInks; InputLiquid **inputliquid = conversionInput->inputcoordinates->inputliquids; //Read CMYK Calibration Tables only. Light Inks have no calibration tables - + readCalibrationTables(inputliquid, n_inputliquids); //Initialize CIECAM02 transformation Illum IL = D65; SURROUND sur = average; CAM02CS CS = UCS; - if(m_Conv02 == NULL) + if (m_Conv02 == NULL) m_Conv02 = new ColorConvert(IL, IL, Y_b, L_A, sur, CS); //m_Conv02 = DBG_NEW ColorConvert(IL, IL, Y_b, L_A, sur, CS); @@ -2422,7 +2657,7 @@ size_t Tango::ColorLib::ColorConverter::P_IsInGamut(uint8_t * input_buffer, size /* if (m_AdaptWP) { - CConvertD65.ChangeWP(LabInFinal1, LabInFinal1, m_whitepointXYZ_CT, m_whitepointXYZ_Strip); //to Color Tables + CConvertD65.ChangeWP(LabInFinal1, LabInFinal1, m_whitepointXYZ_CT, m_whitepointXYZ_Strip); //to Color Tables } */ double *LabInFinal2 = new double[3]; @@ -2437,11 +2672,11 @@ size_t Tango::ColorLib::ColorConverter::P_IsInGamut(uint8_t * input_buffer, size delete[] LabIn; LabIn = NULL; } - /* if (LabInFinal1 != NULL) - { - delete[]LabInFinal1; - LabInFinal1 = NULL; - } */ + /* if (LabInFinal1 != NULL) + { + delete[]LabInFinal1; + LabInFinal1 = NULL; + } */ if (LabInFinal2 != NULL) { delete[]LabInFinal2; @@ -2526,7 +2761,7 @@ size_t Tango::ColorLib::ColorConverter::GenerateGradient(uint8_t * input_buffer, if (m_colortable == NULL) m_colortable = new ColorTable(); PrepareGradient(conversionInput, conversionOutput); - + //Pack output... output_buffer = (uint8_t*)malloc(gradient_conversion_output__get_packed_size(conversionOutput)); int size = gradient_conversion_output__pack(conversionOutput, output_buffer); @@ -2579,13 +2814,13 @@ void Tango::ColorLib::ColorConverter::fillGradientStops(GradientConversionInput { C_RGB_XYZ_Lab RGB; C_RGB_XYZ_Lab Lab; - for (int i = 0; i < m_nGradStops; ++i) + for (int i = 0; i < m_nGradStops; ++i) { switch (conversionInput->stops[i]->colorspace) { case COLOR_SPACE__RGB: //Case RGB RGB = C_RGB_XYZ_Lab(conversionInput->stops[i]->red, conversionInput->stops[i]->green, conversionInput->stops[i]->blue); - m_GradStops[i].Set_RGB(RGB); + m_GradStops[i].Set_RGB(RGB); m_GradStops[i].Set_ColorSpace(COLOR_SPACE__RGB); m_GradStops[i].Set_Offset(conversionInput->stops[i]->offset); break; @@ -2605,7 +2840,7 @@ void Tango::ColorLib::ColorConverter::fillGradientStops(GradientConversionInput switch (liquidVolume->liquidtype) { case LIQUID_TYPE__Cyan: - m_GradStops[i].SetVolumeValue(liquidVolume->volume,0); + m_GradStops[i].SetVolumeValue(liquidVolume->volume, 0); break; case LIQUID_TYPE__Magenta: m_GradStops[i].SetVolumeValue(liquidVolume->volume, 1); @@ -2623,7 +2858,7 @@ void Tango::ColorLib::ColorConverter::fillGradientStops(GradientConversionInput break; } } -} +} void Tango::ColorLib::ColorConverter::findStops(Gradient &GradStop1, Gradient &GradStop2, double dEThr, int ninterstops, @@ -2639,9 +2874,9 @@ void Tango::ColorLib::ColorConverter::findStops(Gradient &GradStop1, Gradient &G C_RGB_XYZ_Lab LabStart = GradStop1.Get_Lab(); C_RGB_XYZ_Lab LabEnd = GradStop2.Get_Lab(); int nsubdiv = 101; - C_RGB_XYZ_Lab dRGB((RGBEnd.Get_x() - RGBStart.Get_x()) / (nsubdiv-1), (RGBEnd.Get_y() - RGBStart.Get_y()) / (nsubdiv-1), - (RGBEnd.Get_z() - RGBStart.Get_z()) / (nsubdiv-1)); - C_RGB_XYZ_Lab dLab((LabEnd.Get_x() - LabStart.Get_x()) / (nsubdiv - 1), (LabEnd.Get_y() -LabStart.Get_y()) / (nsubdiv - 1), + C_RGB_XYZ_Lab dRGB((RGBEnd.Get_x() - RGBStart.Get_x()) / (nsubdiv - 1), (RGBEnd.Get_y() - RGBStart.Get_y()) / (nsubdiv - 1), + (RGBEnd.Get_z() - RGBStart.Get_z()) / (nsubdiv - 1)); + C_RGB_XYZ_Lab dLab((LabEnd.Get_x() - LabStart.Get_x()) / (nsubdiv - 1), (LabEnd.Get_y() - LabStart.Get_y()) / (nsubdiv - 1), (LabEnd.Get_z() - LabStart.Get_z()) / (nsubdiv - 1)); C_RGB_XYZ_Lab *VecLabOut_tmp = new C_RGB_XYZ_Lab[ninterstops]; @@ -2739,7 +2974,7 @@ void Tango::ColorLib::ColorConverter::findStops(Gradient &GradStop1, Gradient &G pos[indGrad] = 0; double dE = 0.0; double dEOld = 0.0; - while ((i1 < nsubdiv) & (indGrad< ninterstops-1)) + while ((i1 < nsubdiv) & (indGrad < ninterstops - 1)) { dEOld = dE; CConvertD65.dEcmc(VecLabOut_fin[indGrad], VecLabOut_tmp[i1], dE); @@ -2763,19 +2998,19 @@ void Tango::ColorLib::ColorConverter::findStops(Gradient &GradStop1, Gradient &G else { dEOld = dE; - while (dE >= dEThr && i1 <nsubdiv) + while (dE >= dEThr && i1 < nsubdiv) { //get intermediate point - RGBTmp.Set( (VecRGBOut_tmp[i1].Get_x() + VecRGBOut_fin[indGrad].Get_x())/2.0, + RGBTmp.Set((VecRGBOut_tmp[i1].Get_x() + VecRGBOut_fin[indGrad].Get_x()) / 2.0, (VecRGBOut_tmp[i1].Get_y() + VecRGBOut_fin[indGrad].Get_y()) / 2.0, (VecRGBOut_tmp[i1].Get_z() + VecRGBOut_fin[indGrad].Get_z()) / 2.0); LabTmp = CConvertD65.RGBtoLab(RGBTmp); LabTmp.Clamp(LowLab, HighLab); //move vectors down by one - for (int i = nsubdiv-1; i >=i1; --i) + for (int i = nsubdiv - 1; i >= i1; --i) { - VecRGBOut_tmp[i + 1] = VecRGBOut_tmp[i ]; - VecLabOut_tmp[i + 1] = VecLabOut_tmp[i ]; + VecRGBOut_tmp[i + 1] = VecRGBOut_tmp[i]; + VecLabOut_tmp[i + 1] = VecLabOut_tmp[i]; } VecRGBOut_tmp[i1] = RGBTmp; VecLabOut_tmp[i1] = LabTmp; @@ -2789,8 +3024,8 @@ void Tango::ColorLib::ColorConverter::findStops(Gradient &GradStop1, Gradient &G i1 = j1 + 1; } } - if(indGrad<ninterstops) - nOut = indGrad +1; + if (indGrad < ninterstops) + nOut = indGrad + 1; else { throw std::exception("Number of subdivisions exceed allocation"); @@ -2819,7 +3054,7 @@ void Tango::ColorLib::ColorConverter::findStops(Gradient &GradStop1, Gradient &G delete[] pos; pos = NULL; } - } + } for (int i = 0; i < nOut; ++i) { @@ -2832,10 +3067,10 @@ void Tango::ColorLib::ColorConverter::findStops(Gradient &GradStop1, Gradient &G posOut[i] = pos[i]; } //free allocs - if(VecLabOut_tmp != NULL) - { - delete[] VecLabOut_tmp; - VecLabOut_tmp = NULL; + if (VecLabOut_tmp != NULL) + { + delete[] VecLabOut_tmp; + VecLabOut_tmp = NULL; } if (VecRGBOut_tmp != NULL) { @@ -2859,7 +3094,7 @@ void Tango::ColorLib::ColorConverter::findStops(Gradient &GradStop1, Gradient &G } } -void Tango::ColorLib::ColorConverter::ConvertGradStoptoVolume(InputCoordinates* inputcoordinates, ColorSpace colorspace, +void Tango::ColorLib::ColorConverter::ConvertGradStoptoVolume(InputCoordinates* inputcoordinates, ColorSpace colorspace, VectorXd &Volume, int &GamutRegion, bool same_regions) { size_t nInks = 0; @@ -2869,8 +3104,8 @@ void Tango::ColorLib::ColorConverter::ConvertGradStoptoVolume(InputCoordinates* double normFactor = 1; if (!same_regions) normFactor = m_colortable->GetNormFactor(); - - if (colorspace ==COLOR_SPACE__RGB) + + if (colorspace == COLOR_SPACE__RGB) { //Convert RGB to Volume, no need to calculate RGBOut and LabOut // Basic assumption: if data is given in RGB space, conversion should be in relative colorimetric, @@ -2891,7 +3126,7 @@ void Tango::ColorLib::ColorConverter::ConvertGradStoptoVolume(InputCoordinates* //convert to inks int GamutRegion; double *InkOutP = new double[m_nInks]; - if(same_regions) + if (same_regions) m_colortable->m_B2ARTransform->evalLab2InkP(LabIn, InkOutP, GamutRegion); //InkOut is in units of 16 bits else m_colortable->m_B2ATransform->evalLab2InkP(LabIn, InkOutP, GamutRegion); //InkOut is in units of 16 bits @@ -2925,7 +3160,7 @@ void Tango::ColorLib::ColorConverter::ConvertGradStoptoVolume(InputCoordinates* RGBOutP = NULL; } } - else if(colorspace ==COLOR_SPACE__LAB) + else if (colorspace == COLOR_SPACE__LAB) { // Basic assumption: Lab data is in relative colorimetric. No Need to convert @@ -2937,7 +3172,7 @@ void Tango::ColorLib::ColorConverter::ConvertGradStoptoVolume(InputCoordinates* //convert to Inks int GamutRegion; double *InkOutP = new double[m_nInks]; - if(same_regions) + if (same_regions) m_colortable->m_B2ARTransform->evalLab2InkP(LabIn, InkOutP, GamutRegion); //InkOut is in the [0-100] interval else m_colortable->m_B2ATransform->evalLab2InkP(LabIn, InkOutP, GamutRegion); //InkOut is in the [0-100] interval @@ -2991,7 +3226,7 @@ void Tango::ColorLib::ColorConverter::PrepareGradient(GradientConversionInput* c m_hasLightInks = false; //Gradients do not use light inks m_TotalNumberofInks = numofInks - numLightInks; m_nVolumes = m_TotalNumberofInks; - if(m_GradStops == NULL) + if (m_GradStops == NULL) m_GradStops = new Gradient[m_nGradStops]; for (int i = 0; i < m_nGradStops; ++i) m_GradStops[i].SetVolumeSize(m_TotalNumberofInks); @@ -3002,7 +3237,7 @@ void Tango::ColorLib::ColorConverter::PrepareGradient(GradientConversionInput* c inputcoordinates[i] = (InputCoordinates*)malloc(sizeof(InputCoordinates)); input_coordinates__init(inputcoordinates[i]); } - + fillGradientStops(conversionInput); GradInput2InputCoords(conversionInput, inputcoordinates); @@ -3013,7 +3248,7 @@ void Tango::ColorLib::ColorConverter::PrepareGradient(GradientConversionInput* c m_nProcessRanges = conversionInput->n_processranges; m_colortable->InitColorTables(has_forwarddata, data, m_nProcessRanges); SetNumberofInks(m_colortable->GetnA2BnSepOut()); - if(m_NormGamutRegionMaxLim == NULL) + if (m_NormGamutRegionMaxLim == NULL) m_NormGamutRegionMaxLim = new double[m_nProcessRanges]; double *tmpVal = m_colortable->GetNormGamutRegionMaxLim(); for (int i = 0; i < m_nProcessRanges; ++i) @@ -3045,7 +3280,7 @@ void Tango::ColorLib::ColorConverter::PrepareGradient(GradientConversionInput* c CAM02CS CS = UCS; if (m_Conv02 == NULL) m_Conv02 = new ColorConvert(IL, IL, Y_b, L_A, sur, CS); - + // Compare Strip White point to Color Table White Point //CompareWhitePoints(); ColorConvert CConvertD65(D65, D65); //Destination, source @@ -3130,7 +3365,7 @@ void Tango::ColorLib::ColorConverter::PrepareGradient(GradientConversionInput* c int nPosStops = 0; double dOffset = 0; GradOffset OffsetType = EqSpaced; - + for (int iStop = 0; iStop < m_nGradStops - 1; ++iStop) { findStops(m_GradStops[iStop], m_GradStops[iStop + 1], dEThr, ninterstops, nOut, VecRGBOut, VecLabOut, posOut); @@ -3209,7 +3444,7 @@ void Tango::ColorLib::ColorConverter::PrepareGradient(GradientConversionInput* c //Simplify calculations, we only need the ink values, input values are in RGB color space // Use table according to Gamut Regions, all stops in region 0, use 100%table otherwise use regular table, decrease dyeing speed. - int nTotalStops = ncountStops+1; + int nTotalStops = ncountStops + 1; InputCoordinates **SubStops = (InputCoordinates**)malloc(sizeof(InputCoordinates*)*(nTotalStops)); //Calculate and store @@ -3224,7 +3459,7 @@ void Tango::ColorLib::ColorConverter::PrepareGradient(GradientConversionInput* c SubStops[iTStops]->green = (int)round(AllRGBOut_tmp[iTStops][1]); SubStops[iTStops]->blue = (int)round(AllRGBOut_tmp[iTStops][2]); } - + GradientOutputStop** outputStops = (GradientOutputStop**)malloc(sizeof(GradientOutputStop*) * nTotalStops); conversionOutput->stops = outputStops; conversionOutput->n_stops = nTotalStops; @@ -3273,9 +3508,9 @@ void Tango::ColorLib::ColorConverter::PrepareGradient(GradientConversionInput* c } for (int i = 0; i < nTotalStops; ++i) { - fprintf(stdout, "%d\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%d\t%d\t%d\n", i, + fprintf(stdout, "%d\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%6.3f\t%d\t%d\t%d\n", i, outputStops[i]->offset, outputStops[i]->outputliquids[0]->volume, - outputStops[i]->outputliquids[1]->volume, outputStops[i]->outputliquids[2]->volume, outputStops[i]->outputliquids[3]->volume, + outputStops[i]->outputliquids[1]->volume, outputStops[i]->outputliquids[2]->volume, outputStops[i]->outputliquids[3]->volume, SubStops[i]->l, SubStops[i]->a, SubStops[i]->b, SubStops[i]->red, SubStops[i]->green, SubStops[i]->blue); } //release memory @@ -3344,7 +3579,7 @@ void Tango::ColorLib::ColorConverter::fillStop(GradientOutputStop *&stop, Vecto stop->processparameterstableindex = GamutRegion; stop->has_offset = true; stop->offset = Position; -} +} void Tango::ColorLib::ColorConverter::GradInput2InputCoords(GradientConversionInput *conversionInput, InputCoordinates **inputcoordinates) { @@ -3376,13 +3611,13 @@ void Tango::ColorLib::ColorConverter::GradInput2InputCoords(GradientConversionI InputLiquidsIC[j] = (InputLiquid*)malloc(sizeof(InputLiquid)); input_liquid__init(InputLiquidsIC[j]); } - for (size_t j= 0; j< (size_t)m_TotalNumberofInks; j++) + for (size_t j = 0; j < (size_t)m_TotalNumberofInks; j++) { LiquidVolume* liquidVolume = conversionInput->stops[i]->liquidvolumes[j]; switch (liquidVolume->liquidtype) { case LIQUID_TYPE__Cyan: -// inputcoordinates[i]->inputliquids[0]->volume = liquidVolume->volume; + // inputcoordinates[i]->inputliquids[0]->volume = liquidVolume->volume; InputLiquidsIC[0]->volume = liquidVolume->volume; InputLiquidsIC[0]->liquidtype = LIQUID_TYPE__Cyan; break; @@ -3399,7 +3634,69 @@ void Tango::ColorLib::ColorConverter::GradInput2InputCoords(GradientConversionI InputLiquidsIC[3]->liquidtype = LIQUID_TYPE__Black; break; } - + + } + inputcoordinates[i]->inputliquids = InputLiquidsIC; + inputcoordinates[i]->n_inputliquids = m_TotalNumberofInks; + } + } +} + +void Tango::ColorLib::ColorConverter::RecommendedProcessTableInput2InputCoordinates + (RecommendedProcessTableInput *conversionInput, InputCoordinates **inputcoordinates) +{ + for (size_t i = 0; i < conversionInput->n_stops; i++) + { + switch (conversionInput->stops[i]->colorspace) + { + case COLOR_SPACE__RGB: //Case RGB + inputcoordinates[i]->red = conversionInput->stops[i]->red; + inputcoordinates[i]->green = conversionInput->stops[i]->green; + inputcoordinates[i]->blue = conversionInput->stops[i]->blue; + inputcoordinates[i]->has_red = true; + inputcoordinates[i]->has_green = true; + inputcoordinates[i]->has_blue = true; + break; + case COLOR_SPACE__LAB: //Case LAB + inputcoordinates[i]->l = conversionInput->stops[i]->l; + inputcoordinates[i]->a = conversionInput->stops[i]->a; + inputcoordinates[i]->b = conversionInput->stops[i]->b; + inputcoordinates[i]->has_l = true; + inputcoordinates[i]->has_a = true; + inputcoordinates[i]->has_b = true; + break; + case COLOR_SPACE__Volume: //Case Volume + //int size= (int)conversionInput->stops[i]->n_liquidvolumes; + InputLiquid** InputLiquidsIC = (InputLiquid**)malloc(sizeof(InputLiquid*) *m_TotalNumberofInks); + for (int j = 0; j < m_TotalNumberofInks; j++) + { + InputLiquidsIC[j] = (InputLiquid*)malloc(sizeof(InputLiquid)); + input_liquid__init(InputLiquidsIC[j]); + } + for (size_t j = 0; j < (size_t)m_TotalNumberofInks; j++) + { + LiquidVolume* liquidVolume = conversionInput->stops[i]->liquidvolumes[j]; + switch (liquidVolume->liquidtype) + { + case LIQUID_TYPE__Cyan: + // inputcoordinates[i]->inputliquids[0]->volume = liquidVolume->volume; + InputLiquidsIC[0]->volume = liquidVolume->volume; + InputLiquidsIC[0]->liquidtype = LIQUID_TYPE__Cyan; + break; + case LIQUID_TYPE__Magenta: + InputLiquidsIC[1]->volume = liquidVolume->volume; + InputLiquidsIC[1]->liquidtype = LIQUID_TYPE__Magenta; + break; + case LIQUID_TYPE__Yellow: + InputLiquidsIC[2]->volume = liquidVolume->volume; + InputLiquidsIC[2]->liquidtype = LIQUID_TYPE__Yellow; + break; + case LIQUID_TYPE__Black: + InputLiquidsIC[3]->volume = liquidVolume->volume; + InputLiquidsIC[3]->liquidtype = LIQUID_TYPE__Black; + break; + } + } inputcoordinates[i]->inputliquids = InputLiquidsIC; inputcoordinates[i]->n_inputliquids = m_TotalNumberofInks; @@ -3412,7 +3709,7 @@ void Tango::ColorLib::ColorConverter::LimitInks(VectorXd inInks, double *Bounded //convert Ink % to [nl/cm] //Bound Ink for (int i = 0; i < m_nInks; ++i) - BoundedInks[i] = std::min(inInks(i)*m_maxNlPerCM(i)/100.0, m_ProcessRangesMaxP[m_nProcessRanges - 1]); + BoundedInks[i] = std::min(inInks(i)*m_maxNlPerCM(i) / 100.0, m_ProcessRangesMaxP[m_nProcessRanges - 1]); } void Tango::ColorLib::ColorConverter::NLcmtoPercentage(VectorXd InVolume, VectorXd &OutVolume) @@ -3437,28 +3734,28 @@ void Tango::ColorLib::ColorConverter::LimitLowVolume(VectorXd InVolume, int &Gam double TotalVolume = 0.0; for (int i = 0; i < m_nInks; ++i) TotalVolume += InVolume(i); - + double low = 0.0; double high = 0.0; if (TotalVolume <= m_ProcessRangesMinP[0]) { //Calculate minVolumeThreshold based on m_ProcessRangesMinP[0] - high = LowVolumeThreshold * m_ProcessRangesMinP[0]/100.0; + high = LowVolumeThreshold * m_ProcessRangesMinP[0] / 100.0; } else if (TotalVolume <= m_ProcessRangesMaxP[0]) { //Calculate minVolumeThreshold based on Total Volume - high = LowVolumeThreshold * TotalVolume/100.0; + high = LowVolumeThreshold * TotalVolume / 100.0; } else if (TotalVolume <= m_ProcessRangesMinP[1]) { //Calculate minVolumeThreshold based on m_ProcessRangesMinP[1] - high = LightInksThr * m_ProcessRangesMinP[1]/100.0; + high = LightInksThr * m_ProcessRangesMinP[1] / 100.0; } else { - high = LightInksThr * TotalVolume/100.0; + high = LightInksThr * TotalVolume / 100.0; } //Limit Volume based on Total Ink Volume double sumVol = 0; @@ -3466,21 +3763,21 @@ void Tango::ColorLib::ColorConverter::LimitLowVolume(VectorXd InVolume, int &Gam { if (InVolume(i) >= high) OutVolume(i) = InVolume(i); - else if (InVolume(i) <(high/2.0)) + else if (InVolume(i) < (high / 2.0)) OutVolume(i) = 0.0; else - OutVolume(i) =high; + OutVolume(i) = high; sumVol += OutVolume(i); } //recalculate GamutRegion if (sumVol <= m_ProcessRangesMaxP[0]) GamutRegion = 0; else - { - for (int i = 1; i < indGR+1; ++i) - { - if((sumVol>m_ProcessRangesMaxP[i-1]) & (sumVol<= m_ProcessRangesMaxP[i ])) - GamutRegion = i; + { + for (int i = 1; i < indGR + 1; ++i) + { + if ((sumVol > m_ProcessRangesMaxP[i - 1]) & (sumVol <= m_ProcessRangesMaxP[i])) + GamutRegion = i; } } } @@ -3526,7 +3823,7 @@ int Tango::ColorLib::ColorConverter::GetGamutRegion(VectorXd Volume, double *Ga int nGR = m_colortable->GetnGamutRegions(); for (int i = 0; i < m_nInks; ++i) TotalVolume += Volume(i); - for (int i=0; i< nGR -1; ++i) + for (int i = 0; i < nGR - 1; ++i) { if (TotalVolume > GamutLimits[i]) GamutRegion++; @@ -3542,10 +3839,10 @@ void Tango::ColorLib::ColorConverter::SmoothCurveData(VectorXd VIn, VectorXd &VO //Smooth the data with repeated applications of a[1 1 1] filter for (int i = 0; i < NumIter; ++i) { - for (int j=0; j< Vlength; ++j) + for (int j = 0; j < Vlength; ++j) tmpV(j) = VIn(j); - for (int k=1; k< Vlength-1; ++k) - VIn(k) = (tmpV(k-1) + tmpV(k) + tmpV(k+1)) / 3; + for (int k = 1; k < Vlength - 1; ++k) + VIn(k) = (tmpV(k - 1) + tmpV(k) + tmpV(k + 1)) / 3; } for (int j = 0; j < Vlength; ++j) VOut(j) = VIn(j); @@ -3561,7 +3858,7 @@ void Tango::ColorLib::ColorConverter::ProcessGradientStops(InputCoordinates **in double * InkOutL = new double[m_nInks]; double * LabOutV = new double[3]; double * LabOutFinal = new double[3]; - + ColorConvert CConvertD65(D65, D65); bool InGamut = true; @@ -3571,7 +3868,7 @@ void Tango::ColorLib::ColorConverter::ProcessGradientStops(InputCoordinates **in if (m_GradStops[i].Get_ColorSpace() == COLOR_SPACE__Volume || m_GradStops[i].Get_ColorSpace() == COLOR_SPACE__Catalog) { //Convert volume to Lab //Convert lab to rgb - ConvertVolumeToRGBDisplay(inputcoordinates[i], m_nProcessRanges, m_GradStops[i].Get_ColorSpace(), Volume, + ConvertVolumeToRGBDisplay(inputcoordinates[i], m_nProcessRanges, m_GradStops[i].Get_ColorSpace(), Volume, RGBOut, LabOut, GamutRegion); VectorToDouble(LabOut, LabOutV); CConvertD65.ChangeWP(LabOutV, LabOutV, m_WP, m_whitepointXYZ_Strip); //to Relative Colorimetric Space @@ -3581,10 +3878,10 @@ void Tango::ColorLib::ColorConverter::ProcessGradientStops(InputCoordinates **in //store data m_GradStops[i].Set_Lab(Lab); m_GradStops[i].Set_RGB(RGB); - m_GradStops[i].Set_GamutRegion( GamutRegion); - bool retValue = CheckLabInRGBGamut(Lab); + m_GradStops[i].Set_GamutRegion(GamutRegion); + bool retValue = CheckLabInRGBGamut(Lab); m_GradStops[i].SetInRGBLimits(retValue); - m_GradStops[i].SetInGamut (true); + m_GradStops[i].SetInGamut(true); } else { @@ -3596,7 +3893,7 @@ void Tango::ColorLib::ColorConverter::ProcessGradientStops(InputCoordinates **in C_RGB_XYZ_Lab Lab(LabOutV[0], LabOutV[1], LabOutV[2]); C_RGB_XYZ_Lab RGB(RGBOut); ConvertToNLInks(InkOut, NLInkOut); - + LimitNLInks2Volume(NLInkOut, GamutRegion, Volume); //fill data //fill volume @@ -3642,7 +3939,7 @@ bool Tango::ColorLib::ColorConverter::CheckLabInRGBGamut(VectorXd Lab) return(retVal); } -bool Tango::ColorLib::ColorConverter::CheckLabInRGBGamut( C_RGB_XYZ_Lab Lab) +bool Tango::ColorLib::ColorConverter::CheckLabInRGBGamut(C_RGB_XYZ_Lab Lab) { bool retVal = false; //ColorConvert ColConv(D65, D65); @@ -3662,13 +3959,13 @@ void Tango::ColorLib::ColorConverter::SetLowVolThr_nlcm() { if (m_LowVolThr_nlcm == NULL) m_LowVolThr_nlcm = new double[m_nProcessRanges]; - if(m_LowVolThrHalf_nlcm == NULL) + if (m_LowVolThrHalf_nlcm == NULL) m_LowVolThrHalf_nlcm = new double[m_nProcessRanges]; //fill thresholds for (int i = 0; i < m_nProcessRanges; ++i) - { - m_LowVolThr_nlcm[i] = LowVolumeThreshold * m_ProcessRangesMaxP[i]/100; - m_LowVolThrHalf_nlcm[i] = LowVolHalf * m_ProcessRangesMaxP[i]/100; + { + m_LowVolThr_nlcm[i] = LowVolumeThreshold * m_ProcessRangesMaxP[i] / 100; + m_LowVolThrHalf_nlcm[i] = LowVolHalf * m_ProcessRangesMaxP[i] / 100; } } @@ -3698,8 +3995,8 @@ void Tango::ColorLib::ColorConverter::ConfineVolumes(VectorXd &Volume) TotalVolume += Volume(i)*m_maxNlPerCM(i) / 100.0; int nGR = m_colortable->GetnGamutRegions(); double diff = (TotalVolume - m_ProcessRangesMaxP[nGR - 1]); - - if (diff>1.e-03) + + if (diff > 1.e-03) { //find values above Min Volume threshold int *indInks = new int[m_nInks]; @@ -3714,12 +4011,12 @@ void Tango::ColorLib::ColorConverter::ConfineVolumes(VectorXd &Volume) } } double exceed_Vol_per_ink = (diff / ind); - for (int i = 0; i <m_nInks; ++i) + for (int i = 0; i < m_nInks; ++i) { - if(indInks[i]>=0) - Volume(indInks[i]) =Volume(indInks[i])- 100*(exceed_Vol_per_ink)/m_maxNlPerCM(indInks[i]); + if (indInks[i] >= 0) + Volume(indInks[i]) = Volume(indInks[i]) - 100 * (exceed_Vol_per_ink) / m_maxNlPerCM(indInks[i]); } - if(indInks != NULL) + if (indInks != NULL) { delete[] indInks; indInks = NULL; @@ -3729,9 +4026,9 @@ void Tango::ColorLib::ColorConverter::ConfineVolumes(VectorXd &Volume) void Tango::ColorLib::ColorConverter::LimitNLInks2VolumeThr(VectorXd NLInks, int &GamutRegion, VectorXd &Volume) { -// VectorXd NLInkOut(m_nInks); + // VectorXd NLInkOut(m_nInks); double *InkOutL = new double[m_nInks]; -// ConvertToNLInks(NLInks, NLInkOut); + // ConvertToNLInks(NLInks, NLInkOut); LimitInks(NLInks, InkOutL); // InkOutL in [nl/cm] NLInkPToVolume(DoubleToVector(InkOutL, m_nInks), Volume); // [nl/cm] GamutRegion = GetGamutRegion(Volume, m_ProcessRangesMaxP); @@ -3749,7 +4046,7 @@ void Tango::ColorLib::ColorConverter::GetClosestInk(VectorXd Volume, int &GamutR { VectorXd LabOut(3); NumConversions D2B; - double *diffVolume = new double[m_nInks]; + double *diffVolume = new double[m_nInks]; int *LVThrIndex = new int[m_nInks]; int indCount = -1; for (int i = 0; i < m_nInks; ++i) @@ -3783,14 +4080,14 @@ void Tango::ColorLib::ColorConverter::GetClosestInk(VectorXd Volume, int &GamutR for (int i = 0; i < pwr2LVThr; ++i) { VolumeComb[i] = new double[m_nInks]; - for (int j=0; j<m_nInks; ++j) - VolumeComb[ i][j] = Volume(j); + for (int j = 0; j < m_nInks; ++j) + VolumeComb[i][j] = Volume(j); } int **binPerm = new int*[pwr2LVThr]; for (int i = 0; i < pwr2LVThr; ++i) - { + { binPerm[i] = new int[indCount]; - for (int k = 0; k < indCount ; ++k) + for (int k = 0; k < indCount; ++k) binPerm[i][k] = -1; D2B.DecToBinary(i, binPerm[i], indCount); } @@ -3799,7 +4096,7 @@ void Tango::ColorLib::ColorConverter::GetClosestInk(VectorXd Volume, int &GamutR int indMindE = -1; for (int i = 0; i < pwr2LVThr; ++i) { - for (int j=0; j<indCount ; ++j) + for (int j = 0; j < indCount; ++j) VolumeComb[i][LVThrIndex[j]] = (double)(binPerm[i][j])* LowVolumeThreshold; } //find the volume with smallest dE from Target. @@ -3814,7 +4111,7 @@ void Tango::ColorLib::ColorConverter::GetClosestInk(VectorXd Volume, int &GamutR for (int i = istart; i < pwr2LVThr; ++i) { ConvertVolumeToLabRel(DoubleToVector(VolumeComb[i], m_nInks), LabOut, GamutRegion); - m_Conv02->SymmetricaldECMC(LabOut, DoubleToVector(LabTarget,3), dE[i]); + m_Conv02->SymmetricaldECMC(LabOut, DoubleToVector(LabTarget, 3), dE[i]); if (dE[i] < mindE) { mindE = dE[i]; @@ -3844,9 +4141,14 @@ void Tango::ColorLib::ColorConverter::GetClosestInk(VectorXd Volume, int &GamutR } else BestVolume = Volume; + if (LVThrIndex != NULL) + { + delete[] LVThrIndex; + LVThrIndex = NULL; + } } -void Tango::ColorLib::ColorConverter::ConvertVolumeToLabRel(VectorXd &Volume, VectorXd &LabOut, int GamutRegion) +void Tango::ColorLib::ColorConverter::ConvertVolumeToLabRel(VectorXd &Volume, VectorXd &LabOut, int GamutRegion) { VectorXd NLInkP(m_nInks); VectorXd InkOut((int)(m_nInks)); @@ -3871,7 +4173,7 @@ void Tango::ColorLib::ColorConverter::ConvertVolumeToLabRel(VectorXd &Volume, V //Convert to Lab double *LabOutP = new double[3]; - + for (int i = 0; i < m_nInks; ++i) InkOutP[i] *= m_colortable->GetInverseNormFactor(); @@ -3919,15 +4221,15 @@ void Tango::ColorLib::ColorConverter::ConvertVolumeToLabRel(VectorXd &Volume, V void Tango::ColorLib::ColorConverter::SplitVolume(VectorXd Volume, VectorXd &VolumeLI, int &GamutRegion) { -//mark split candidates + //mark split candidates int ind = 0; VectorXd Vol_nlcm(m_nInks); double InitTotalVolume = 0; double low = 0; double high = 0; - for (int i = 0; i < m_nInks ; ++i) - { - Vol_nlcm(i) = Volume(i)*m_maxNlPerCM(i)/100; + for (int i = 0; i < m_nInks; ++i) + { + Vol_nlcm(i) = Volume(i)*m_maxNlPerCM(i) / 100; VolumeLI(i) = Vol_nlcm(i); InitTotalVolume += Vol_nlcm(i); } @@ -3940,7 +4242,7 @@ void Tango::ColorLib::ColorConverter::SplitVolume(VectorXd Volume, VectorXd &Vol } //Set Limits DefineSplitLimits(low, high, InitTotalVolume); - + //Apply 1st Split for (int i = 0; i < m_nInks - 1; ++i) { @@ -3957,7 +4259,7 @@ void Tango::ColorLib::ColorConverter::SplitVolume(VectorXd Volume, VectorXd &Vol } double UpperLimit = m_ProcessRangesMaxP[m_nProcessRanges - 1]; double TotalVolume = 0.0; - + bool resplit = true; VectorXd PrevVolume(m_TotalNumberofInks); for (int i = 0; i < m_nInks; ++i) @@ -4018,15 +4320,15 @@ void Tango::ColorLib::ColorConverter::SplitVolume(VectorXd Volume, VectorXd &Vol NLcmtoPercentage(VolumeLI, VolumeLI); } -void Tango::ColorLib::ColorConverter::DefineSplitLimits(double &low, double &high, double InitTotalVolume ) +void Tango::ColorLib::ColorConverter::DefineSplitLimits(double &low, double &high, double InitTotalVolume) { -//Set Limits - //1st Region + //Set Limits + //1st Region double lim1 = 0; double lim2 = m_ProcessRangesMinP[0]; double lim3 = m_ProcessRangesMaxP[0]; int ProcessRangeInd = 0; -//Regions 1 to n-1 + //Regions 1 to n-1 for (int iReg = 0; iReg < m_nProcessRanges - 1; ++iReg) { ProcessRangeInd = iReg; @@ -4062,15 +4364,477 @@ void Tango::ColorLib::ColorConverter::DefineSplitLimits(double &low, double &hi } void Tango::ColorLib::ColorConverter::findGamutRegion(int &GamutRegion, double TotalVolume) -{ +{ if (TotalVolume <= m_ProcessRangesMaxP[0]) GamutRegion = 0; else { - for (int i = 1; i <m_nProcessRanges; ++i) + for (int i = 1; i < m_nProcessRanges; ++i) { if ((TotalVolume > m_ProcessRangesMaxP[i - 1]) & (TotalVolume <= m_ProcessRangesMaxP[i])) GamutRegion = i; } } } + +size_t Tango::ColorLib::ColorConverter::GetRecommendedProcessParameters(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer) +{ + RecommendedProcessTableInput* Input = recommended_process_table_input__unpack(NULL, input_buffer_size, input_buffer); + + try + { + //Filter and arrange colors (Should change from 3 to 4 if black ink is included) + int numofInks = 0; + int numLightInks = 0; + CountNumberofInks(Input, numofInks, numLightInks); + if (numofInks < 0) + throw std::exception("Duplicate inks"); + if (numLightInks > 0) + m_hasLightInks = true; + int expected_liquids = numofInks; + m_TotalNumberofInks = numofInks; + int original_input_liquids_count = Input->n_inputliquids; + InputLiquid** original_input_liquids = Input->inputliquids; + if(m_InkNames == NULL) + m_InkNames = new LiquidType[m_TotalNumberofInks]; + InputLiquid** filteredInputLiquids = new InputLiquid*[m_TotalNumberofInks]; + + for (size_t i = 0; i < Input->n_inputliquids; i++) + { + InputLiquid* liquid = Input->inputliquids[i]; + + switch (liquid->liquidtype) + { + case LIQUID_TYPE__Cyan: + filteredInputLiquids[0] = liquid; + m_InkNames[0] = liquid->liquidtype; + break; + case LIQUID_TYPE__Magenta: + filteredInputLiquids[1] = liquid; + m_InkNames[1] = liquid->liquidtype; + break; + case LIQUID_TYPE__Yellow: + filteredInputLiquids[2] = liquid; + m_InkNames[2] = liquid->liquidtype; + break; + case LIQUID_TYPE__Black: + filteredInputLiquids[3] = liquid; + m_InkNames[3] = liquid->liquidtype; + break; + case LIQUID_TYPE__LightCyan: + filteredInputLiquids[4] = liquid; + m_InkNames[4] = liquid->liquidtype; + break; + case LIQUID_TYPE__LightMagenta: + filteredInputLiquids[5] = liquid; + m_InkNames[5] = liquid->liquidtype; + break; + case LIQUID_TYPE__LightYellow: + filteredInputLiquids[6] = liquid; + m_InkNames[6] = liquid->liquidtype; + break; + } + } + + Input->inputliquids = filteredInputLiquids; + if (expected_liquids <= 0) + throw std::exception("expected_liquids is zero"); + else + Input->n_inputliquids = expected_liquids; + + //Filter and arrange colors + + size_t n_elements = 0; + bool InGamut = false; + m_WP.Set(0.9505, 1.00, 1.0888); //D65 + + + if (m_colortable == NULL) + m_colortable = new ColorTable(); + readColorTransformations(Input); + if (Input->n_processranges <= 0) + throw std::exception("number of process ranges is zero"); + else + m_nProcessRanges = Input->n_processranges; + if (m_NormGamutRegionMaxLim == NULL) + m_NormGamutRegionMaxLim = new double[m_nProcessRanges]; + double *tmpVal = m_colortable->GetNormGamutRegionMaxLim(); + for (int i = 0; i < m_nProcessRanges; ++i) + m_NormGamutRegionMaxLim[i] = tmpVal[i]; + //read calibration tables and store them in m_CalibCurves + InputLiquid **inputliquids = Input->inputliquids; + // int n_inputliquids = conversionInput->inputcoordinates->n_inputliquids; + int n_inputliquids = numofInks - numLightInks; + readCalibrationTables(inputliquids, n_inputliquids); + + //Initialize CIECAM02 transformation + Illum IL = D65; + SURROUND sur = average; + CAM02CS CS = UCS; + if (m_Conv02 == NULL) + m_Conv02 = new ColorConvert(IL, IL, Y_b, L_A, sur, CS); + + if (n_inputliquids != m_nInks) + throw std::exception("Number of available inks does not match ink tables\0"); + + //Set Process Ranges + for (int i = 0; i < m_nProcessRanges; ++i) + { + if (Input->processranges[i]->maxinkuptake <= 0) + throw std::exception("Process Range is zero\0"); + } + double diff = 0; + for (int i = 1; i < m_nProcessRanges; ++i) + { + diff = Input->processranges[i]->maxinkuptake - Input->processranges[i - 1]->maxinkuptake; + if (diff < 0) + throw std::exception("Process Ranges are not monotonic\0"); + } + if (m_ProcessRangesMaxP == NULL) + m_ProcessRangesMaxP = new double[m_nProcessRanges]; + for (int i = 0; i < m_nProcessRanges; ++i) + { + m_ProcessRangesMaxP[i] = Input->processranges[i]->maxinkuptake; + } + if (m_ProcessRangesMinP == NULL) + m_ProcessRangesMinP = new double[m_nProcessRanges]; + for (int i = 0; i < m_nProcessRanges; ++i) + { + m_ProcessRangesMinP[i] = Input->processranges[i]->mininkuptake; + } + + SetLowVolThr_nlcm(); + + VectorXd InkOut(m_nInks); + VectorXd RGBOut(3); + VectorXd LabOut(3); + VectorXd NLInkOut(m_nInks); + VectorXd Volume(m_nInks); + VectorXd VolumeLi(m_TotalNumberofInks); + VectorXd VolumeOut(m_nInks); + //set maxNlPerCM + VectorXd NlperCM(m_nInks); + NlperCM.setZero(); + m_maxNlPerCM = NlperCM; + for (int i = 0; i < m_nInks; ++i) + SetMaxNLperCM(Input->inputliquids[i]->maxnanoliterpercentimeter, i); + m_nVolumes = m_nInks; + + int nstops = Input->n_stops; + int *GamutRegion = new int[nstops]; + InputCoordinates **inputcoordinates = new InputCoordinates*[nstops]; + for (int i = 0; i < nstops; ++i) + { + inputcoordinates[i] = (InputCoordinates*)malloc(sizeof(InputCoordinates)); + input_coordinates__init(inputcoordinates[i]); + } + RecommendedProcessTableInput2InputCoordinates(Input, inputcoordinates); + + //Convert input data to linear inks + ColorSpace colorspace; + + int32_t processparameterstableindex = 0; + for (int istops = 0; istops < nstops; ++istops) + { + colorspace = Input->stops[istops]->colorspace; + if (Input->stops[istops]->colorspace == COLOR_SPACE__Volume || (Input->stops[istops]->colorspace == COLOR_SPACE__Catalog)) + { + + //Assumption: Input is given without light iks + for (int jV = 0; jV < m_nInks; ++jV) + Volume(jV) = inputcoordinates[istops]->inputliquids[jV]->volume; + + if (Input->uselightinks) + { //Convert to light inks + SplitVolume(Volume, VolumeLi, GamutRegion[istops]); + } + else + { + GamutRegion[istops] = GetGamutRegion(Volume, m_NormGamutRegionMaxLim); + } + } + else + { + colorspace = Input->stops[istops]->colorspace; + ConvertColorToLinearInks(inputcoordinates[istops], colorspace, InkOut, RGBOut, + LabOut, GamutRegion[istops], InGamut); + //Inks are in Linear Space , convert to nonlinear by using Calibration Tables, + // Right now calibration is in the [0-100] range, values exceeding [0-100] are not transformed + ConvertToNLInks(InkOut, NLInkOut); + LimitNLInks2Volume(NLInkOut, GamutRegion[istops], Volume); + if (Input->uselightinks) + { //Convert to light inks + SplitVolume(Volume, VolumeLi, GamutRegion[istops]); + } + } + if (istops == 0 || processparameterstableindex < GamutRegion[istops]) + { + processparameterstableindex = GamutRegion[istops]; + } + } + delete[] GamutRegion; + GamutRegion = NULL; + // all gamut regions were evaluated, pack data + + //Initialize Output... + RecommendedProcessTableOutput *Output = (RecommendedProcessTableOutput*)malloc(sizeof(RecommendedProcessTableOutput)); + recommended_process_table_output__init(Output); + Output->has_processparameterstableindex = true; + Output->processparameterstableindex = processparameterstableindex; + output_buffer = (uint8_t*)malloc(recommended_process_table_output__get_packed_size(Output)); + int size = recommended_process_table_output__pack(Output, output_buffer); + +#pragma region Free Conversion Input & Output + Input->inputliquids = original_input_liquids;; + Input->n_inputliquids = original_input_liquids_count; + for (int i=0; i<nstops; ++i) + input_coordinates__free_unpacked(inputcoordinates[i], NULL); + delete[] inputcoordinates; + inputcoordinates = NULL; + + delete[] filteredInputLiquids; + filteredInputLiquids = NULL; + + + recommended_process_table_input__free_unpacked(Input, NULL); + recommended_process_table_output__free_unpacked(Output, NULL); + +#pragma endregion + + return (size); + } + catch (const std::exception& e) + { + RecommendedProcessTableOutput *output = (RecommendedProcessTableOutput*)malloc(sizeof(RecommendedProcessTableOutput)); + recommended_process_table_output__init(output); + + output->has_haserror = true; + output->haserror = true; + + const char* what = e.what(); + int nWhat = strlen(what); + output->errormessage = (char*)malloc(nWhat); + for (int i = 0; i < nWhat; ++i) + output->errormessage[i] = what[i]; + + output_buffer = (uint8_t*)malloc(recommended_process_table_output__get_packed_size(output)); + int size = recommended_process_table_output__pack(output, output_buffer); + +#pragma region Free Conversion Input & Output + + recommended_process_table_input__free_unpacked(Input, NULL); + recommended_process_table_output__free_unpacked(output, NULL); + +#pragma endregion + + return (size); + } +} + +size_t Tango::ColorLib::ColorConverter::CheckOutOfGamut(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer) +{ + //Get Input + OutOfGamutInput* Input = out_of_gamut_input__unpack(NULL, input_buffer_size, input_buffer); + + try + { + InputLiquid** original_input_liquids = NULL; + int original_input_liquids_count = 0; + + //Filter and arrange colors (Should change from 3 to 4 if black ink is included) + int numofInks = 0; + int numLightInks = 0; + CountNumberofInks(Input, numofInks, numLightInks); + if (numofInks < 0) + throw std::exception("Duplicate inks"); + if (numLightInks > 0) + m_hasLightInks = true; + int expected_liquids = numofInks; + m_TotalNumberofInks = numofInks; + original_input_liquids_count = Input->inputcoordinates->n_inputliquids; + original_input_liquids = Input->inputcoordinates->inputliquids; + if(m_InkNames == NULL) + m_InkNames = new LiquidType[m_TotalNumberofInks]; + InputLiquid** filteredInputLiquids = new InputLiquid*[m_TotalNumberofInks]; + + for (size_t i = 0; i < original_input_liquids_count; i++) + { + InputLiquid* liquid = Input->inputcoordinates->inputliquids[i]; + + switch (liquid->liquidtype) + { + case LIQUID_TYPE__Cyan: + filteredInputLiquids[0] = liquid; + m_InkNames[0] = liquid->liquidtype; + break; + case LIQUID_TYPE__Magenta: + filteredInputLiquids[1] = liquid; + m_InkNames[1] = liquid->liquidtype; + break; + case LIQUID_TYPE__Yellow: + filteredInputLiquids[2] = liquid; + m_InkNames[2] = liquid->liquidtype; + break; + case LIQUID_TYPE__Black: + filteredInputLiquids[3] = liquid; + m_InkNames[3] = liquid->liquidtype; + break; + case LIQUID_TYPE__LightCyan: + filteredInputLiquids[4] = liquid; + m_InkNames[4] = liquid->liquidtype; + break; + case LIQUID_TYPE__LightMagenta: + filteredInputLiquids[5] = liquid; + m_InkNames[5] = liquid->liquidtype; + break; + case LIQUID_TYPE__LightYellow: + filteredInputLiquids[6] = liquid; + m_InkNames[6] = liquid->liquidtype; + break; + } + } + + Input->inputcoordinates->inputliquids = filteredInputLiquids; + if (expected_liquids <= 0) + throw std::exception("expected_liquids is zero"); + else + Input->inputcoordinates->n_inputliquids = expected_liquids; + + //Filter and arrange colors + size_t n_elements = 0; + bool InGamut = false; + m_WP.Set(0.9505, 1.00, 1.0888); //D65 + + + if (m_colortable == NULL) + m_colortable = new ColorTable(); + readColorTransformations(Input); + if (Input->n_processranges <= 0) + throw std::exception("number of process ranges is zero"); + else + m_nProcessRanges = Input->n_processranges; + if (m_NormGamutRegionMaxLim == NULL) + m_NormGamutRegionMaxLim = new double[m_nProcessRanges]; + double *tmpVal = m_colortable->GetNormGamutRegionMaxLim(); + for (int i = 0; i < m_nProcessRanges; ++i) + m_NormGamutRegionMaxLim[i] = tmpVal[i]; + //read calibration tables and store them in m_CalibCurves + InputLiquid **inputliquids = Input->inputcoordinates->inputliquids; + // int n_inputliquids = conversionInput->inputcoordinates->n_inputliquids; + int n_inputliquids = numofInks - numLightInks; + readCalibrationTables(inputliquids, n_inputliquids); + + //Initialize CIECAM02 transformation + Illum IL = D65; + SURROUND sur = average; + CAM02CS CS = UCS; + if (m_Conv02 == NULL) + m_Conv02 = new ColorConvert(IL, IL, Y_b, L_A, sur, CS); + + if (n_inputliquids != m_nInks) + throw std::exception("Number of available inks does not match ink tables\0"); + + //Tables have been filled + VectorXd RGBOut(3); + VectorXd LabOut(3); + ColorConvert CConvertD65(D65, D65); //Destination, source + //Convert input data to linear inks + if (Input->colorspace == COLOR_SPACE__Volume || Input->colorspace == COLOR_SPACE__Catalog) + { + InGamut = true; + } + else + { + double LabIn[3]; + switch (Input->colorspace) + { + case (COLOR_SPACE__RGB): + { + RGBOut(0) = Input->inputcoordinates->red; + RGBOut(1) = Input->inputcoordinates->green; + RGBOut(2) = Input->inputcoordinates->blue; + //convert to Lab + double RGBOutP[3]; + VectorToDouble(RGBOut, RGBOutP); + //RGB to Lab + CConvertD65.RGBtoLab(RGBOutP, LabIn); //Values are in Relative Colorimetric, D65 + LimitLab(LabIn); + //Is In Gamut? + double LabOnGamut[3]; + InGamut = IsInGamut(LabIn, sur, CS, LabOnGamut); + break; + } + case (COLOR_SPACE__LAB): + { + LabIn[0] = Input->inputcoordinates->l; //Absolute Colorimetric + LabIn[1] = Input->inputcoordinates->a; + LabIn[2] = Input->inputcoordinates->b; + //the assumption is that the color space has illumination that matches the whitepoint of the Strip + ColorConvert CConvertD65(D65, D65); //Destination, source + double LabInFinal2[3]; + double LabOnGamut[3]; + CConvertD65.ChangeWP(LabIn, LabInFinal2, m_WP, m_whitepointXYZ_Strip); //LabInFinal2 is in Relative Colorimetric Space + InGamut = IsInGamut(LabInFinal2, sur, CS, LabOnGamut); + break; + } + default: + { + throw std::exception(" Unsupported Color Space"); + break; + } + } + } + + //Initialize Output... + OutOfGamutOutput *Output = (OutOfGamutOutput*)malloc(sizeof(OutOfGamutOutput)); + out_of_gamut_output__init(Output); + Output->has_outofgamut = true; + Output->outofgamut = !(InGamut); + + output_buffer = (uint8_t*)malloc(out_of_gamut_output__get_packed_size(Output)); + int size = out_of_gamut_output__pack(Output, output_buffer); + +#pragma region Free Conversion Input & Output + + Input->inputcoordinates->inputliquids = original_input_liquids; + Input->inputcoordinates->n_inputliquids = original_input_liquids_count; + delete[] filteredInputLiquids; + filteredInputLiquids = NULL; + + out_of_gamut_input__free_unpacked(Input, NULL); + + out_of_gamut_output__free_unpacked(Output, NULL); + +#pragma endregion + + return (size); + } + catch (const std::exception& e) + { + //Notify Error... + OutOfGamutOutput *Output = (OutOfGamutOutput*)malloc(sizeof(OutOfGamutOutput)); + out_of_gamut_output__init(Output); + + Output->has_haserror = true; + Output->haserror = true; + + const char* what = e.what(); + int nWhat = strlen(what); + Output->errormessage = (char*)malloc(nWhat); + //conversionOutput->errormessage = new char[nWhat]; + for (int i = 0; i < nWhat; ++i) + Output->errormessage[i] = what[i]; + + output_buffer = (uint8_t*)malloc(out_of_gamut_output__get_packed_size(Output)); + int size = out_of_gamut_output__pack(Output, output_buffer); + +#pragma region Free Conversion Input & Output + + out_of_gamut_input__free_unpacked(Input, NULL); + out_of_gamut_output__free_unpacked(Output, NULL); + +#pragma endregion + + return (size); + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.h b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.h index 2ea0c34dd..9738e7cf3 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.h +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.h @@ -16,6 +16,10 @@ #include "GradientOutputStop.pb-c.h" #include "GradientConversionInput.pb-c.h" #include "GradientConversionOutput.pb-c.h" +#include "OutOfGamutInput.pb-c.h" +#include "OutOfGamutOutput.pb-c.h" +#include "RecommendedProcessTableInput.pb-c.h" +#include "RecommendedProcessTableOutput.pb-c.h" #include "Interp.h" #include "Curves.h" #include "Gradient.h" @@ -82,6 +86,8 @@ namespace Tango size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer); size_t Tango::ColorLib::ColorConverter::GenerateGradient(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer); + size_t Tango::ColorLib::ColorConverter::GetRecommendedProcessParameters(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer); + size_t Tango::ColorLib::ColorConverter::CheckOutOfGamut(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer); void ConvertToNLInks(VectorXd InkIn, VectorXd &InkOut); void ConvertToLinearInks(VectorXd InkIn, VectorXd &InkOut); void VolumeToNLInkP(VectorXd Volume, VectorXd &NLInkP); @@ -118,6 +124,8 @@ namespace Tango double *m_LowVolThr_nlcm; double *m_LowVolThrHalf_nlcm; void readColorTransformations(ConversionInput* conversionInput); + void readColorTransformations(OutOfGamutInput* Input); + void readColorTransformations(RecommendedProcessTableInput *Input); // void readColorTables(bool has_rddata, uint8_t *data, int nprocessranges); void readCalibrationTables(InputLiquid **inputliquids, int n_inputliquids); void SetCalibData(CalibrationData* calibrationData, int i, CalibData *tmpCurve); @@ -138,6 +146,8 @@ namespace Tango void FindTriplet(VectorXd Lab, MatrixXd Lab1, int nHive, int*indDataMax); void CountNumberofInks(ConversionInput* conversionInput, int &numInks, int &numLightInks); void CountNumberofInks(GradientConversionInput* conversionInput, int &numInks, int &numLightInks); + void CountNumberofInks(OutOfGamutInput* conversionInput, int &numInks, int &numLightInks); + void CountNumberofInks(RecommendedProcessTableInput* conversionInput, int &numInks, int &numLightInks); void SetStripWhitepoint(double threadl, double threada, double threadb); void VectorToDouble(VectorXd Vec, double *doub); // void VectorToDouble(VectorXd VecIn, std::vector<double> &doubOut); @@ -148,6 +158,7 @@ namespace Tango void read_lut_type(int offset, int data_size, ColorTransf *Transf, ConversionInput* conversionInput); void findStops(Gradient& m_GradStops1, Gradient& m_GradStops2, double dEThr, int ninterstops, int &nOut, double **VecRGBOut, double **VecLabOut, double *posOut); + void RecommendedProcessTableInput2InputCoordinates(RecommendedProcessTableInput *Input, InputCoordinates **inputcoordinates); void GradInput2InputCoords(GradientConversionInput *conversionInput, InputCoordinates **inputcoordinates); void ProcessGradientStops(InputCoordinates **inputcoordinates); void PrepareGradient(GradientConversionInput* conversionInput, GradientConversionOutput *conversionOutput); diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Exports.cpp b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Exports.cpp index 24e156640..b70acbda1 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Exports.cpp +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Exports.cpp @@ -53,3 +53,16 @@ extern "C" EXPORT_API size_t __cdecl GetLinearizationMeasurements(uint8_t* input return calibrator.GetLinearizationMeasurements(input_buffer, input_buffer_size, output_buffer); } +extern "C" EXPORT_API size_t __cdecl GetRecommendedProcessParameters(uint8_t* input_buffer, size_t input_buffer_size, uint8_t*& output_buffer) +{ + ColorConverter converter; + return converter.GetRecommendedProcessParameters(input_buffer, input_buffer_size, output_buffer); +} + +extern "C" EXPORT_API size_t __cdecl CheckOutOfGamut(uint8_t* input_buffer, size_t input_buffer_size, uint8_t*& output_buffer) +{ + ColorConverter converter; + return converter.CheckOutOfGamut(input_buffer, input_buffer_size, output_buffer); +} + + diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutInput.pb-c.c b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutInput.pb-c.c new file mode 100644 index 000000000..e51e63783 --- /dev/null +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutInput.pb-c.c @@ -0,0 +1,170 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: OutOfGamutInput.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "OutOfGamutInput.pb-c.h" +void out_of_gamut_input__init + (OutOfGamutInput *message) +{ + static const OutOfGamutInput init_value = OUT_OF_GAMUT_INPUT__INIT; + *message = init_value; +} +size_t out_of_gamut_input__get_packed_size + (const OutOfGamutInput *message) +{ + assert(message->base.descriptor == &out_of_gamut_input__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t out_of_gamut_input__pack + (const OutOfGamutInput *message, + uint8_t *out) +{ + assert(message->base.descriptor == &out_of_gamut_input__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t out_of_gamut_input__pack_to_buffer + (const OutOfGamutInput *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &out_of_gamut_input__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +OutOfGamutInput * + out_of_gamut_input__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (OutOfGamutInput *) + protobuf_c_message_unpack (&out_of_gamut_input__descriptor, + allocator, len, data); +} +void out_of_gamut_input__free_unpacked + (OutOfGamutInput *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &out_of_gamut_input__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor out_of_gamut_input__field_descriptors[7] = +{ + { + "ThreadL", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(OutOfGamutInput, has_threadl), + offsetof(OutOfGamutInput, threadl), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ThreadA", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(OutOfGamutInput, has_threada), + offsetof(OutOfGamutInput, threada), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ThreadB", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(OutOfGamutInput, has_threadb), + offsetof(OutOfGamutInput, threadb), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ColorSpace", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(OutOfGamutInput, has_colorspace), + offsetof(OutOfGamutInput, colorspace), + &color_space__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "InputCoordinates", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(OutOfGamutInput, inputcoordinates), + &input_coordinates__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ForwardData", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BYTES, + offsetof(OutOfGamutInput, has_forwarddata), + offsetof(OutOfGamutInput, forwarddata), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ProcessRanges", + 7, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(OutOfGamutInput, n_processranges), + offsetof(OutOfGamutInput, processranges), + &process_range__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned out_of_gamut_input__field_indices_by_name[] = { + 3, /* field[3] = ColorSpace */ + 5, /* field[5] = ForwardData */ + 4, /* field[4] = InputCoordinates */ + 6, /* field[6] = ProcessRanges */ + 1, /* field[1] = ThreadA */ + 2, /* field[2] = ThreadB */ + 0, /* field[0] = ThreadL */ +}; +static const ProtobufCIntRange out_of_gamut_input__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor out_of_gamut_input__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "OutOfGamutInput", + "OutOfGamutInput", + "OutOfGamutInput", + "", + sizeof(OutOfGamutInput), + 7, + out_of_gamut_input__field_descriptors, + out_of_gamut_input__field_indices_by_name, + 1, out_of_gamut_input__number_ranges, + (ProtobufCMessageInit) out_of_gamut_input__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutInput.pb-c.h b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutInput.pb-c.h new file mode 100644 index 000000000..bcaec7a85 --- /dev/null +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutInput.pb-c.h @@ -0,0 +1,86 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: OutOfGamutInput.proto */ + +#ifndef PROTOBUF_C_OutOfGamutInput_2eproto__INCLUDED +#define PROTOBUF_C_OutOfGamutInput_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "InputCoordinates.pb-c.h" +#include "ColorSpace.pb-c.h" +#include "ProcessRange.pb-c.h" + +typedef struct _OutOfGamutInput OutOfGamutInput; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _OutOfGamutInput +{ + ProtobufCMessage base; + protobuf_c_boolean has_threadl; + double threadl; + protobuf_c_boolean has_threada; + double threada; + protobuf_c_boolean has_threadb; + double threadb; + protobuf_c_boolean has_colorspace; + ColorSpace colorspace; + InputCoordinates *inputcoordinates; + protobuf_c_boolean has_forwarddata; + ProtobufCBinaryData forwarddata; + size_t n_processranges; + ProcessRange **processranges; +}; +#define OUT_OF_GAMUT_INPUT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&out_of_gamut_input__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, COLOR_SPACE__Volume, NULL, 0, {0,NULL}, 0,NULL } + + +/* OutOfGamutInput methods */ +void out_of_gamut_input__init + (OutOfGamutInput *message); +size_t out_of_gamut_input__get_packed_size + (const OutOfGamutInput *message); +size_t out_of_gamut_input__pack + (const OutOfGamutInput *message, + uint8_t *out); +size_t out_of_gamut_input__pack_to_buffer + (const OutOfGamutInput *message, + ProtobufCBuffer *buffer); +OutOfGamutInput * + out_of_gamut_input__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void out_of_gamut_input__free_unpacked + (OutOfGamutInput *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*OutOfGamutInput_Closure) + (const OutOfGamutInput *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor out_of_gamut_input__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_OutOfGamutInput_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutOutput.pb-c.c b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutOutput.pb-c.c new file mode 100644 index 000000000..fbd1854ab --- /dev/null +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutOutput.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: OutOfGamutOutput.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "OutOfGamutOutput.pb-c.h" +void out_of_gamut_output__init + (OutOfGamutOutput *message) +{ + static const OutOfGamutOutput init_value = OUT_OF_GAMUT_OUTPUT__INIT; + *message = init_value; +} +size_t out_of_gamut_output__get_packed_size + (const OutOfGamutOutput *message) +{ + assert(message->base.descriptor == &out_of_gamut_output__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t out_of_gamut_output__pack + (const OutOfGamutOutput *message, + uint8_t *out) +{ + assert(message->base.descriptor == &out_of_gamut_output__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t out_of_gamut_output__pack_to_buffer + (const OutOfGamutOutput *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &out_of_gamut_output__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +OutOfGamutOutput * + out_of_gamut_output__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (OutOfGamutOutput *) + protobuf_c_message_unpack (&out_of_gamut_output__descriptor, + allocator, len, data); +} +void out_of_gamut_output__free_unpacked + (OutOfGamutOutput *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &out_of_gamut_output__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor out_of_gamut_output__field_descriptors[3] = +{ + { + "OutOfGamut", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(OutOfGamutOutput, has_outofgamut), + offsetof(OutOfGamutOutput, outofgamut), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "HasError", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(OutOfGamutOutput, has_haserror), + offsetof(OutOfGamutOutput, haserror), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ErrorMessage", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(OutOfGamutOutput, errormessage), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned out_of_gamut_output__field_indices_by_name[] = { + 2, /* field[2] = ErrorMessage */ + 1, /* field[1] = HasError */ + 0, /* field[0] = OutOfGamut */ +}; +static const ProtobufCIntRange out_of_gamut_output__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor out_of_gamut_output__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "OutOfGamutOutput", + "OutOfGamutOutput", + "OutOfGamutOutput", + "", + sizeof(OutOfGamutOutput), + 3, + out_of_gamut_output__field_descriptors, + out_of_gamut_output__field_indices_by_name, + 1, out_of_gamut_output__number_ranges, + (ProtobufCMessageInit) out_of_gamut_output__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutOutput.pb-c.h b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutOutput.pb-c.h new file mode 100644 index 000000000..21bfa08ca --- /dev/null +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/OutOfGamutOutput.pb-c.h @@ -0,0 +1,75 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: OutOfGamutOutput.proto */ + +#ifndef PROTOBUF_C_OutOfGamutOutput_2eproto__INCLUDED +#define PROTOBUF_C_OutOfGamutOutput_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _OutOfGamutOutput OutOfGamutOutput; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _OutOfGamutOutput +{ + ProtobufCMessage base; + protobuf_c_boolean has_outofgamut; + protobuf_c_boolean outofgamut; + protobuf_c_boolean has_haserror; + protobuf_c_boolean haserror; + char *errormessage; +}; +#define OUT_OF_GAMUT_OUTPUT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&out_of_gamut_output__descriptor) \ + , 0, 0, 0, 0, NULL } + + +/* OutOfGamutOutput methods */ +void out_of_gamut_output__init + (OutOfGamutOutput *message); +size_t out_of_gamut_output__get_packed_size + (const OutOfGamutOutput *message); +size_t out_of_gamut_output__pack + (const OutOfGamutOutput *message, + uint8_t *out); +size_t out_of_gamut_output__pack_to_buffer + (const OutOfGamutOutput *message, + ProtobufCBuffer *buffer); +OutOfGamutOutput * + out_of_gamut_output__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void out_of_gamut_output__free_unpacked + (OutOfGamutOutput *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*OutOfGamutOutput_Closure) + (const OutOfGamutOutput *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor out_of_gamut_output__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_OutOfGamutOutput_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableInput.pb-c.c b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableInput.pb-c.c new file mode 100644 index 000000000..12a349283 --- /dev/null +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableInput.pb-c.c @@ -0,0 +1,183 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: RecommendedProcessTableInput.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "RecommendedProcessTableInput.pb-c.h" +void recommended_process_table_input__init + (RecommendedProcessTableInput *message) +{ + static const RecommendedProcessTableInput init_value = RECOMMENDED_PROCESS_TABLE_INPUT__INIT; + *message = init_value; +} +size_t recommended_process_table_input__get_packed_size + (const RecommendedProcessTableInput *message) +{ + assert(message->base.descriptor == &recommended_process_table_input__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t recommended_process_table_input__pack + (const RecommendedProcessTableInput *message, + uint8_t *out) +{ + assert(message->base.descriptor == &recommended_process_table_input__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t recommended_process_table_input__pack_to_buffer + (const RecommendedProcessTableInput *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &recommended_process_table_input__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RecommendedProcessTableInput * + recommended_process_table_input__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RecommendedProcessTableInput *) + protobuf_c_message_unpack (&recommended_process_table_input__descriptor, + allocator, len, data); +} +void recommended_process_table_input__free_unpacked + (RecommendedProcessTableInput *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &recommended_process_table_input__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor recommended_process_table_input__field_descriptors[8] = +{ + { + "ThreadL", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(RecommendedProcessTableInput, has_threadl), + offsetof(RecommendedProcessTableInput, threadl), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ThreadA", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(RecommendedProcessTableInput, has_threada), + offsetof(RecommendedProcessTableInput, threada), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ThreadB", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(RecommendedProcessTableInput, has_threadb), + offsetof(RecommendedProcessTableInput, threadb), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ForwardData", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BYTES, + offsetof(RecommendedProcessTableInput, has_forwarddata), + offsetof(RecommendedProcessTableInput, forwarddata), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Stops", + 5, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(RecommendedProcessTableInput, n_stops), + offsetof(RecommendedProcessTableInput, stops), + &gradient_input_stop__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "InputLiquids", + 6, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(RecommendedProcessTableInput, n_inputliquids), + offsetof(RecommendedProcessTableInput, inputliquids), + &input_liquid__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ProcessRanges", + 7, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(RecommendedProcessTableInput, n_processranges), + offsetof(RecommendedProcessTableInput, processranges), + &process_range__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "UseLightInks", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(RecommendedProcessTableInput, has_uselightinks), + offsetof(RecommendedProcessTableInput, uselightinks), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned recommended_process_table_input__field_indices_by_name[] = { + 3, /* field[3] = ForwardData */ + 5, /* field[5] = InputLiquids */ + 6, /* field[6] = ProcessRanges */ + 4, /* field[4] = Stops */ + 1, /* field[1] = ThreadA */ + 2, /* field[2] = ThreadB */ + 0, /* field[0] = ThreadL */ + 7, /* field[7] = UseLightInks */ +}; +static const ProtobufCIntRange recommended_process_table_input__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 8 } +}; +const ProtobufCMessageDescriptor recommended_process_table_input__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "RecommendedProcessTableInput", + "RecommendedProcessTableInput", + "RecommendedProcessTableInput", + "", + sizeof(RecommendedProcessTableInput), + 8, + recommended_process_table_input__field_descriptors, + recommended_process_table_input__field_indices_by_name, + 1, recommended_process_table_input__number_ranges, + (ProtobufCMessageInit) recommended_process_table_input__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableInput.pb-c.h b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableInput.pb-c.h new file mode 100644 index 000000000..98b4e1613 --- /dev/null +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableInput.pb-c.h @@ -0,0 +1,89 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: RecommendedProcessTableInput.proto */ + +#ifndef PROTOBUF_C_RecommendedProcessTableInput_2eproto__INCLUDED +#define PROTOBUF_C_RecommendedProcessTableInput_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "ProcessRange.pb-c.h" +#include "InputLiquid.pb-c.h" +#include "GradientInputStop.pb-c.h" + +typedef struct _RecommendedProcessTableInput RecommendedProcessTableInput; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _RecommendedProcessTableInput +{ + ProtobufCMessage base; + protobuf_c_boolean has_threadl; + double threadl; + protobuf_c_boolean has_threada; + double threada; + protobuf_c_boolean has_threadb; + double threadb; + protobuf_c_boolean has_forwarddata; + ProtobufCBinaryData forwarddata; + size_t n_stops; + GradientInputStop **stops; + size_t n_inputliquids; + InputLiquid **inputliquids; + size_t n_processranges; + ProcessRange **processranges; + protobuf_c_boolean has_uselightinks; + protobuf_c_boolean uselightinks; +}; +#define RECOMMENDED_PROCESS_TABLE_INPUT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&recommended_process_table_input__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, {0,NULL}, 0,NULL, 0,NULL, 0,NULL, 0, 0 } + + +/* RecommendedProcessTableInput methods */ +void recommended_process_table_input__init + (RecommendedProcessTableInput *message); +size_t recommended_process_table_input__get_packed_size + (const RecommendedProcessTableInput *message); +size_t recommended_process_table_input__pack + (const RecommendedProcessTableInput *message, + uint8_t *out); +size_t recommended_process_table_input__pack_to_buffer + (const RecommendedProcessTableInput *message, + ProtobufCBuffer *buffer); +RecommendedProcessTableInput * + recommended_process_table_input__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void recommended_process_table_input__free_unpacked + (RecommendedProcessTableInput *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*RecommendedProcessTableInput_Closure) + (const RecommendedProcessTableInput *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor recommended_process_table_input__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_RecommendedProcessTableInput_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableOutput.pb-c.c b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableOutput.pb-c.c new file mode 100644 index 000000000..0ef6e7f9e --- /dev/null +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableOutput.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: RecommendedProcessTableOutput.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "RecommendedProcessTableOutput.pb-c.h" +void recommended_process_table_output__init + (RecommendedProcessTableOutput *message) +{ + static const RecommendedProcessTableOutput init_value = RECOMMENDED_PROCESS_TABLE_OUTPUT__INIT; + *message = init_value; +} +size_t recommended_process_table_output__get_packed_size + (const RecommendedProcessTableOutput *message) +{ + assert(message->base.descriptor == &recommended_process_table_output__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t recommended_process_table_output__pack + (const RecommendedProcessTableOutput *message, + uint8_t *out) +{ + assert(message->base.descriptor == &recommended_process_table_output__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t recommended_process_table_output__pack_to_buffer + (const RecommendedProcessTableOutput *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &recommended_process_table_output__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RecommendedProcessTableOutput * + recommended_process_table_output__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RecommendedProcessTableOutput *) + protobuf_c_message_unpack (&recommended_process_table_output__descriptor, + allocator, len, data); +} +void recommended_process_table_output__free_unpacked + (RecommendedProcessTableOutput *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &recommended_process_table_output__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor recommended_process_table_output__field_descriptors[3] = +{ + { + "ProcessParametersTableIndex", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(RecommendedProcessTableOutput, has_processparameterstableindex), + offsetof(RecommendedProcessTableOutput, processparameterstableindex), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "HasError", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(RecommendedProcessTableOutput, has_haserror), + offsetof(RecommendedProcessTableOutput, haserror), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ErrorMessage", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(RecommendedProcessTableOutput, errormessage), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned recommended_process_table_output__field_indices_by_name[] = { + 2, /* field[2] = ErrorMessage */ + 1, /* field[1] = HasError */ + 0, /* field[0] = ProcessParametersTableIndex */ +}; +static const ProtobufCIntRange recommended_process_table_output__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor recommended_process_table_output__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "RecommendedProcessTableOutput", + "RecommendedProcessTableOutput", + "RecommendedProcessTableOutput", + "", + sizeof(RecommendedProcessTableOutput), + 3, + recommended_process_table_output__field_descriptors, + recommended_process_table_output__field_indices_by_name, + 1, recommended_process_table_output__number_ranges, + (ProtobufCMessageInit) recommended_process_table_output__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableOutput.pb-c.h b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableOutput.pb-c.h new file mode 100644 index 000000000..c836b4074 --- /dev/null +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/PMR/ColorLab/RecommendedProcessTableOutput.pb-c.h @@ -0,0 +1,75 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: RecommendedProcessTableOutput.proto */ + +#ifndef PROTOBUF_C_RecommendedProcessTableOutput_2eproto__INCLUDED +#define PROTOBUF_C_RecommendedProcessTableOutput_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _RecommendedProcessTableOutput RecommendedProcessTableOutput; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _RecommendedProcessTableOutput +{ + ProtobufCMessage base; + protobuf_c_boolean has_processparameterstableindex; + int32_t processparameterstableindex; + protobuf_c_boolean has_haserror; + protobuf_c_boolean haserror; + char *errormessage; +}; +#define RECOMMENDED_PROCESS_TABLE_OUTPUT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&recommended_process_table_output__descriptor) \ + , 0, 0, 0, 0, NULL } + + +/* RecommendedProcessTableOutput methods */ +void recommended_process_table_output__init + (RecommendedProcessTableOutput *message); +size_t recommended_process_table_output__get_packed_size + (const RecommendedProcessTableOutput *message); +size_t recommended_process_table_output__pack + (const RecommendedProcessTableOutput *message, + uint8_t *out); +size_t recommended_process_table_output__pack_to_buffer + (const RecommendedProcessTableOutput *message, + ProtobufCBuffer *buffer); +RecommendedProcessTableOutput * + recommended_process_table_output__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void recommended_process_table_output__free_unpacked + (RecommendedProcessTableOutput *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*RecommendedProcessTableOutput_Closure) + (const RecommendedProcessTableOutput *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor recommended_process_table_output__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_RecommendedProcessTableOutput_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Tango.ColorLib_v4.vcxproj b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Tango.ColorLib_v4.vcxproj index e12055f28..7b26a3e6f 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Tango.ColorLib_v4.vcxproj +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Tango.ColorLib_v4.vcxproj @@ -183,9 +183,13 @@ <ClInclude Include="PMR\ColorLab\LinearizationOutput.pb-c.h" /> <ClInclude Include="PMR\ColorLab\LiquidType.pb-c.h" /> <ClInclude Include="PMR\ColorLab\LiquidVolume.pb-c.h" /> + <ClInclude Include="PMR\ColorLab\OutOfGamutInput.pb-c.h" /> + <ClInclude Include="PMR\ColorLab\OutOfGamutOutput.pb-c.h" /> <ClInclude Include="PMR\ColorLab\OutputCoordinates.pb-c.h" /> <ClInclude Include="PMR\ColorLab\OutputLiquid.pb-c.h" /> <ClInclude Include="PMR\ColorLab\ProcessRange.pb-c.h" /> + <ClInclude Include="PMR\ColorLab\RecommendedProcessTableInput.pb-c.h" /> + <ClInclude Include="PMR\ColorLab\RecommendedProcessTableOutput.pb-c.h" /> <ClInclude Include="PMR\Stubs\CalculateRequest.pb-c.h" /> <ClInclude Include="PMR\Stubs\CalculateResponse.pb-c.h" /> <ClInclude Include="protobuf-c\protobuf-c.h" /> @@ -226,9 +230,13 @@ <ClCompile Include="PMR\ColorLab\LinearizationOutput.pb-c.c" /> <ClCompile Include="PMR\ColorLab\LiquidType.pb-c.c" /> <ClCompile Include="PMR\ColorLab\LiquidVolume.pb-c.c" /> + <ClCompile Include="PMR\ColorLab\OutOfGamutInput.pb-c.c" /> + <ClCompile Include="PMR\ColorLab\OutOfGamutOutput.pb-c.c" /> <ClCompile Include="PMR\ColorLab\OutputCoordinates.pb-c.c" /> <ClCompile Include="PMR\ColorLab\OutputLiquid.pb-c.c" /> <ClCompile Include="PMR\ColorLab\ProcessRange.pb-c.c" /> + <ClCompile Include="PMR\ColorLab\RecommendedProcessTableInput.pb-c.c" /> + <ClCompile Include="PMR\ColorLab\RecommendedProcessTableOutput.pb-c.c" /> <ClCompile Include="protobuf-c\protobuf-c.c" /> <ClCompile Include="Utils\CalibData.cpp" /> <ClCompile Include="Utils\ColorConvert.cpp" /> diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Tango.ColorLib_v4.vcxproj.filters b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Tango.ColorLib_v4.vcxproj.filters index 5ebaedebc..24bdaceb7 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Tango.ColorLib_v4.vcxproj.filters +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Tango.ColorLib_v4.vcxproj.filters @@ -150,6 +150,18 @@ <ClInclude Include="Utils\ColorTable.h"> <Filter>Utils</Filter> </ClInclude> + <ClInclude Include="PMR\ColorLab\RecommendedProcessTableOutput.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="PMR\ColorLab\RecommendedProcessTableInput.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="PMR\ColorLab\OutOfGamutInput.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="PMR\ColorLab\OutOfGamutOutput.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ClCompile Include="Exports.cpp"> @@ -266,5 +278,17 @@ <ClCompile Include="Utils\ColorTable.cpp"> <Filter>Utils</Filter> </ClCompile> + <ClCompile Include="PMR\ColorLab\RecommendedProcessTableOutput.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="PMR\ColorLab\RecommendedProcessTableInput.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="PMR\ColorLab\OutOfGamutOutput.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="PMR\ColorLab\OutOfGamutInput.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> </ItemGroup> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Utils/GBD.cpp b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Utils/GBD.cpp index 575b5035e..3e4f49878 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Utils/GBD.cpp +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Utils/GBD.cpp @@ -258,10 +258,11 @@ void GBD::InitData(unsigned char* colorTransformBuffer, long colorTransformFileS return; } + if(m_vert0 == NULL) m_vert0 = new double*[m_nTriangles]; - + if (m_vert1 == NULL) m_vert1 = new double*[m_nTriangles]; - + if (m_vert2 == NULL) m_vert2 = new double*[m_nTriangles]; /*m_vert0 = DBG_NEW double*[m_nTriangles]; diff --git a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs index bcdd20c88..c3da4b361 100644 --- a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs +++ b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs @@ -227,9 +227,153 @@ namespace Tango.ColorConversion return Convert(stop, job.Machine.Configuration, job.Rml, generateHive, job.Machine.LightInksInstalled, useLightInks); } + public OutOfGamutOutput IsOutOfGamut(OutOfGamutInput input, int version) + { + if (version < 4) version = 4; + + String fileName = $"{AssemblyHelper.GetCurrentAssemblyFolder()}\\Tango.ColorLib_v{version}.dll"; + + if (!File.Exists(fileName)) + { + throw new FileNotFoundException($"Could not find color conversion library '{fileName}'."); + } + + IntPtr pDll = NativeMethods.LoadLibrary(fileName); + IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "CheckOutOfGamut"); + NativeMethodDelegate convert = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( + pAddressOfFunctionToCall, + typeof(NativeMethodDelegate)); + + NativePMR<OutOfGamutInput, OutOfGamutOutput> nativePMR = new NativePMR<OutOfGamutInput, OutOfGamutOutput>(convert); + OutOfGamutOutput output = nativePMR.Invoke(input); + + bool result = NativeMethods.FreeLibrary(pDll); + + if (output.HasError) + { + throw new ExternalException($"Out Of Gamut Check Error: {output.ErrorMessage}!"); + } + + return output; + } + public bool IsOutOfGamut(BrushStop stop) { - return Convert(stop, false).OutOfGamut; + //return Convert(stop, false).OutOfGamut; + if (stop == null) + { + throw new ArgumentNullException("Specified brush stop is a null reference."); + } + if (stop.Segment == null || stop.Segment.Job == null) + { + throw new ArgumentNullException("The specified brush stop must be a part of a job segment."); + } + + if (stop.Segment.Job.Machine == null || stop.Segment.Job.Machine.Configuration == null) + { + throw new ArgumentNullException("The specified brush stop is associated with a job that is not a part of any machine or the machine does not have any configuration."); + } + + OutOfGamutInput input = new OutOfGamutInput(); + input.ColorSpace = (PMR.ColorLab.ColorSpace)stop.BrushColorSpace; + + var rml = stop.Segment.Job.Rml; + if (rml == null) + { + throw new ArgumentNullException("Specified RML is a null reference."); + } + + if (rml.Cct == null || rml.Cct.Data == null) + { + throw new ArgumentNullException("Specified RML CCT data is null."); + } + + Configuration configuration = stop.Segment.Job.Machine.Configuration; + + input.ThreadL = rml.WhitePointL; + input.ThreadA = rml.WhitePointA; + input.ThreadB = rml.WhitePointB; + + input.InputCoordinates = new InputCoordinates(); + + input.InputCoordinates.Red = Math.Max(stop.Red, 1); + input.InputCoordinates.Green = Math.Max(stop.Green, 1); + input.InputCoordinates.Blue = Math.Max(stop.Blue, 1); + + input.InputCoordinates.L = stop.L; + input.InputCoordinates.A = stop.A; + input.InputCoordinates.B = stop.B; + + input.InputCoordinates.Cyan = stop.Cyan; + input.InputCoordinates.Magenta = stop.Magenta; + input.InputCoordinates.Yellow = stop.Yellow; + input.InputCoordinates.Key = stop.Black; + + + input.ForwardData = ByteString.CopyFrom(rml.Cct.Data); + foreach (var prTable in rml.GetActiveProcessGroup().ProcessParametersTables) + { + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = prTable.MinInkUptake, + MaxInkUptake = prTable.MaxInkUptake, + }); + } + foreach (var ids_pack in configuration.GetSupportedIdsPacks(rml)) + { + CalibrationData calibrationData = Cat.CreateDemoCalibrationData((PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code); + + var rml_cat = rml.LiquidTypesRmls.SingleOrDefault(x => x.LiquidType.Code == ids_pack.LiquidType.Code); + + if (rml_cat != null) + { + calibrationData = rml_cat.GetCalibrationData(); + } + + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = (PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code, + MaxNanoliterPerCentimeter = ids_pack.LiquidType.LiquidTypesRmls.Single(x => x.Rml == rml).MaxNlPerCm, + Volume = stop.GetVolume(ids_pack.PackIndex), + CalibrationData = calibrationData, + }); + } + + OutOfGamutOutput outOfGamutOutput = IsOutOfGamut( input, 4); + + return outOfGamutOutput.OutOfGamut; + + //TODO: Use IsOutOfGamut(OutOfGamutInput input, 4); + } + + public RecommendedProcessTableOutput GetRecommendedProcessParameters(RecommendedProcessTableInput input, int version) + { + if (version < 4) version = 4; + + String fileName = $"{AssemblyHelper.GetCurrentAssemblyFolder()}\\Tango.ColorLib_v{version}.dll"; + + if (!File.Exists(fileName)) + { + throw new FileNotFoundException($"Could not find color conversion library '{fileName}'."); + } + + IntPtr pDll = NativeMethods.LoadLibrary(fileName); + IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "GetRecommendedProcessParameters"); + NativeMethodDelegate convert = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( + pAddressOfFunctionToCall, + typeof(NativeMethodDelegate)); + + NativePMR<RecommendedProcessTableInput, RecommendedProcessTableOutput> nativePMR = new NativePMR<RecommendedProcessTableInput, RecommendedProcessTableOutput>(convert); + RecommendedProcessTableOutput output = nativePMR.Invoke(input); + + bool result = NativeMethods.FreeLibrary(pDll); + + if (output.HasError) + { + throw new ExternalException($"Recommended Process Parameters Calculation Error: {output.ErrorMessage}!"); + } + + return output; } public ProcessParametersTable GetRecommendedProcessParameters(Job job) @@ -239,7 +383,125 @@ namespace Tango.ColorConversion public ProcessParametersTable GetRecommendedProcessParameters(Job job, ProcessParametersTablesGroup group) { - return GetRecommendedProcessParametersByGamutRegion(job, group); + //return GetRecommendedProcessParametersByGamutRegion(job, group); + //TODO: Use GetRecommendedProcessParameters(RecommendedProcessTableInput input, int version) + RecommendedProcessTableInput input = new RecommendedProcessTableInput(); + + var stops = job.Segments.SelectMany(x => x.BrushStops).ToList();//Where(x => x.BrushColorSpace != ColorSpaces.Catalog) + if (stops.Count == 0) + { + throw new ArgumentOutOfRangeException("THe number of brush stops cannot be zero."); + } + var rml = job.Rml; + if (rml == null) + { + throw new ArgumentNullException("Specified RML is a null reference."); + } + + if (rml.Cct == null || rml.Cct.Data == null) + { + throw new ArgumentNullException("Specified RML CCT data is null."); + } + var configuration = job.Machine.Configuration; + if (configuration == null) + { + throw new ArgumentNullException("Specified machine configuration is a null reference."); + } + + foreach (var stop in stops) + { + GradientInputStop istop = new GradientInputStop(); + istop.ColorSpace = (PMR.ColorLab.ColorSpace)stop.ColorSpace.Code; + istop.Offset = stop.OffsetPercent / 100d; + + if (stop.BrushColorSpace == ColorSpaces.LAB) + { + istop.L = stop.L; + istop.A = stop.A; + istop.B = stop.B; + } + else if(stop.BrushColorSpace == ColorSpaces.RGB) + { + istop.Red = stop.Red; + istop.Green = stop.Green; + istop.Blue = stop.Blue; + } + else if (stop.BrushColorSpace == ColorSpaces.Catalog) + { + if (stop.ColorCatalogsItem != null) + { + istop.Cyan = stop.ColorCatalogsItem.Cyan; + istop.Magenta = stop.ColorCatalogsItem.Magenta; + istop.Yellow = stop.ColorCatalogsItem.Yellow; + istop.Key = stop.ColorCatalogsItem.Black; + } + } + else if (stop.BrushColorSpace == ColorSpaces.Volume) + { + foreach (var liquidVolume in stop.LiquidVolumesOrderedPigmented) + { + istop.LiquidVolumes.Add(new PMR.ColorLab.LiquidVolume() + { + LiquidType = (PMR.ColorLab.LiquidType)liquidVolume.LiquidType, + Volume = liquidVolume.Volume + }); + } + } + + input.Stops.Add(istop); + } + + input.ThreadL = rml.WhitePointL; + input.ThreadA = rml.WhitePointA; + input.ThreadB = rml.WhitePointB; + input.ForwardData = ByteString.CopyFrom(rml.Cct.Data); + //input.UseLightInks = false; + foreach (var prTable in rml.GetActiveProcessGroup().ProcessParametersTables) + { + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = prTable.MinInkUptake, + MaxInkUptake = prTable.MaxInkUptake, + }); + } + + foreach (var ids_pack in configuration.GetSupportedIdsPacks(rml)) + { + CalibrationData calibrationData = Cat.CreateDemoCalibrationData((PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code); + + var rml_cat = rml.LiquidTypesRmls.SingleOrDefault(x => x.LiquidType.Code == ids_pack.LiquidType.Code); + + if (rml_cat != null) + { + calibrationData = rml_cat.GetCalibrationData(); + } + + input.InputLiquids.Add(new InputLiquid() + { + LiquidType = (PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code, + MaxNanoliterPerCentimeter = ids_pack.LiquidType.LiquidTypesRmls.Single(x => x.Rml == rml).MaxNlPerCm, + CalibrationData = calibrationData, + }); + } + + RecommendedProcessTableOutput output = GetRecommendedProcessParameters(input, rml.ColorConversionVersion); + + var maxIndex = output.ProcessParametersTableIndex; + //var catalogBrushStops = job.Segments.SelectMany(x => x.BrushStops).Where(x => x.BrushColorSpace == ColorSpaces.Catalog); + //if(catalogBrushStops.Count() > 0) + //{ + // var catalogIndex = catalogBrushStops.Max(x => x.ColorCatalogsItem.ProcessParametersTableIndex); + // maxIndex = Math.Max(output.ProcessParametersTableIndex, catalogIndex); + //} + + var processTable = group.ProcessParametersTables.FirstOrDefault(x => x.TableIndex == maxIndex); + + if (processTable == null) + { + processTable = group.ProcessParametersTables.FirstOrDefault(); + } + + return processTable; } private ProcessParametersTable GetRecommendedProcessParametersByProcessParameters(Job job, ProcessParametersTablesGroup group) diff --git a/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs b/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs index ba69e945a..da8486dfe 100644 --- a/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs +++ b/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs @@ -22,6 +22,7 @@ namespace Tango.ColorConversion Task<ConversionOutput> ConvertAsync(BrushStop stop, bool generateHive, bool useLightInks = false); Task<ConversionOutput> ConvertAsync(Job job, Color color, bool generateHive, bool useLightInks = false); bool IsOutOfGamut(BrushStop stop); + RecommendedProcessTableOutput GetRecommendedProcessParameters(RecommendedProcessTableInput input, int version); ProcessParametersTable GetRecommendedProcessParameters(Job job); ProcessParametersTable GetRecommendedProcessParameters(Job job, ProcessParametersTablesGroup group); GradientConversionOutput GenerateGradient(GradientConversionInput input, int version); diff --git a/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/App.config b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/App.config new file mode 100644 index 000000000..332e7dbda --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/App.config @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> + </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.0.5.0" newVersion="5.0.5.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/ColorFunctionGenerator.cs b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/ColorFunctionGenerator.cs new file mode 100644 index 000000000..6effefbe0 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/ColorFunctionGenerator.cs @@ -0,0 +1,143 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Helpers; +using Tango.PMR; +using Tango.PMR.ColorLab; + +namespace Tango.ColorLib.OutOfGamutTest.CLI +{ + public class ColorFunctionGenerator + { + static class NativeMethods + { + [DllImport("kernel32.dll")] + public static extern IntPtr LoadLibrary(string dllToLoad); + + [DllImport("kernel32.dll")] + public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); + + [DllImport("kernel32.dll")] + public static extern bool FreeLibrary(IntPtr hModule); + } + + public OutOfGamutOutput CheckOutOfGamut(OutOfGamutInput input) + { + String fileName = $"{AssemblyHelper.GetCurrentAssemblyFolder()}\\Tango.ColorLib_v4.dll"; + + if (!File.Exists(fileName)) + { + throw new FileNotFoundException($"Could not find color conversion library '{fileName}'."); + } + + IntPtr pDll = NativeMethods.LoadLibrary(fileName); + IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "CheckOutOfGamut"); + NativeMethodDelegate generateIsOutOfGamut = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( + pAddressOfFunctionToCall, + typeof(NativeMethodDelegate)); + + NativePMR<OutOfGamutInput, OutOfGamutOutput> nativePMR = new NativePMR<OutOfGamutInput, OutOfGamutOutput>(generateIsOutOfGamut); + OutOfGamutOutput output = nativePMR.Invoke(input); + + bool result = NativeMethods.FreeLibrary(pDll); + + if (output.HasError) + { + throw new ExternalException($"Out Of Gamut Check Error: {output.ErrorMessage}!"); + } + + return output; + } + + public ConversionOutput P_IsInGamut(ConversionInput input) + { + String fileName = $"{AssemblyHelper.GetCurrentAssemblyFolder()}\\Tango.ColorLib_v4.dll"; + + if (!File.Exists(fileName)) + { + throw new FileNotFoundException($"Could not find color conversion library '{fileName}'."); + } + + IntPtr pDll = NativeMethods.LoadLibrary(fileName); + IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "P_IsInGamut"); + NativeMethodDelegate generateIsOutOfGamut = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( + pAddressOfFunctionToCall, + typeof(NativeMethodDelegate)); + + NativePMR<ConversionInput, ConversionOutput> nativePMR = new NativePMR<ConversionInput, ConversionOutput>(generateIsOutOfGamut); + ConversionOutput output = nativePMR.Invoke(input); + + bool result = NativeMethods.FreeLibrary(pDll); + if (output.HasError) + { + throw new ExternalException($"Out Of Gamut Check Error: {output.ErrorMessage}!"); + } + + return output; + } + + public RecommendedProcessTableOutput GetRecommendedProcessParameters(RecommendedProcessTableInput input, int version) + { + if (version < 4) version = 4; + + String fileName = $"{AssemblyHelper.GetCurrentAssemblyFolder()}\\Tango.ColorLib_v{version}.dll"; + + if (!File.Exists(fileName)) + { + throw new FileNotFoundException($"Could not find color conversion library '{fileName}'."); + } + + IntPtr pDll = NativeMethods.LoadLibrary(fileName); + IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "GetRecommendedProcessParameters"); + NativeMethodDelegate convert = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( + pAddressOfFunctionToCall, + typeof(NativeMethodDelegate)); + + NativePMR<RecommendedProcessTableInput, RecommendedProcessTableOutput> nativePMR = new NativePMR<RecommendedProcessTableInput, RecommendedProcessTableOutput>(convert); + RecommendedProcessTableOutput output = nativePMR.Invoke(input); + + bool result = NativeMethods.FreeLibrary(pDll); + + if (output.HasError) + { + throw new ExternalException($"Recommended Process Parameters Calculation Error: {output.ErrorMessage}!"); + } + + return output; + } + + public ConversionOutput Convert(ConversionInput conversionInput, int version) + { + if (version < 1) version = 1; + + String fileName = $"{AssemblyHelper.GetCurrentAssemblyFolder()}\\Tango.ColorLib_v{version}.dll"; + + if (!File.Exists(fileName)) + { + throw new FileNotFoundException($"Could not find color conversion library '{fileName}'."); + } + + IntPtr pDll = NativeMethods.LoadLibrary(fileName); + IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "Convert"); + NativeMethodDelegate convert = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( + pAddressOfFunctionToCall, + typeof(NativeMethodDelegate)); + + NativePMR<ConversionInput, ConversionOutput> nativePMR = new NativePMR<ConversionInput, ConversionOutput>(convert); + ConversionOutput output = nativePMR.Invoke(conversionInput); + + bool result = NativeMethods.FreeLibrary(pDll); + + if (output.HasError) + { + throw new ExternalException($"Color Conversion Error: {output.ErrorMessage}!"); + } + + return output; + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Program.cs b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Program.cs new file mode 100644 index 000000000..0469d8518 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Program.cs @@ -0,0 +1,354 @@ +using Google.Protobuf; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.ExtensionMethods; +using Tango.PMR.ColorLab; + +namespace Tango.ColorLib.OutOfGamutTest.CLI +{ + class Program + { + public static Random _s_random = new Random(); + static void Main(string[] args) + { + ColorFunctionGenerator connector = new ColorFunctionGenerator(); + Console.WriteLine("Press any key to start..."); + Console.ReadLine(); + Stopwatch watch = new Stopwatch(); + watch.Start(); + Console.WriteLine("Start processing Compare Convert and GetRecommendedProcessParameters for 200 Brush stops..."); + for (int i = 0; i < 50; i++) + { + ConversionOutput convert_result1 = Convert(connector, PMR.ColorLab.ColorSpace.Rgb); + ConversionOutput convert_result2 = Convert(connector, PMR.ColorLab.ColorSpace.Lab); + ConversionOutput convert_result3 = Convert(connector, PMR.ColorLab.ColorSpace.Cmyk); + ConversionOutput convert_result4 = Convert(connector, PMR.ColorLab.ColorSpace.Catalog); + } + watch.Stop(); + + Console.WriteLine($"Processing Convert for 200 brush stops completed after: {watch.ElapsedMilliseconds.ToString()} milliseconds."); + Console.WriteLine(); + watch.Reset(); + watch.Restart(); + + int result = GetRecommendedProcessParameters(connector); + + watch.Stop(); + + Console.WriteLine($"Processing GetRecommendedProcessParameters with 200 brush stops completed after: {watch.ElapsedMilliseconds.ToString()} milliseconds."); + Console.WriteLine(); + + Console.WriteLine("Start processing Compare Convert and OutOfGamut for 200 Brush stops..."); + + watch.Reset(); + watch.Restart(); + for (int i = 0; i < 100; i++) + { + ConversionOutput convert_result1 = Convert(connector, PMR.ColorLab.ColorSpace.Rgb); + ConversionOutput convert_result2 = Convert(connector, PMR.ColorLab.ColorSpace.Lab); + } + watch.Stop(); + Console.WriteLine($"Processing Convert for 200 brush stops completed after: {watch.ElapsedMilliseconds.ToString()} milliseconds."); + Console.WriteLine(); + + watch.Reset(); + watch.Restart(); + for (int i = 0; i < 100; i++) + { + bool result_o1 = CheckOutOfGamut(connector, PMR.ColorLab.ColorSpace.Rgb); + bool result_o2 = CheckOutOfGamut(connector, PMR.ColorLab.ColorSpace.Lab); + } + + Console.WriteLine($"Processing CheckOutOfGamut completed after: {watch.ElapsedMilliseconds.ToString()} milliseconds."); + Console.WriteLine(); + watch.Stop(); + + Console.WriteLine("Press return to exit..."); + Console.ReadLine(); + } + + public static bool CheckOutOfGamut(ColorFunctionGenerator connector, PMR.ColorLab.ColorSpace colorSpase) + { + OutOfGamutInput input = new OutOfGamutInput(); + + input.ThreadL = 92.7867; + input.ThreadA = -0.2519; + input.ThreadB = 0.6968; + + input.ColorSpace = colorSpase; + input.InputCoordinates = GetRandomInputCoordinates(colorSpase); + + //Process Ranges + + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = 200, + MaxInkUptake = 200, + }); + + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = 200, + MaxInkUptake = 400, + }); + + input.ForwardData = ByteString.CopyFrom(File.ReadAllBytes(@"Sylko_HV_IL350R.cct")); + + //RML Liquid Factors + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Cyan, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Cyan), + MaxNanoliterPerCentimeter = 200, + }); + + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Magenta, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Magenta), + MaxNanoliterPerCentimeter = 200, + }); + + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Yellow, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Yellow), + MaxNanoliterPerCentimeter = 200, + }); + + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Black, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Black), + MaxNanoliterPerCentimeter = 200, + }); + + OutOfGamutOutput outOfGamutOutput = connector.CheckOutOfGamut(input); + + return outOfGamutOutput.OutOfGamut; + } + + public static int GetRecommendedProcessParameters(ColorFunctionGenerator connector) + { + RecommendedProcessTableInput input = new RecommendedProcessTableInput(); + input.ThreadL = 92.7867; + input.ThreadA = -0.2519; + input.ThreadB = 0.6968; + input.ForwardData = ByteString.CopyFrom(File.ReadAllBytes(@"Sylko_HV_IL350R.cct")); + + for (int i = 0; i < 50; i++) + { + input.Stops.Add(GetRandomGradientInputStop(ColorSpace.Rgb)); + input.Stops.Add(GetRandomGradientInputStop(ColorSpace.Lab)); + input.Stops.Add(GetRandomGradientInputStop(ColorSpace.Cmyk)); + input.Stops.Add(GetRandomGradientInputStop(ColorSpace.Volume)); + } + + input.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Cyan, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Cyan), + MaxNanoliterPerCentimeter = 200, + }); + + input.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Magenta, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Magenta), + MaxNanoliterPerCentimeter = 200, + }); + input.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Yellow, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Yellow), + MaxNanoliterPerCentimeter = 200, + }); + + input.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Black, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Black), + MaxNanoliterPerCentimeter = 200, + }); + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = 200, + MaxInkUptake = 200, + }); + + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = 200, + MaxInkUptake = 400, + }); + input.UseLightInks = false; + + RecommendedProcessTableOutput output = connector.GetRecommendedProcessParameters(input, 4); + return output.ProcessParametersTableIndex; + } + + public static ConversionOutput Convert(ColorFunctionGenerator connector, PMR.ColorLab.ColorSpace colorSpase) + { + ConversionInput input = new ConversionInput(); + input.ThreadL = 92.7867; + input.ThreadA = -0.2519; + input.ThreadB = 0.6968; + + input.ColorSpace = colorSpase; + input.InputCoordinates = GetRandomInputCoordinates(colorSpase); + + //Process Ranges + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = 200, + MaxInkUptake = 200, + }); + + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = 200, + MaxInkUptake = 400, + }); + + input.ForwardData = ByteString.CopyFrom(File.ReadAllBytes(@"Sylko_HV_IL350R.cct")); + + //RML Liquid Factors + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Cyan, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Cyan), + MaxNanoliterPerCentimeter = 200, + }); + + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Magenta, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Magenta), + MaxNanoliterPerCentimeter = 200, + }); + + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Yellow, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Yellow), + MaxNanoliterPerCentimeter = 200, + }); + + input.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = LiquidType.Black, + CalibrationData = BL.Entities.Cat.CreateDemoCalibrationData(LiquidType.Black), + MaxNanoliterPerCentimeter = 200, + }); + input.GenerateHive = false; + return connector.Convert(input, 4); + } + + public static InputCoordinates GetRandomInputCoordinates(PMR.ColorLab.ColorSpace colorSpase) + { + InputCoordinates inputCoordinates = new InputCoordinates(); + + if (colorSpase == PMR.ColorLab.ColorSpace.Rgb) + { + inputCoordinates.Red = _s_random.Next(0, 255); + inputCoordinates.Green = _s_random.Next(0, 255); + inputCoordinates.Blue = _s_random.Next(0, 255); + } + else if (colorSpase == PMR.ColorLab.ColorSpace.Lab) + { + inputCoordinates.L = _s_random.Next(0, 100); ; + inputCoordinates.A = _s_random.Next(-128, 128); + inputCoordinates.B = _s_random.Next(-128, 128); + } + //else if (colorSpase == PMR.ColorLab.ColorSpace.Catalog || colorSpase == ColorSpace.Volume) + //{ + // inputCoordinates.InputLiquids.Add(new InputLiquid() + // { + // LiquidType = LiquidType.Cyan, + // Volume = _s_random.Next(0, 100) + // }); + // inputCoordinates.InputLiquids.Add(new InputLiquid() + // { + // LiquidType = LiquidType.Magenta, + // Volume = _s_random.Next(0, 100) + // }); + // inputCoordinates.InputLiquids.Add(new InputLiquid() + // { + // LiquidType = LiquidType.Yellow, + // Volume = _s_random.Next(0, 100) + // }); + // inputCoordinates.InputLiquids.Add(new InputLiquid() + // { + // LiquidType = LiquidType.Black, + // Volume = _s_random.Next(0, 100) + // }); + //} + //else + { + inputCoordinates.Cyan = _s_random.Next(0, 100); + inputCoordinates.Magenta = _s_random.Next(0, 100); + inputCoordinates.Yellow = _s_random.Next(0, 100); + inputCoordinates.Key = _s_random.Next(0, 100); + } + + return inputCoordinates; + + } + + public static GradientInputStop GetRandomGradientInputStop(PMR.ColorLab.ColorSpace colorSpase) + { + GradientInputStop input = new GradientInputStop(); + input.ColorSpace = colorSpase; + if (colorSpase == PMR.ColorLab.ColorSpace.Rgb) + { + input.Red = _s_random.Next(0, 255); + input.Green = _s_random.Next(0, 255); + input.Blue = _s_random.Next(0, 255); + } + + else if (colorSpase == PMR.ColorLab.ColorSpace.Lab) + { + input.L = _s_random.Next(0, 100); ; + input.A = _s_random.Next(-128, 128); + input.B = _s_random.Next(-128, 128); + } + else if(colorSpase == PMR.ColorLab.ColorSpace.Catalog || colorSpase == ColorSpace.Volume) + { + input.LiquidVolumes.Add(new LiquidVolume() + { + LiquidType = LiquidType.Cyan, + Volume = _s_random.Next(0, 100) + }); + input.LiquidVolumes.Add(new LiquidVolume() + { + LiquidType = LiquidType.Magenta, + Volume = _s_random.Next(0, 100) + }); + input.LiquidVolumes.Add(new LiquidVolume() + { + LiquidType = LiquidType.Yellow, + Volume = _s_random.Next(0, 100) + }); + input.LiquidVolumes.Add(new LiquidVolume() + { + LiquidType = LiquidType.Black, + Volume = _s_random.Next(0, 100) + }); + } + else{ + input.Cyan = _s_random.Next(0, 100); + input.Magenta = _s_random.Next(0, 100); + input.Yellow = _s_random.Next(0, 100); + input.Key = _s_random.Next(0, 100); + } + + return input; + + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..eee4cc680 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango.ColorLib.OutOfGamutTest.CLI")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.ColorLib.OutOfGamutTest.CLI")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6b13e186-ade2-4d97-9643-8132e00fc207")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Sylko_HV_IL350R.cct b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Sylko_HV_IL350R.cct Binary files differnew file mode 100644 index 000000000..d164d7c84 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Sylko_HV_IL350R.cct diff --git a/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Sylko_HV_IL400Bl95R_1.cct b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Sylko_HV_IL400Bl95R_1.cct Binary files differnew file mode 100644 index 000000000..5802a14eb --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Sylko_HV_IL400Bl95R_1.cct diff --git a/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Tango.ColorLib.OutOfGamutTest.CLI.csproj b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Tango.ColorLib.OutOfGamutTest.CLI.csproj new file mode 100644 index 000000000..0080143e5 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/Tango.ColorLib.OutOfGamutTest.CLI.csproj @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{6B13E186-ADE2-4D97-9643-8132E00FC207}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>Tango.ColorLib.OutOfGamutTest.CLI</RootNamespace> + <AssemblyName>Tango.ColorLib.OutOfGamutTest.CLI</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ColorFunctionGenerator.cs" /> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="packages.config" /> + <None Include="Sylko_HV_IL350R.cct"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="Sylko_HV_IL400Bl95R_1.cct"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + </ItemGroup> + <ItemGroup> + <PackageReference Include="Google.Protobuf"> + <Version>3.4.1</Version> + </PackageReference> + </ItemGroup> + <ItemGroup> + <Content Include="..\Build\ColorLib\Debug\Tango.ColorLib_v4.dll"> + <Link>Tango.ColorLib_v4.dll</Link> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Tango.BL\Tango.BL.csproj"> + <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> + <Name>Tango.BL</Name> + </ProjectReference> + <ProjectReference Include="..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\Tango.PMR\Tango.PMR.csproj"> + <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project> + <Name>Tango.PMR</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/packages.config b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/packages.config new file mode 100644 index 000000000..fa3c0d58d --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorLib.OutOfGamutTest.CLI/packages.config @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Google.Protobuf" version="3.4.1" targetFramework="net461" /> +</packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/ColorLab/OutOfGamutInput.cs b/Software/Visual_Studio/Tango.PMR/ColorLab/OutOfGamutInput.cs new file mode 100644 index 000000000..adef09dfd --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/ColorLab/OutOfGamutInput.cs @@ -0,0 +1,332 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: OutOfGamutInput.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.ColorLab { + + /// <summary>Holder for reflection information generated from OutOfGamutInput.proto</summary> + public static partial class OutOfGamutInputReflection { + + #region Descriptor + /// <summary>File descriptor for OutOfGamutInput.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static OutOfGamutInputReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChVPdXRPZkdhbXV0SW5wdXQucHJvdG8SElRhbmdvLlBNUi5Db2xvckxhYhoW", + "SW5wdXRDb29yZGluYXRlcy5wcm90bxoQQ29sb3JTcGFjZS5wcm90bxoSUHJv", + "Y2Vzc1JhbmdlLnByb3RvIoYCCg9PdXRPZkdhbXV0SW5wdXQSDwoHVGhyZWFk", + "TBgBIAEoARIPCgdUaHJlYWRBGAIgASgBEg8KB1RocmVhZEIYAyABKAESMgoK", + "Q29sb3JTcGFjZRgEIAEoDjIeLlRhbmdvLlBNUi5Db2xvckxhYi5Db2xvclNw", + "YWNlEj4KEElucHV0Q29vcmRpbmF0ZXMYBSABKAsyJC5UYW5nby5QTVIuQ29s", + "b3JMYWIuSW5wdXRDb29yZGluYXRlcxITCgtGb3J3YXJkRGF0YRgGIAEoDBI3", + "Cg1Qcm9jZXNzUmFuZ2VzGAcgAygLMiAuVGFuZ28uUE1SLkNvbG9yTGFiLlBy", + "b2Nlc3NSYW5nZUIeChxjb20udHdpbmUudGFuZ28ucG1yLmNvbG9ybGFiYgZw", + "cm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.ColorLab.InputCoordinatesReflection.Descriptor, global::Tango.PMR.ColorLab.ColorSpaceReflection.Descriptor, global::Tango.PMR.ColorLab.ProcessRangeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.ColorLab.OutOfGamutInput), global::Tango.PMR.ColorLab.OutOfGamutInput.Parser, new[]{ "ThreadL", "ThreadA", "ThreadB", "ColorSpace", "InputCoordinates", "ForwardData", "ProcessRanges" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class OutOfGamutInput : pb::IMessage<OutOfGamutInput> { + private static readonly pb::MessageParser<OutOfGamutInput> _parser = new pb::MessageParser<OutOfGamutInput>(() => new OutOfGamutInput()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<OutOfGamutInput> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.ColorLab.OutOfGamutInputReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutOfGamutInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutOfGamutInput(OutOfGamutInput other) : this() { + threadL_ = other.threadL_; + threadA_ = other.threadA_; + threadB_ = other.threadB_; + colorSpace_ = other.colorSpace_; + InputCoordinates = other.inputCoordinates_ != null ? other.InputCoordinates.Clone() : null; + forwardData_ = other.forwardData_; + processRanges_ = other.processRanges_.Clone(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutOfGamutInput Clone() { + return new OutOfGamutInput(this); + } + + /// <summary>Field number for the "ThreadL" field.</summary> + public const int ThreadLFieldNumber = 1; + private double threadL_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ThreadL { + get { return threadL_; } + set { + threadL_ = value; + } + } + + /// <summary>Field number for the "ThreadA" field.</summary> + public const int ThreadAFieldNumber = 2; + private double threadA_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ThreadA { + get { return threadA_; } + set { + threadA_ = value; + } + } + + /// <summary>Field number for the "ThreadB" field.</summary> + public const int ThreadBFieldNumber = 3; + private double threadB_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ThreadB { + get { return threadB_; } + set { + threadB_ = value; + } + } + + /// <summary>Field number for the "ColorSpace" field.</summary> + public const int ColorSpaceFieldNumber = 4; + private global::Tango.PMR.ColorLab.ColorSpace colorSpace_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.ColorLab.ColorSpace ColorSpace { + get { return colorSpace_; } + set { + colorSpace_ = value; + } + } + + /// <summary>Field number for the "InputCoordinates" field.</summary> + public const int InputCoordinatesFieldNumber = 5; + private global::Tango.PMR.ColorLab.InputCoordinates inputCoordinates_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.ColorLab.InputCoordinates InputCoordinates { + get { return inputCoordinates_; } + set { + inputCoordinates_ = value; + } + } + + /// <summary>Field number for the "ForwardData" field.</summary> + public const int ForwardDataFieldNumber = 6; + private pb::ByteString forwardData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString ForwardData { + get { return forwardData_; } + set { + forwardData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// <summary>Field number for the "ProcessRanges" field.</summary> + public const int ProcessRangesFieldNumber = 7; + private static readonly pb::FieldCodec<global::Tango.PMR.ColorLab.ProcessRange> _repeated_processRanges_codec + = pb::FieldCodec.ForMessage(58, global::Tango.PMR.ColorLab.ProcessRange.Parser); + private readonly pbc::RepeatedField<global::Tango.PMR.ColorLab.ProcessRange> processRanges_ = new pbc::RepeatedField<global::Tango.PMR.ColorLab.ProcessRange>(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField<global::Tango.PMR.ColorLab.ProcessRange> ProcessRanges { + get { return processRanges_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OutOfGamutInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OutOfGamutInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ThreadL != other.ThreadL) return false; + if (ThreadA != other.ThreadA) return false; + if (ThreadB != other.ThreadB) return false; + if (ColorSpace != other.ColorSpace) return false; + if (!object.Equals(InputCoordinates, other.InputCoordinates)) return false; + if (ForwardData != other.ForwardData) return false; + if(!processRanges_.Equals(other.processRanges_)) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ThreadL != 0D) hash ^= ThreadL.GetHashCode(); + if (ThreadA != 0D) hash ^= ThreadA.GetHashCode(); + if (ThreadB != 0D) hash ^= ThreadB.GetHashCode(); + if (ColorSpace != 0) hash ^= ColorSpace.GetHashCode(); + if (inputCoordinates_ != null) hash ^= InputCoordinates.GetHashCode(); + if (ForwardData.Length != 0) hash ^= ForwardData.GetHashCode(); + hash ^= processRanges_.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ThreadL != 0D) { + output.WriteRawTag(9); + output.WriteDouble(ThreadL); + } + if (ThreadA != 0D) { + output.WriteRawTag(17); + output.WriteDouble(ThreadA); + } + if (ThreadB != 0D) { + output.WriteRawTag(25); + output.WriteDouble(ThreadB); + } + if (ColorSpace != 0) { + output.WriteRawTag(32); + output.WriteEnum((int) ColorSpace); + } + if (inputCoordinates_ != null) { + output.WriteRawTag(42); + output.WriteMessage(InputCoordinates); + } + if (ForwardData.Length != 0) { + output.WriteRawTag(50); + output.WriteBytes(ForwardData); + } + processRanges_.WriteTo(output, _repeated_processRanges_codec); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ThreadL != 0D) { + size += 1 + 8; + } + if (ThreadA != 0D) { + size += 1 + 8; + } + if (ThreadB != 0D) { + size += 1 + 8; + } + if (ColorSpace != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ColorSpace); + } + if (inputCoordinates_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(InputCoordinates); + } + if (ForwardData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(ForwardData); + } + size += processRanges_.CalculateSize(_repeated_processRanges_codec); + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OutOfGamutInput other) { + if (other == null) { + return; + } + if (other.ThreadL != 0D) { + ThreadL = other.ThreadL; + } + if (other.ThreadA != 0D) { + ThreadA = other.ThreadA; + } + if (other.ThreadB != 0D) { + ThreadB = other.ThreadB; + } + if (other.ColorSpace != 0) { + ColorSpace = other.ColorSpace; + } + if (other.inputCoordinates_ != null) { + if (inputCoordinates_ == null) { + inputCoordinates_ = new global::Tango.PMR.ColorLab.InputCoordinates(); + } + InputCoordinates.MergeFrom(other.InputCoordinates); + } + if (other.ForwardData.Length != 0) { + ForwardData = other.ForwardData; + } + processRanges_.Add(other.processRanges_); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 9: { + ThreadL = input.ReadDouble(); + break; + } + case 17: { + ThreadA = input.ReadDouble(); + break; + } + case 25: { + ThreadB = input.ReadDouble(); + break; + } + case 32: { + colorSpace_ = (global::Tango.PMR.ColorLab.ColorSpace) input.ReadEnum(); + break; + } + case 42: { + if (inputCoordinates_ == null) { + inputCoordinates_ = new global::Tango.PMR.ColorLab.InputCoordinates(); + } + input.ReadMessage(inputCoordinates_); + break; + } + case 50: { + ForwardData = input.ReadBytes(); + break; + } + case 58: { + processRanges_.AddEntriesFrom(input, _repeated_processRanges_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/ColorLab/OutOfGamutOutput.cs b/Software/Visual_Studio/Tango.PMR/ColorLab/OutOfGamutOutput.cs new file mode 100644 index 000000000..dcdc38662 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/ColorLab/OutOfGamutOutput.cs @@ -0,0 +1,216 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: OutOfGamutOutput.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.ColorLab { + + /// <summary>Holder for reflection information generated from OutOfGamutOutput.proto</summary> + public static partial class OutOfGamutOutputReflection { + + #region Descriptor + /// <summary>File descriptor for OutOfGamutOutput.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static OutOfGamutOutputReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChZPdXRPZkdhbXV0T3V0cHV0LnByb3RvEhJUYW5nby5QTVIuQ29sb3JMYWIi", + "TgoQT3V0T2ZHYW11dE91dHB1dBISCgpPdXRPZkdhbXV0GAEgASgIEhAKCEhh", + "c0Vycm9yGAIgASgIEhQKDEVycm9yTWVzc2FnZRgDIAEoCUIeChxjb20udHdp", + "bmUudGFuZ28ucG1yLmNvbG9ybGFiYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.ColorLab.OutOfGamutOutput), global::Tango.PMR.ColorLab.OutOfGamutOutput.Parser, new[]{ "OutOfGamut", "HasError", "ErrorMessage" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class OutOfGamutOutput : pb::IMessage<OutOfGamutOutput> { + private static readonly pb::MessageParser<OutOfGamutOutput> _parser = new pb::MessageParser<OutOfGamutOutput>(() => new OutOfGamutOutput()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<OutOfGamutOutput> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.ColorLab.OutOfGamutOutputReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutOfGamutOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutOfGamutOutput(OutOfGamutOutput other) : this() { + outOfGamut_ = other.outOfGamut_; + hasError_ = other.hasError_; + errorMessage_ = other.errorMessage_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutOfGamutOutput Clone() { + return new OutOfGamutOutput(this); + } + + /// <summary>Field number for the "OutOfGamut" field.</summary> + public const int OutOfGamutFieldNumber = 1; + private bool outOfGamut_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool OutOfGamut { + get { return outOfGamut_; } + set { + outOfGamut_ = value; + } + } + + /// <summary>Field number for the "HasError" field.</summary> + public const int HasErrorFieldNumber = 2; + private bool hasError_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool HasError { + get { return hasError_; } + set { + hasError_ = value; + } + } + + /// <summary>Field number for the "ErrorMessage" field.</summary> + public const int ErrorMessageFieldNumber = 3; + private string errorMessage_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ErrorMessage { + get { return errorMessage_; } + set { + errorMessage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OutOfGamutOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OutOfGamutOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OutOfGamut != other.OutOfGamut) return false; + if (HasError != other.HasError) return false; + if (ErrorMessage != other.ErrorMessage) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (OutOfGamut != false) hash ^= OutOfGamut.GetHashCode(); + if (HasError != false) hash ^= HasError.GetHashCode(); + if (ErrorMessage.Length != 0) hash ^= ErrorMessage.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (OutOfGamut != false) { + output.WriteRawTag(8); + output.WriteBool(OutOfGamut); + } + if (HasError != false) { + output.WriteRawTag(16); + output.WriteBool(HasError); + } + if (ErrorMessage.Length != 0) { + output.WriteRawTag(26); + output.WriteString(ErrorMessage); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (OutOfGamut != false) { + size += 1 + 1; + } + if (HasError != false) { + size += 1 + 1; + } + if (ErrorMessage.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ErrorMessage); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OutOfGamutOutput other) { + if (other == null) { + return; + } + if (other.OutOfGamut != false) { + OutOfGamut = other.OutOfGamut; + } + if (other.HasError != false) { + HasError = other.HasError; + } + if (other.ErrorMessage.Length != 0) { + ErrorMessage = other.ErrorMessage; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + OutOfGamut = input.ReadBool(); + break; + } + case 16: { + HasError = input.ReadBool(); + break; + } + case 26: { + ErrorMessage = input.ReadString(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/ColorLab/RecommendedProcessTableInput.cs b/Software/Visual_Studio/Tango.PMR/ColorLab/RecommendedProcessTableInput.cs new file mode 100644 index 000000000..7f51ea62c --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/ColorLab/RecommendedProcessTableInput.cs @@ -0,0 +1,339 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: RecommendedProcessTableInput.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.ColorLab { + + /// <summary>Holder for reflection information generated from RecommendedProcessTableInput.proto</summary> + public static partial class RecommendedProcessTableInputReflection { + + #region Descriptor + /// <summary>File descriptor for RecommendedProcessTableInput.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RecommendedProcessTableInputReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiJSZWNvbW1lbmRlZFByb2Nlc3NUYWJsZUlucHV0LnByb3RvEhJUYW5nby5Q", + "TVIuQ29sb3JMYWIaElByb2Nlc3NSYW5nZS5wcm90bxoRSW5wdXRMaXF1aWQu", + "cHJvdG8aF0dyYWRpZW50SW5wdXRTdG9wLnByb3RvIqICChxSZWNvbW1lbmRl", + "ZFByb2Nlc3NUYWJsZUlucHV0Eg8KB1RocmVhZEwYASABKAESDwoHVGhyZWFk", + "QRgCIAEoARIPCgdUaHJlYWRCGAMgASgBEhMKC0ZvcndhcmREYXRhGAQgASgM", + "EjQKBVN0b3BzGAUgAygLMiUuVGFuZ28uUE1SLkNvbG9yTGFiLkdyYWRpZW50", + "SW5wdXRTdG9wEjUKDElucHV0TGlxdWlkcxgGIAMoCzIfLlRhbmdvLlBNUi5D", + "b2xvckxhYi5JbnB1dExpcXVpZBI3Cg1Qcm9jZXNzUmFuZ2VzGAcgAygLMiAu", + "VGFuZ28uUE1SLkNvbG9yTGFiLlByb2Nlc3NSYW5nZRIUCgxVc2VMaWdodElu", + "a3MYCCABKAhCHgocY29tLnR3aW5lLnRhbmdvLnBtci5jb2xvcmxhYmIGcHJv", + "dG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.ColorLab.ProcessRangeReflection.Descriptor, global::Tango.PMR.ColorLab.InputLiquidReflection.Descriptor, global::Tango.PMR.ColorLab.GradientInputStopReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.ColorLab.RecommendedProcessTableInput), global::Tango.PMR.ColorLab.RecommendedProcessTableInput.Parser, new[]{ "ThreadL", "ThreadA", "ThreadB", "ForwardData", "Stops", "InputLiquids", "ProcessRanges", "UseLightInks" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class RecommendedProcessTableInput : pb::IMessage<RecommendedProcessTableInput> { + private static readonly pb::MessageParser<RecommendedProcessTableInput> _parser = new pb::MessageParser<RecommendedProcessTableInput>(() => new RecommendedProcessTableInput()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<RecommendedProcessTableInput> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.ColorLab.RecommendedProcessTableInputReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RecommendedProcessTableInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RecommendedProcessTableInput(RecommendedProcessTableInput other) : this() { + threadL_ = other.threadL_; + threadA_ = other.threadA_; + threadB_ = other.threadB_; + forwardData_ = other.forwardData_; + stops_ = other.stops_.Clone(); + inputLiquids_ = other.inputLiquids_.Clone(); + processRanges_ = other.processRanges_.Clone(); + useLightInks_ = other.useLightInks_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RecommendedProcessTableInput Clone() { + return new RecommendedProcessTableInput(this); + } + + /// <summary>Field number for the "ThreadL" field.</summary> + public const int ThreadLFieldNumber = 1; + private double threadL_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ThreadL { + get { return threadL_; } + set { + threadL_ = value; + } + } + + /// <summary>Field number for the "ThreadA" field.</summary> + public const int ThreadAFieldNumber = 2; + private double threadA_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ThreadA { + get { return threadA_; } + set { + threadA_ = value; + } + } + + /// <summary>Field number for the "ThreadB" field.</summary> + public const int ThreadBFieldNumber = 3; + private double threadB_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ThreadB { + get { return threadB_; } + set { + threadB_ = value; + } + } + + /// <summary>Field number for the "ForwardData" field.</summary> + public const int ForwardDataFieldNumber = 4; + private pb::ByteString forwardData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString ForwardData { + get { return forwardData_; } + set { + forwardData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// <summary>Field number for the "Stops" field.</summary> + public const int StopsFieldNumber = 5; + private static readonly pb::FieldCodec<global::Tango.PMR.ColorLab.GradientInputStop> _repeated_stops_codec + = pb::FieldCodec.ForMessage(42, global::Tango.PMR.ColorLab.GradientInputStop.Parser); + private readonly pbc::RepeatedField<global::Tango.PMR.ColorLab.GradientInputStop> stops_ = new pbc::RepeatedField<global::Tango.PMR.ColorLab.GradientInputStop>(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField<global::Tango.PMR.ColorLab.GradientInputStop> Stops { + get { return stops_; } + } + + /// <summary>Field number for the "InputLiquids" field.</summary> + public const int InputLiquidsFieldNumber = 6; + private static readonly pb::FieldCodec<global::Tango.PMR.ColorLab.InputLiquid> _repeated_inputLiquids_codec + = pb::FieldCodec.ForMessage(50, global::Tango.PMR.ColorLab.InputLiquid.Parser); + private readonly pbc::RepeatedField<global::Tango.PMR.ColorLab.InputLiquid> inputLiquids_ = new pbc::RepeatedField<global::Tango.PMR.ColorLab.InputLiquid>(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField<global::Tango.PMR.ColorLab.InputLiquid> InputLiquids { + get { return inputLiquids_; } + } + + /// <summary>Field number for the "ProcessRanges" field.</summary> + public const int ProcessRangesFieldNumber = 7; + private static readonly pb::FieldCodec<global::Tango.PMR.ColorLab.ProcessRange> _repeated_processRanges_codec + = pb::FieldCodec.ForMessage(58, global::Tango.PMR.ColorLab.ProcessRange.Parser); + private readonly pbc::RepeatedField<global::Tango.PMR.ColorLab.ProcessRange> processRanges_ = new pbc::RepeatedField<global::Tango.PMR.ColorLab.ProcessRange>(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField<global::Tango.PMR.ColorLab.ProcessRange> ProcessRanges { + get { return processRanges_; } + } + + /// <summary>Field number for the "UseLightInks" field.</summary> + public const int UseLightInksFieldNumber = 8; + private bool useLightInks_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool UseLightInks { + get { return useLightInks_; } + set { + useLightInks_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RecommendedProcessTableInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RecommendedProcessTableInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ThreadL != other.ThreadL) return false; + if (ThreadA != other.ThreadA) return false; + if (ThreadB != other.ThreadB) return false; + if (ForwardData != other.ForwardData) return false; + if(!stops_.Equals(other.stops_)) return false; + if(!inputLiquids_.Equals(other.inputLiquids_)) return false; + if(!processRanges_.Equals(other.processRanges_)) return false; + if (UseLightInks != other.UseLightInks) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ThreadL != 0D) hash ^= ThreadL.GetHashCode(); + if (ThreadA != 0D) hash ^= ThreadA.GetHashCode(); + if (ThreadB != 0D) hash ^= ThreadB.GetHashCode(); + if (ForwardData.Length != 0) hash ^= ForwardData.GetHashCode(); + hash ^= stops_.GetHashCode(); + hash ^= inputLiquids_.GetHashCode(); + hash ^= processRanges_.GetHashCode(); + if (UseLightInks != false) hash ^= UseLightInks.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ThreadL != 0D) { + output.WriteRawTag(9); + output.WriteDouble(ThreadL); + } + if (ThreadA != 0D) { + output.WriteRawTag(17); + output.WriteDouble(ThreadA); + } + if (ThreadB != 0D) { + output.WriteRawTag(25); + output.WriteDouble(ThreadB); + } + if (ForwardData.Length != 0) { + output.WriteRawTag(34); + output.WriteBytes(ForwardData); + } + stops_.WriteTo(output, _repeated_stops_codec); + inputLiquids_.WriteTo(output, _repeated_inputLiquids_codec); + processRanges_.WriteTo(output, _repeated_processRanges_codec); + if (UseLightInks != false) { + output.WriteRawTag(64); + output.WriteBool(UseLightInks); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ThreadL != 0D) { + size += 1 + 8; + } + if (ThreadA != 0D) { + size += 1 + 8; + } + if (ThreadB != 0D) { + size += 1 + 8; + } + if (ForwardData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(ForwardData); + } + size += stops_.CalculateSize(_repeated_stops_codec); + size += inputLiquids_.CalculateSize(_repeated_inputLiquids_codec); + size += processRanges_.CalculateSize(_repeated_processRanges_codec); + if (UseLightInks != false) { + size += 1 + 1; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RecommendedProcessTableInput other) { + if (other == null) { + return; + } + if (other.ThreadL != 0D) { + ThreadL = other.ThreadL; + } + if (other.ThreadA != 0D) { + ThreadA = other.ThreadA; + } + if (other.ThreadB != 0D) { + ThreadB = other.ThreadB; + } + if (other.ForwardData.Length != 0) { + ForwardData = other.ForwardData; + } + stops_.Add(other.stops_); + inputLiquids_.Add(other.inputLiquids_); + processRanges_.Add(other.processRanges_); + if (other.UseLightInks != false) { + UseLightInks = other.UseLightInks; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 9: { + ThreadL = input.ReadDouble(); + break; + } + case 17: { + ThreadA = input.ReadDouble(); + break; + } + case 25: { + ThreadB = input.ReadDouble(); + break; + } + case 34: { + ForwardData = input.ReadBytes(); + break; + } + case 42: { + stops_.AddEntriesFrom(input, _repeated_stops_codec); + break; + } + case 50: { + inputLiquids_.AddEntriesFrom(input, _repeated_inputLiquids_codec); + break; + } + case 58: { + processRanges_.AddEntriesFrom(input, _repeated_processRanges_codec); + break; + } + case 64: { + UseLightInks = input.ReadBool(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/ColorLab/RecommendedProcessTableOutput.cs b/Software/Visual_Studio/Tango.PMR/ColorLab/RecommendedProcessTableOutput.cs new file mode 100644 index 000000000..37adf1717 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/ColorLab/RecommendedProcessTableOutput.cs @@ -0,0 +1,217 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: RecommendedProcessTableOutput.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.ColorLab { + + /// <summary>Holder for reflection information generated from RecommendedProcessTableOutput.proto</summary> + public static partial class RecommendedProcessTableOutputReflection { + + #region Descriptor + /// <summary>File descriptor for RecommendedProcessTableOutput.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RecommendedProcessTableOutputReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiNSZWNvbW1lbmRlZFByb2Nlc3NUYWJsZU91dHB1dC5wcm90bxISVGFuZ28u", + "UE1SLkNvbG9yTGFiImwKHVJlY29tbWVuZGVkUHJvY2Vzc1RhYmxlT3V0cHV0", + "EiMKG1Byb2Nlc3NQYXJhbWV0ZXJzVGFibGVJbmRleBgBIAEoBRIQCghIYXNF", + "cnJvchgCIAEoCBIUCgxFcnJvck1lc3NhZ2UYAyABKAlCHgocY29tLnR3aW5l", + "LnRhbmdvLnBtci5jb2xvcmxhYmIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.ColorLab.RecommendedProcessTableOutput), global::Tango.PMR.ColorLab.RecommendedProcessTableOutput.Parser, new[]{ "ProcessParametersTableIndex", "HasError", "ErrorMessage" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class RecommendedProcessTableOutput : pb::IMessage<RecommendedProcessTableOutput> { + private static readonly pb::MessageParser<RecommendedProcessTableOutput> _parser = new pb::MessageParser<RecommendedProcessTableOutput>(() => new RecommendedProcessTableOutput()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<RecommendedProcessTableOutput> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.ColorLab.RecommendedProcessTableOutputReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RecommendedProcessTableOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RecommendedProcessTableOutput(RecommendedProcessTableOutput other) : this() { + processParametersTableIndex_ = other.processParametersTableIndex_; + hasError_ = other.hasError_; + errorMessage_ = other.errorMessage_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RecommendedProcessTableOutput Clone() { + return new RecommendedProcessTableOutput(this); + } + + /// <summary>Field number for the "ProcessParametersTableIndex" field.</summary> + public const int ProcessParametersTableIndexFieldNumber = 1; + private int processParametersTableIndex_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ProcessParametersTableIndex { + get { return processParametersTableIndex_; } + set { + processParametersTableIndex_ = value; + } + } + + /// <summary>Field number for the "HasError" field.</summary> + public const int HasErrorFieldNumber = 2; + private bool hasError_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool HasError { + get { return hasError_; } + set { + hasError_ = value; + } + } + + /// <summary>Field number for the "ErrorMessage" field.</summary> + public const int ErrorMessageFieldNumber = 3; + private string errorMessage_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ErrorMessage { + get { return errorMessage_; } + set { + errorMessage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RecommendedProcessTableOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RecommendedProcessTableOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ProcessParametersTableIndex != other.ProcessParametersTableIndex) return false; + if (HasError != other.HasError) return false; + if (ErrorMessage != other.ErrorMessage) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ProcessParametersTableIndex != 0) hash ^= ProcessParametersTableIndex.GetHashCode(); + if (HasError != false) hash ^= HasError.GetHashCode(); + if (ErrorMessage.Length != 0) hash ^= ErrorMessage.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ProcessParametersTableIndex != 0) { + output.WriteRawTag(8); + output.WriteInt32(ProcessParametersTableIndex); + } + if (HasError != false) { + output.WriteRawTag(16); + output.WriteBool(HasError); + } + if (ErrorMessage.Length != 0) { + output.WriteRawTag(26); + output.WriteString(ErrorMessage); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ProcessParametersTableIndex != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ProcessParametersTableIndex); + } + if (HasError != false) { + size += 1 + 1; + } + if (ErrorMessage.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ErrorMessage); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RecommendedProcessTableOutput other) { + if (other == null) { + return; + } + if (other.ProcessParametersTableIndex != 0) { + ProcessParametersTableIndex = other.ProcessParametersTableIndex; + } + if (other.HasError != false) { + HasError = other.HasError; + } + if (other.ErrorMessage.Length != 0) { + ErrorMessage = other.ErrorMessage; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + ProcessParametersTableIndex = input.ReadInt32(); + break; + } + case 16: { + HasError = input.ReadBool(); + break; + } + case 26: { + ErrorMessage = input.ReadString(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index 2284a2914..72418fe91 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -67,9 +67,13 @@ <Compile Include="ColorLab\LinearizationOutput.cs" /> <Compile Include="ColorLab\LiquidType.cs" /> <Compile Include="ColorLab\LiquidVolume.cs" /> + <Compile Include="ColorLab\OutOfGamutInput.cs" /> + <Compile Include="ColorLab\OutOfGamutOutput.cs" /> <Compile Include="ColorLab\OutputCoordinates.cs" /> <Compile Include="ColorLab\OutputLiquid.cs" /> <Compile Include="ColorLab\ProcessRange.cs" /> + <Compile Include="ColorLab\RecommendedProcessTableInput.cs" /> + <Compile Include="ColorLab\RecommendedProcessTableOutput.cs" /> <Compile Include="Common\ErrorResponse.cs" /> <Compile Include="Connection\ConnectRequest.cs" /> <Compile Include="Connection\ConnectResponse.cs" /> @@ -489,7 +493,7 @@ </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index c2bb2f26b..6aadebf7f 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -463,6 +463,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.CsvToJobTester.CLI", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.ColorLib.LightInksTest.CLI", "Tango.ColorLib.LightInksTest.CLI\Tango.ColorLib.LightInksTest.CLI.csproj", "{70DD08CA-3BD1-43D6-84FF-2DB8A192C315}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.ColorLib.OutOfGamutTest.CLI", "Tango.ColorLib.OutOfGamutTest.CLI\Tango.ColorLib.OutOfGamutTest.CLI.csproj", "{6B13E186-ADE2-4D97-9643-8132E00FC207}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -4398,6 +4400,26 @@ Global {70DD08CA-3BD1-43D6-84FF-2DB8A192C315}.Release|x64.Build.0 = Release|Any CPU {70DD08CA-3BD1-43D6-84FF-2DB8A192C315}.Release|x86.ActiveCfg = Release|Any CPU {70DD08CA-3BD1-43D6-84FF-2DB8A192C315}.Release|x86.Build.0 = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|ARM.ActiveCfg = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|ARM.Build.0 = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|ARM64.Build.0 = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|x64.ActiveCfg = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|x64.Build.0 = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|x86.ActiveCfg = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Debug|x86.Build.0 = Debug|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|Any CPU.Build.0 = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|ARM.ActiveCfg = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|ARM.Build.0 = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|ARM64.ActiveCfg = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|ARM64.Build.0 = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|x64.ActiveCfg = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|x64.Build.0 = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|x86.ActiveCfg = Release|Any CPU + {6B13E186-ADE2-4D97-9643-8132E00FC207}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4561,6 +4583,7 @@ Global {8F0BCFC8-AF0F-40D3-882A-902CD221A6DE} = {4A8BD6EC-41CF-46A9-B2CD-9D0DF6465963} {4747A2DE-F419-41B1-95A7-E9FBB4EA0B3B} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} {70DD08CA-3BD1-43D6-84FF-2DB8A192C315} = {8336A702-9C49-4C9E-ADCC-1886A666D3BD} + {6B13E186-ADE2-4D97-9643-8132E00FC207} = {8336A702-9C49-4C9E-ADCC-1886A666D3BD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution BuildVersion_UseGlobalSettings = False |
