aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Native
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-03-24 15:24:21 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-03-24 15:24:21 +0200
commit0aafe6fb38d19e8474483c4b8a28ce645c53045f (patch)
tree83c34048b288adf6a2375297e56cabe5a4466c77 /Software/Visual_Studio/Native
parentdb9308c46379fb324678ba04771dbee4edae4b17 (diff)
downloadTango-0aafe6fb38d19e8474483c4b8a28ce645c53045f.tar.gz
Tango-0aafe6fb38d19e8474483c4b8a28ce645c53045f.zip
WOrking on android.
some fixes to machine studio.
Diffstat (limited to 'Software/Visual_Studio/Native')
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp526
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.h2
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp6
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionInput.pb-c.c209
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionInput.pb-c.h93
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionOutput.pb-c.c118
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionOutput.pb-c.h76
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputRGB.pb-c.c118
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputRGB.pb-c.h76
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj6
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters18
11 files changed, 1046 insertions, 202 deletions
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp
index d08e851c0..1ede4a356 100644
--- a/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp
@@ -9,6 +9,9 @@
#include "OutputLiquid.pb-c.h"
#include "InputLiquid.pb-c.h"
#include "LiquidType.pb-c.h"
+#include "GradientConversionInput.pb-c.h"
+#include "GradientConversionOutput.pb-c.h"
+#include "InputRGB.pb-c.h"
#include <iostream>
#include <stdio.h>
#include "Dense"
@@ -390,7 +393,6 @@ void Tango::ColorLib::ColorConverter::fillRGB(OutputCoordinates *outputCoords, V
outputCoords->blue = (int32_t)std::round(RGBOut(2));
}
-
void Tango::ColorLib::ColorConverter::readColorTransformations(ConversionInput* conversionInput)
{
//Read thread white. Thread White is given in CIELab Space
@@ -596,7 +598,6 @@ void Tango::ColorLib::ColorConverter::readCalibrationTables(ConversionInput* con
return;
}
-
void Tango::ColorLib::ColorConverter::SetCalibData(CalibrationData *calibrationData, int i, CalibData *tmpCurve)
{
if (calibrationData->calibrationpoints <= 0)
@@ -1216,202 +1217,7 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i
conversionInput = conversion_input__unpack(NULL, input_buffer_size, input_buffer);
-
- //Filter and arrange colors (Should change from 3 to 4 if black ink is included)
-
- int numofInks = CountNumberofInks(conversionInput);
- if (numofInks < 0)
- throw std::exception("Duplicate inks");
- int expected_liquids = numofInks;
- original_input_liquids_count = conversionInput->inputcoordinates->n_inputliquids;
- original_input_liquids = conversionInput->inputcoordinates->inputliquids;
-
- InputLiquid** filteredInputLiquids = (InputLiquid**)malloc(sizeof(InputLiquid*) * expected_liquids);
-
- for (size_t i = 0; i < conversionInput->inputcoordinates->n_inputliquids; i++)
- {
- InputLiquid* liquid = conversionInput->inputcoordinates->inputliquids[i];
-
- switch (liquid->liquidtype)
- {
- case LIQUID_TYPE__Cyan:
- filteredInputLiquids[0] = liquid;
- break;
- case LIQUID_TYPE__Magenta:
- filteredInputLiquids[1] = liquid;
- break;
- case LIQUID_TYPE__Yellow:
- filteredInputLiquids[2] = liquid;
- break;
- case LIQUID_TYPE__Black:
- filteredInputLiquids[3] = liquid;
- break;
- }
- }
-
- conversionInput->inputcoordinates->inputliquids = filteredInputLiquids;
- conversionInput->inputcoordinates->n_inputliquids = expected_liquids;
- //Filter and arrange colors
-
-
-
- //Initialize Output...
- ConversionOutput *conversionOutput = (ConversionOutput*)malloc(sizeof(ConversionOutput));
- conversion_output__init(conversionOutput);
- // ConversionOutput conversionOutput = CONVERSION_OUTPUT__INIT;
-
-
- size_t n_elements = 0;
- bool InGamut = false;
- m_WP.Set(0.9505, 1.00, 1.0888); //D65
- //count number if inks
- // int numofInks = CountNumberofInks(conversionInput);
- readColorTransformations(conversionInput);
-
- //read calibration tables and store them in m_CalibCurves
-
- readCalibrationTables(conversionInput);
- m_LinInterp = new Interp[numofInks];
- //m_LinInterp = DBG_NEW Interp[numofInks];
- m_InvLinInterp = new Interp[numofInks];
- //m_InvLinInterp = DBG_NEW Interp[numofInks];
- InitInterpolations(numofInks, m_LinInterp, m_InvLinInterp);
-
- //Initialize CIECAM02 transformation
- Illum IL = D65;
- SURROUND sur = average;
- CAM02CS CS = UCS;
- 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);
- SetnA2BnSepIn(m_A2BTransform->GetSeparationsIn());
- SetnA2BnSepOut(m_A2BTransform->GetSeparationsOut());
- SetnB2AnSepIn(m_B2ATransform->GetSeparationsIn());
- SetnB2AnSepOut(m_B2ATransform->GetSeparationsOut());
-
- SetNumberOfInks(m_nB2AnSepOut);
- // Compare Strip White point to Color Table White Point
- CompareWhitePoints();
-
- if (numofInks != m_nB2AnSepOut)
- throw std::exception("Number of available inks does not match ink tables");
-
- VectorXd InkOut(m_nB2AnSepOut);
- VectorXd RGBOut(3);
- VectorXd LabOut(3);
- VectorXd NLInkOut(m_nB2AnSepOut);
- VectorXd Volume(m_nB2AnSepOut);
- //set maxNlPerCM
- VectorXd NlperCM(m_nB2AnSepOut);
- NlperCM.setZero();
- m_maxNlPerCM = NlperCM;
- for (int i = 0; i < m_nB2AnSepOut; ++i)
- SetMaxNLperCM(conversionInput->inputcoordinates->inputliquids[i]->maxnanoliterpercentimeter, i);
- m_nVolumes = m_nB2AnSepOut;
- int GamutRegion = 0;
- //Convert input data to linear inks
- if (conversionInput->colorspace == COLOR_SPACE__Volume)
- {
- ConvertVolumeToRGBDisplay(conversionInput, Volume, RGBOut, LabOut, GamutRegion);
- InGamut = true;
- }
- else
- {
- ConvertColorToLinearInks(conversionInput, InkOut, RGBOut, LabOut, GamutRegion, InGamut);
- //Convert to Nonlinear Inks
- ConvertToNLInks(InkOut, NLInkOut);
- //Convert to [nl/cm]
- NLInkPToVolume(NLInkOut, Volume);
- //OutputCoordinates outputCoords = OUTPUT_COORDINATES__INIT;
- }
- OutputCoordinates *outputCoords = (OutputCoordinates*)malloc(sizeof(OutputCoordinates));
- output_coordinates__init(outputCoords);
- fillRGB(outputCoords, RGBOut);
- fillVolume(outputCoords, Volume);
- conversionOutput->has_outofgamut = true;
- conversionOutput->outofgamut = !(InGamut);
- conversionOutput->singlecoordinates = outputCoords;
-
-
- if (!conversionInput->singlemode) //Skip if input requests single result only.
- {
- //input was processed.
- //process neighboring values
- //nhive includes 2 outer neighbors of the central Lab value, chroma + delta, chroma + 2delta
- // and variation in L positioned on the side of the beehive.
- //The set is arrange in a 5x6 matrix, where the 5x5 contains the variation in (Hue, chroma)
- // and the last 5 contain the variation in L
- int nHive = 18; //22; // 18;
- int MatHive = 25;// 30; //25;
-
- MatrixXd RGBHive(MatHive, 3);
- VectorXd RGBHive1(3);
- VectorXd VolumeHive1(m_nVolumes);
- MatrixXd VolumeHive(MatHive, m_nVolumes);
- int *GamutRegionV = new int[MatHive];
- //int *GamutRegionV = DBG_NEW int[MatHive];
- for (int i = 0; i < MatHive; ++i)
- GamutRegionV[i] = -1;
-
- int indDataMax[2];
- int j = 0;
- // Matrix values are initially set to -1;
- RGBHive.setConstant(NegValue);
- VolumeHive.setConstant(NegValue);
-
- ProcessHiveNeighbors(LabOut, RGBOut, Volume, GamutRegion, RGBHive, VolumeHive, nHive, GamutRegionV, indDataMax);
- OutputCoordinates** hiveData = (OutputCoordinates**)malloc(sizeof(OutputCoordinates*) * MatHive);
- conversionOutput->hivecoordinates = hiveData;
- conversionOutput->n_hivecoordinates = MatHive;
- conversionOutput->n_triplecoordinates = 3;
- for (int i = 0; i < MatHive; i++)
- {
- // OutputCoordinates SingleCell = OUTPUT_COORDINATES__INIT;
- hiveData[i] = (OutputCoordinates*)malloc(sizeof(OutputCoordinates));
- output_coordinates__init(hiveData[i]);
- if (RGBHive(i, 0) != NegValue)
- {
- for (j = 0; j < 3; ++j)
- RGBHive1(j) = RGBHive(i, j);
- fillRGB(hiveData[i], RGBHive1);
- for (j = 0; j < m_nVolumes; ++j)
- VolumeHive1(j) = VolumeHive(i, j);
- fillVolume(hiveData[i], VolumeHive1);
- hiveData[i]->has_processparameterstableindex = true;
- hiveData[i]->processparameterstableindex = GamutRegionV[i];
- hiveData[i]->n_outputliquids = m_nInks;
- }
- conversionOutput->hivecoordinates[i] = hiveData[i];
- }
-
-
- //Triplet
- OutputCoordinates** TripletData = (OutputCoordinates**)malloc(sizeof(OutputCoordinates*) * 3);
- conversionOutput->triplecoordinates = TripletData;
- int tripletIndex[3] = { indDataMax[0] , (int)(12), indDataMax[1] };
- for (int i = 0; i < 3; ++i)
- {
- // OutputCoordinates SingleCell = OUTPUT_COORDINATES__INIT;
- TripletData[i] = (OutputCoordinates*)malloc(sizeof(OutputCoordinates));
- output_coordinates__init(TripletData[i]);
- for (j = 0; j < 3; ++j)
- RGBHive1(j) = RGBHive(tripletIndex[i], j);
- fillRGB(TripletData[i], RGBHive1);
- for (j = 0; j < m_nVolumes; ++j)
- VolumeHive1(j) = VolumeHive(tripletIndex[i], j);
- fillVolume(TripletData[i], VolumeHive1);
- TripletData[i]->has_processparameterstableindex = true;
- TripletData[i]->processparameterstableindex = GamutRegionV[tripletIndex[i]];
- TripletData[i]->n_outputliquids = m_nInks;
- conversionOutput->triplecoordinates[i] = TripletData[i];
- }
-
- //Clean up
- if (GamutRegionV != NULL)
- {
- delete[] GamutRegionV;
- GamutRegionV = NULL;
- }
- }
+ ConversionOutput* conversionOutput = ConvertInternal(conversionInput);
//Pack output...
output_buffer = (uint8_t*)malloc(conversion_output__get_packed_size(conversionOutput));
@@ -1580,7 +1386,6 @@ bool Tango::ColorLib::ColorConverter::IsInGamut(double *InLab, SURROUND sur)
return(InGamut);
}
-
Tango::CT_Header Tango::ColorLib::ColorConverter::read_header(ConversionInput* conversionInput, int &bytesread)
{
//CT_Header *Header = new CT_Header;
@@ -1771,7 +1576,6 @@ void Tango::ColorLib::ColorConverter::read_text_type(int offset, int data_size,
return;
}
-
void Tango::ColorLib::ColorConverter::read_text_description_type(int offset, int data_size, std::string textdescstr,
ConversionInput* conversionInput)
{
@@ -1983,8 +1787,6 @@ void Tango::ColorLib::ColorConverter::CompareWhitePoints()
// return conversion_output__pack(&conversionOutput, output_buffer);
//}
-
-
size_t Tango::ColorLib::ColorConverter::P_IsInGamut(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer)
{
@@ -2204,4 +2006,324 @@ size_t Tango::ColorLib::ColorConverter::P_IsInGamut(uint8_t * input_buffer, size
#pragma endregion
return (size);
+}
+
+ConversionOutput* Tango::ColorLib::ColorConverter::ConvertInternal(ConversionInput* conversionInput)
+{
+ 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 = CountNumberofInks(conversionInput);
+ if (numofInks < 0)
+ throw std::exception("Duplicate inks");
+ int expected_liquids = numofInks;
+ original_input_liquids_count = conversionInput->inputcoordinates->n_inputliquids;
+ original_input_liquids = conversionInput->inputcoordinates->inputliquids;
+
+ InputLiquid** filteredInputLiquids = (InputLiquid**)malloc(sizeof(InputLiquid*) * expected_liquids);
+
+ for (size_t i = 0; i < conversionInput->inputcoordinates->n_inputliquids; i++)
+ {
+ InputLiquid* liquid = conversionInput->inputcoordinates->inputliquids[i];
+
+ switch (liquid->liquidtype)
+ {
+ case LIQUID_TYPE__Cyan:
+ filteredInputLiquids[0] = liquid;
+ break;
+ case LIQUID_TYPE__Magenta:
+ filteredInputLiquids[1] = liquid;
+ break;
+ case LIQUID_TYPE__Yellow:
+ filteredInputLiquids[2] = liquid;
+ break;
+ case LIQUID_TYPE__Black:
+ filteredInputLiquids[3] = liquid;
+ break;
+ }
+ }
+
+ conversionInput->inputcoordinates->inputliquids = filteredInputLiquids;
+ conversionInput->inputcoordinates->n_inputliquids = expected_liquids;
+ //Filter and arrange colors
+
+
+
+ //Initialize Output...
+ ConversionOutput *conversionOutput = (ConversionOutput*)malloc(sizeof(ConversionOutput));
+ conversion_output__init(conversionOutput);
+ // ConversionOutput conversionOutput = CONVERSION_OUTPUT__INIT;
+
+
+ size_t n_elements = 0;
+ bool InGamut = false;
+ m_WP.Set(0.9505, 1.00, 1.0888); //D65
+ //count number if inks
+// int numofInks = CountNumberofInks(conversionInput);
+ readColorTransformations(conversionInput);
+
+ //read calibration tables and store them in m_CalibCurves
+
+ readCalibrationTables(conversionInput);
+ m_LinInterp = new Interp[numofInks];
+ //m_LinInterp = DBG_NEW Interp[numofInks];
+ m_InvLinInterp = new Interp[numofInks];
+ //m_InvLinInterp = DBG_NEW Interp[numofInks];
+ InitInterpolations(numofInks, m_LinInterp, m_InvLinInterp);
+
+ //Initialize CIECAM02 transformation
+ Illum IL = D65;
+ SURROUND sur = average;
+ CAM02CS CS = UCS;
+ 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);
+ SetnA2BnSepIn(m_A2BTransform->GetSeparationsIn());
+ SetnA2BnSepOut(m_A2BTransform->GetSeparationsOut());
+ SetnB2AnSepIn(m_B2ATransform->GetSeparationsIn());
+ SetnB2AnSepOut(m_B2ATransform->GetSeparationsOut());
+
+ SetNumberOfInks(m_nB2AnSepOut);
+ // Compare Strip White point to Color Table White Point
+ CompareWhitePoints();
+
+ if (numofInks != m_nB2AnSepOut)
+ throw std::exception("Number of available inks does not match ink tables");
+
+ VectorXd InkOut(m_nB2AnSepOut);
+ VectorXd RGBOut(3);
+ VectorXd LabOut(3);
+ VectorXd NLInkOut(m_nB2AnSepOut);
+ VectorXd Volume(m_nB2AnSepOut);
+ //set maxNlPerCM
+ VectorXd NlperCM(m_nB2AnSepOut);
+ NlperCM.setZero();
+ m_maxNlPerCM = NlperCM;
+ for (int i = 0; i < m_nB2AnSepOut; ++i)
+ SetMaxNLperCM(conversionInput->inputcoordinates->inputliquids[i]->maxnanoliterpercentimeter, i);
+ m_nVolumes = m_nB2AnSepOut;
+ int GamutRegion = 0;
+ //Convert input data to linear inks
+ if (conversionInput->colorspace == COLOR_SPACE__Volume)
+ {
+ ConvertVolumeToRGBDisplay(conversionInput, Volume, RGBOut, LabOut, GamutRegion);
+ InGamut = true;
+ }
+ else
+ {
+ ConvertColorToLinearInks(conversionInput, InkOut, RGBOut, LabOut, GamutRegion, InGamut);
+ //Convert to Nonlinear Inks
+ ConvertToNLInks(InkOut, NLInkOut);
+ //Convert to [nl/cm]
+ NLInkPToVolume(NLInkOut, Volume);
+ //OutputCoordinates outputCoords = OUTPUT_COORDINATES__INIT;
+ }
+ OutputCoordinates *outputCoords = (OutputCoordinates*)malloc(sizeof(OutputCoordinates));
+ output_coordinates__init(outputCoords);
+ fillRGB(outputCoords, RGBOut);
+ fillVolume(outputCoords, Volume);
+ conversionOutput->has_outofgamut = true;
+ conversionOutput->outofgamut = !(InGamut);
+ conversionOutput->singlecoordinates = outputCoords;
+
+
+ if (!conversionInput->singlemode) //Skip if input requests single result only.
+ {
+ //input was processed.
+ //process neighboring values
+ //nhive includes 2 outer neighbors of the central Lab value, chroma + delta, chroma + 2delta
+ // and variation in L positioned on the side of the beehive.
+ //The set is arrange in a 5x6 matrix, where the 5x5 contains the variation in (Hue, chroma)
+ // and the last 5 contain the variation in L
+ int nHive = 18; //22; // 18;
+ int MatHive = 25;// 30; //25;
+
+ MatrixXd RGBHive(MatHive, 3);
+ VectorXd RGBHive1(3);
+ VectorXd VolumeHive1(m_nVolumes);
+ MatrixXd VolumeHive(MatHive, m_nVolumes);
+ int *GamutRegionV = new int[MatHive];
+ //int *GamutRegionV = DBG_NEW int[MatHive];
+ for (int i = 0; i < MatHive; ++i)
+ GamutRegionV[i] = -1;
+
+ int indDataMax[2];
+ int j = 0;
+ // Matrix values are initially set to -1;
+ RGBHive.setConstant(NegValue);
+ VolumeHive.setConstant(NegValue);
+
+ ProcessHiveNeighbors(LabOut, RGBOut, Volume, GamutRegion, RGBHive, VolumeHive, nHive, GamutRegionV, indDataMax);
+ OutputCoordinates** hiveData = (OutputCoordinates**)malloc(sizeof(OutputCoordinates*) * MatHive);
+ conversionOutput->hivecoordinates = hiveData;
+ conversionOutput->n_hivecoordinates = MatHive;
+ conversionOutput->n_triplecoordinates = 3;
+ for (int i = 0; i < MatHive; i++)
+ {
+ // OutputCoordinates SingleCell = OUTPUT_COORDINATES__INIT;
+ hiveData[i] = (OutputCoordinates*)malloc(sizeof(OutputCoordinates));
+ output_coordinates__init(hiveData[i]);
+ if (RGBHive(i, 0) != NegValue)
+ {
+ for (j = 0; j < 3; ++j)
+ RGBHive1(j) = RGBHive(i, j);
+ fillRGB(hiveData[i], RGBHive1);
+ for (j = 0; j < m_nVolumes; ++j)
+ VolumeHive1(j) = VolumeHive(i, j);
+ fillVolume(hiveData[i], VolumeHive1);
+ hiveData[i]->has_processparameterstableindex = true;
+ hiveData[i]->processparameterstableindex = GamutRegionV[i];
+ hiveData[i]->n_outputliquids = m_nInks;
+ }
+ conversionOutput->hivecoordinates[i] = hiveData[i];
+ }
+
+
+ //Triplet
+ OutputCoordinates** TripletData = (OutputCoordinates**)malloc(sizeof(OutputCoordinates*) * 3);
+ conversionOutput->triplecoordinates = TripletData;
+ int tripletIndex[3] = { indDataMax[0] , (int)(12), indDataMax[1] };
+ for (int i = 0; i < 3; ++i)
+ {
+ // OutputCoordinates SingleCell = OUTPUT_COORDINATES__INIT;
+ TripletData[i] = (OutputCoordinates*)malloc(sizeof(OutputCoordinates));
+ output_coordinates__init(TripletData[i]);
+ for (j = 0; j < 3; ++j)
+ RGBHive1(j) = RGBHive(tripletIndex[i], j);
+ fillRGB(TripletData[i], RGBHive1);
+ for (j = 0; j < m_nVolumes; ++j)
+ VolumeHive1(j) = VolumeHive(tripletIndex[i], j);
+ fillVolume(TripletData[i], VolumeHive1);
+ TripletData[i]->has_processparameterstableindex = true;
+ TripletData[i]->processparameterstableindex = GamutRegionV[tripletIndex[i]];
+ TripletData[i]->n_outputliquids = m_nInks;
+ conversionOutput->triplecoordinates[i] = TripletData[i];
+ }
+
+ //Clean up
+ if (GamutRegionV != NULL)
+ {
+ delete[] GamutRegionV;
+ GamutRegionV = NULL;
+ }
+ }
+
+ return conversionOutput;
+}
+
+size_t Tango::ColorLib::ColorConverter::ConvertGradient(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer)
+{
+ GradientConversionInput* conversionInput = NULL;
+
+ try
+ {
+ //Get Input
+ conversionInput = (GradientConversionInput*)malloc(sizeof(GradientConversionInput));
+ conversionInput = gradient_conversion_input__unpack(NULL, input_buffer_size, input_buffer);
+
+ //Init Output
+ GradientConversionOutput *conversionOutput = (GradientConversionOutput*)malloc(sizeof(GradientConversionOutput));
+ gradient_conversion_output__init(conversionOutput);
+
+ //Init reusable conversion input.
+ ConversionInput* input = (ConversionInput*)malloc(sizeof(ConversionInput));
+ conversion_input__init(input);
+
+ input->colorspace = COLOR_SPACE__RGB;
+ input->deltachroma = conversionInput->deltachroma;
+ input->deltal = conversionInput->deltal;
+ input->forwarddata = conversionInput->forwarddata;
+ input->processranges = conversionInput->processranges;
+ input->segmentlength = conversionInput->segmentlength;
+ input->singlemode = true;
+ input->threadl = conversionInput->threadl;
+ input->threada = conversionInput->threada;
+ input->threadb = conversionInput->threadb;
+
+ input->has_colorspace = true;
+ input->has_deltachroma = true;
+ input->has_deltal = true;
+ input->has_segmentlength = true;
+ input->has_forwarddata = true;
+ input->has_singlemode = true;
+ input->has_threadl = true;
+ input->has_threada = true;
+ input->has_threadb = true;
+
+ //Init reusable input coordinates.
+ InputCoordinates* inputCoords = (InputCoordinates*)malloc(sizeof(InputCoordinates));
+ input_coordinates__init(inputCoords);
+
+ inputCoords->inputliquids = conversionInput->inputliquids;
+ inputCoords->n_inputliquids = conversionInput->n_inputliquids;
+
+ inputCoords->has_red = true;
+ inputCoords->has_green = true;
+ inputCoords->has_blue = true;
+
+ input->inputcoordinates = inputCoords;
+
+ OutputCoordinates** outputCoordinatesList = (OutputCoordinates**)malloc(conversionInput->n_colors * sizeof(OutputCoordinates*));;
+
+ for (size_t i = 0; i < conversionInput->n_colors; i++)
+ {
+ inputCoords->red = conversionInput->colors[i]->red;
+ inputCoords->green = conversionInput->colors[i]->green;
+ inputCoords->blue = conversionInput->colors[i]->blue;
+
+ ConversionOutput* output = ConvertInternal(input);
+ outputCoordinatesList[i] = output->singlecoordinates;
+ }
+
+ conversionOutput->coordinates = outputCoordinatesList;
+ conversionOutput->n_coordinates = conversionInput->n_colors;
+
+ //Pack output...
+ output_buffer = (uint8_t*)malloc(gradient_conversion_output__get_packed_size(conversionOutput));
+ int size = gradient_conversion_output__pack(conversionOutput, output_buffer);
+
+ free(input->forwarddata.data);
+
+ for (size_t i = 0; i < conversionInput->n_colors; i++)
+ {
+ for (size_t j = 0; j < outputCoordinatesList[i]->n_outputliquids; j++)
+ {
+ free(outputCoordinatesList[i]->outputliquids[j]);
+ }
+
+ free(outputCoordinatesList[i]);
+ }
+
+ free(outputCoordinatesList);
+
+ gradient_conversion_input__free_unpacked(conversionInput, NULL);
+
+ return (size);
+ }
+ catch (const std::exception& e)
+ {
+ //Notify Error...
+ GradientConversionOutput *conversionOutput = (GradientConversionOutput*)malloc(sizeof(GradientConversionOutput));
+ gradient_conversion_output__init(conversionOutput);
+
+ conversionOutput->has_haserror = true;
+ conversionOutput->haserror = true;
+
+ const char* what = e.what();
+
+ conversionOutput->errormessage = (char*)malloc(strlen(what));
+ strcpy(conversionOutput->errormessage, e.what());
+
+ output_buffer = (uint8_t*)malloc(gradient_conversion_output__get_packed_size(conversionOutput));
+ int size = gradient_conversion_output__pack(conversionOutput, output_buffer);
+
+#pragma region Free Output
+
+ gradient_conversion_input__free_unpacked(conversionInput, NULL);
+
+#pragma endregion
+
+ return (size);
+ }
} \ No newline at end of file
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.h b/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.h
index 74d804913..8976119ad 100644
--- a/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.h
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.h
@@ -57,6 +57,8 @@ namespace Tango
void ConvertVolumeToRGBDisplay(ConversionInput* conversionInput, VectorXd &InkOut, VectorXd &RGBOut,
VectorXd &LabOut, int &GamutRegion);
size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer);
+ size_t Tango::ColorLib::ColorConverter::ConvertGradient(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer);
+ ConversionOutput* Tango::ColorLib::ColorConverter::ConvertInternal(ConversionInput* conversionInput);
void ConvertToNLInks(VectorXd InkIn, VectorXd &InkOut);
void ConvertToLinearInks(VectorXd InkIn, VectorXd &InkOut);
void VolumeToNLInkP(VectorXd Volume, VectorXd &NLInkP);
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp
index ac317461a..9a9a18b38 100644
--- a/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp
@@ -15,3 +15,9 @@ extern "C" EXPORT_API size_t __cdecl Convert(uint8_t* input_buffer, size_t input
return converter.Convert(input_buffer, input_buffer_size, output_buffer);
}
+extern "C" EXPORT_API size_t __cdecl ConvertGradient(uint8_t* input_buffer, size_t input_buffer_size, uint8_t*& output_buffer)
+{
+ ColorConverter converter;
+ return converter.ConvertGradient(input_buffer, input_buffer_size, output_buffer);
+}
+
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionInput.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionInput.pb-c.c
new file mode 100644
index 000000000..4de650d37
--- /dev/null
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionInput.pb-c.c
@@ -0,0 +1,209 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: GradientConversionInput.proto */
+
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C__NO_DEPRECATED
+#define PROTOBUF_C__NO_DEPRECATED
+#endif
+
+#include "GradientConversionInput.pb-c.h"
+void gradient_conversion_input__init
+ (GradientConversionInput *message)
+{
+ static const GradientConversionInput init_value = GRADIENT_CONVERSION_INPUT__INIT;
+ *message = init_value;
+}
+size_t gradient_conversion_input__get_packed_size
+ (const GradientConversionInput *message)
+{
+ assert(message->base.descriptor == &gradient_conversion_input__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t gradient_conversion_input__pack
+ (const GradientConversionInput *message,
+ uint8_t *out)
+{
+ assert(message->base.descriptor == &gradient_conversion_input__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t gradient_conversion_input__pack_to_buffer
+ (const GradientConversionInput *message,
+ ProtobufCBuffer *buffer)
+{
+ assert(message->base.descriptor == &gradient_conversion_input__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+GradientConversionInput *
+ gradient_conversion_input__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (GradientConversionInput *)
+ protobuf_c_message_unpack (&gradient_conversion_input__descriptor,
+ allocator, len, data);
+}
+void gradient_conversion_input__free_unpacked
+ (GradientConversionInput *message,
+ ProtobufCAllocator *allocator)
+{
+ if(!message)
+ return;
+ assert(message->base.descriptor == &gradient_conversion_input__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+static const ProtobufCFieldDescriptor gradient_conversion_input__field_descriptors[10] =
+{
+ {
+ "ThreadL",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_DOUBLE,
+ offsetof(GradientConversionInput, has_threadl),
+ offsetof(GradientConversionInput, threadl),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ThreadA",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_DOUBLE,
+ offsetof(GradientConversionInput, has_threada),
+ offsetof(GradientConversionInput, threada),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ThreadB",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_DOUBLE,
+ offsetof(GradientConversionInput, has_threadb),
+ offsetof(GradientConversionInput, threadb),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ForwardData",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ offsetof(GradientConversionInput, has_forwarddata),
+ offsetof(GradientConversionInput, forwarddata),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "SegmentLength",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_DOUBLE,
+ offsetof(GradientConversionInput, has_segmentlength),
+ offsetof(GradientConversionInput, segmentlength),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "DeltaChroma",
+ 6,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_DOUBLE,
+ offsetof(GradientConversionInput, has_deltachroma),
+ offsetof(GradientConversionInput, deltachroma),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "DeltaL",
+ 7,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_DOUBLE,
+ offsetof(GradientConversionInput, has_deltal),
+ offsetof(GradientConversionInput, deltal),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "Colors",
+ 8,
+ PROTOBUF_C_LABEL_REPEATED,
+ PROTOBUF_C_TYPE_MESSAGE,
+ offsetof(GradientConversionInput, n_colors),
+ offsetof(GradientConversionInput, colors),
+ &input_rgb__descriptor,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "InputLiquids",
+ 9,
+ PROTOBUF_C_LABEL_REPEATED,
+ PROTOBUF_C_TYPE_MESSAGE,
+ offsetof(GradientConversionInput, n_inputliquids),
+ offsetof(GradientConversionInput, inputliquids),
+ &input_liquid__descriptor,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ProcessRanges",
+ 10,
+ PROTOBUF_C_LABEL_REPEATED,
+ PROTOBUF_C_TYPE_MESSAGE,
+ offsetof(GradientConversionInput, n_processranges),
+ offsetof(GradientConversionInput, processranges),
+ &process_range__descriptor,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned gradient_conversion_input__field_indices_by_name[] = {
+ 7, /* field[7] = Colors */
+ 5, /* field[5] = DeltaChroma */
+ 6, /* field[6] = DeltaL */
+ 3, /* field[3] = ForwardData */
+ 8, /* field[8] = InputLiquids */
+ 9, /* field[9] = ProcessRanges */
+ 4, /* field[4] = SegmentLength */
+ 1, /* field[1] = ThreadA */
+ 2, /* field[2] = ThreadB */
+ 0, /* field[0] = ThreadL */
+};
+static const ProtobufCIntRange gradient_conversion_input__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 10 }
+};
+const ProtobufCMessageDescriptor gradient_conversion_input__descriptor =
+{
+ PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
+ "GradientConversionInput",
+ "GradientConversionInput",
+ "GradientConversionInput",
+ "",
+ sizeof(GradientConversionInput),
+ 10,
+ gradient_conversion_input__field_descriptors,
+ gradient_conversion_input__field_indices_by_name,
+ 1, gradient_conversion_input__number_ranges,
+ (ProtobufCMessageInit) gradient_conversion_input__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionInput.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionInput.pb-c.h
new file mode 100644
index 000000000..1de2b2aec
--- /dev/null
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionInput.pb-c.h
@@ -0,0 +1,93 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: GradientConversionInput.proto */
+
+#ifndef PROTOBUF_C_GradientConversionInput_2eproto__INCLUDED
+#define PROTOBUF_C_GradientConversionInput_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 "InputRGB.pb-c.h"
+
+typedef struct _GradientConversionInput GradientConversionInput;
+
+
+/* --- enums --- */
+
+
+/* --- messages --- */
+
+struct _GradientConversionInput
+{
+ 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;
+ protobuf_c_boolean has_segmentlength;
+ double segmentlength;
+ protobuf_c_boolean has_deltachroma;
+ double deltachroma;
+ protobuf_c_boolean has_deltal;
+ double deltal;
+ size_t n_colors;
+ InputRGB **colors;
+ size_t n_inputliquids;
+ InputLiquid **inputliquids;
+ size_t n_processranges;
+ ProcessRange **processranges;
+};
+#define GRADIENT_CONVERSION_INPUT__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&gradient_conversion_input__descriptor) \
+ , 0, 0, 0, 0, 0, 0, 0, {0,NULL}, 0, 0, 0, 0, 0, 0, 0,NULL, 0,NULL, 0,NULL }
+
+
+/* GradientConversionInput methods */
+void gradient_conversion_input__init
+ (GradientConversionInput *message);
+size_t gradient_conversion_input__get_packed_size
+ (const GradientConversionInput *message);
+size_t gradient_conversion_input__pack
+ (const GradientConversionInput *message,
+ uint8_t *out);
+size_t gradient_conversion_input__pack_to_buffer
+ (const GradientConversionInput *message,
+ ProtobufCBuffer *buffer);
+GradientConversionInput *
+ gradient_conversion_input__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void gradient_conversion_input__free_unpacked
+ (GradientConversionInput *message,
+ ProtobufCAllocator *allocator);
+/* --- per-message closures --- */
+
+typedef void (*GradientConversionInput_Closure)
+ (const GradientConversionInput *message,
+ void *closure_data);
+
+/* --- services --- */
+
+
+/* --- descriptors --- */
+
+extern const ProtobufCMessageDescriptor gradient_conversion_input__descriptor;
+
+PROTOBUF_C__END_DECLS
+
+
+#endif /* PROTOBUF_C_GradientConversionInput_2eproto__INCLUDED */
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionOutput.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionOutput.pb-c.c
new file mode 100644
index 000000000..cd5f260ef
--- /dev/null
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionOutput.pb-c.c
@@ -0,0 +1,118 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: GradientConversionOutput.proto */
+
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C__NO_DEPRECATED
+#define PROTOBUF_C__NO_DEPRECATED
+#endif
+
+#include "GradientConversionOutput.pb-c.h"
+void gradient_conversion_output__init
+ (GradientConversionOutput *message)
+{
+ static const GradientConversionOutput init_value = GRADIENT_CONVERSION_OUTPUT__INIT;
+ *message = init_value;
+}
+size_t gradient_conversion_output__get_packed_size
+ (const GradientConversionOutput *message)
+{
+ assert(message->base.descriptor == &gradient_conversion_output__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t gradient_conversion_output__pack
+ (const GradientConversionOutput *message,
+ uint8_t *out)
+{
+ assert(message->base.descriptor == &gradient_conversion_output__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t gradient_conversion_output__pack_to_buffer
+ (const GradientConversionOutput *message,
+ ProtobufCBuffer *buffer)
+{
+ assert(message->base.descriptor == &gradient_conversion_output__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+GradientConversionOutput *
+ gradient_conversion_output__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (GradientConversionOutput *)
+ protobuf_c_message_unpack (&gradient_conversion_output__descriptor,
+ allocator, len, data);
+}
+void gradient_conversion_output__free_unpacked
+ (GradientConversionOutput *message,
+ ProtobufCAllocator *allocator)
+{
+ if(!message)
+ return;
+ assert(message->base.descriptor == &gradient_conversion_output__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+static const ProtobufCFieldDescriptor gradient_conversion_output__field_descriptors[3] =
+{
+ {
+ "Coordinates",
+ 1,
+ PROTOBUF_C_LABEL_REPEATED,
+ PROTOBUF_C_TYPE_MESSAGE,
+ offsetof(GradientConversionOutput, n_coordinates),
+ offsetof(GradientConversionOutput, coordinates),
+ &output_coordinates__descriptor,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "HasError",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BOOL,
+ offsetof(GradientConversionOutput, has_haserror),
+ offsetof(GradientConversionOutput, 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(GradientConversionOutput, errormessage),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned gradient_conversion_output__field_indices_by_name[] = {
+ 0, /* field[0] = Coordinates */
+ 2, /* field[2] = ErrorMessage */
+ 1, /* field[1] = HasError */
+};
+static const ProtobufCIntRange gradient_conversion_output__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 3 }
+};
+const ProtobufCMessageDescriptor gradient_conversion_output__descriptor =
+{
+ PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
+ "GradientConversionOutput",
+ "GradientConversionOutput",
+ "GradientConversionOutput",
+ "",
+ sizeof(GradientConversionOutput),
+ 3,
+ gradient_conversion_output__field_descriptors,
+ gradient_conversion_output__field_indices_by_name,
+ 1, gradient_conversion_output__number_ranges,
+ (ProtobufCMessageInit) gradient_conversion_output__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionOutput.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionOutput.pb-c.h
new file mode 100644
index 000000000..f3471b0f1
--- /dev/null
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/GradientConversionOutput.pb-c.h
@@ -0,0 +1,76 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: GradientConversionOutput.proto */
+
+#ifndef PROTOBUF_C_GradientConversionOutput_2eproto__INCLUDED
+#define PROTOBUF_C_GradientConversionOutput_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 "OutputCoordinates.pb-c.h"
+
+typedef struct _GradientConversionOutput GradientConversionOutput;
+
+
+/* --- enums --- */
+
+
+/* --- messages --- */
+
+struct _GradientConversionOutput
+{
+ ProtobufCMessage base;
+ size_t n_coordinates;
+ OutputCoordinates **coordinates;
+ protobuf_c_boolean has_haserror;
+ protobuf_c_boolean haserror;
+ char *errormessage;
+};
+#define GRADIENT_CONVERSION_OUTPUT__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&gradient_conversion_output__descriptor) \
+ , 0,NULL, 0, 0, NULL }
+
+
+/* GradientConversionOutput methods */
+void gradient_conversion_output__init
+ (GradientConversionOutput *message);
+size_t gradient_conversion_output__get_packed_size
+ (const GradientConversionOutput *message);
+size_t gradient_conversion_output__pack
+ (const GradientConversionOutput *message,
+ uint8_t *out);
+size_t gradient_conversion_output__pack_to_buffer
+ (const GradientConversionOutput *message,
+ ProtobufCBuffer *buffer);
+GradientConversionOutput *
+ gradient_conversion_output__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void gradient_conversion_output__free_unpacked
+ (GradientConversionOutput *message,
+ ProtobufCAllocator *allocator);
+/* --- per-message closures --- */
+
+typedef void (*GradientConversionOutput_Closure)
+ (const GradientConversionOutput *message,
+ void *closure_data);
+
+/* --- services --- */
+
+
+/* --- descriptors --- */
+
+extern const ProtobufCMessageDescriptor gradient_conversion_output__descriptor;
+
+PROTOBUF_C__END_DECLS
+
+
+#endif /* PROTOBUF_C_GradientConversionOutput_2eproto__INCLUDED */
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputRGB.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputRGB.pb-c.c
new file mode 100644
index 000000000..42df1977b
--- /dev/null
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputRGB.pb-c.c
@@ -0,0 +1,118 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: InputRGB.proto */
+
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C__NO_DEPRECATED
+#define PROTOBUF_C__NO_DEPRECATED
+#endif
+
+#include "InputRGB.pb-c.h"
+void input_rgb__init
+ (InputRGB *message)
+{
+ static const InputRGB init_value = INPUT_RGB__INIT;
+ *message = init_value;
+}
+size_t input_rgb__get_packed_size
+ (const InputRGB *message)
+{
+ assert(message->base.descriptor == &input_rgb__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t input_rgb__pack
+ (const InputRGB *message,
+ uint8_t *out)
+{
+ assert(message->base.descriptor == &input_rgb__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t input_rgb__pack_to_buffer
+ (const InputRGB *message,
+ ProtobufCBuffer *buffer)
+{
+ assert(message->base.descriptor == &input_rgb__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+InputRGB *
+ input_rgb__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (InputRGB *)
+ protobuf_c_message_unpack (&input_rgb__descriptor,
+ allocator, len, data);
+}
+void input_rgb__free_unpacked
+ (InputRGB *message,
+ ProtobufCAllocator *allocator)
+{
+ if(!message)
+ return;
+ assert(message->base.descriptor == &input_rgb__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+static const ProtobufCFieldDescriptor input_rgb__field_descriptors[3] =
+{
+ {
+ "Red",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(InputRGB, has_red),
+ offsetof(InputRGB, red),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "Green",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(InputRGB, has_green),
+ offsetof(InputRGB, green),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "Blue",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(InputRGB, has_blue),
+ offsetof(InputRGB, blue),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned input_rgb__field_indices_by_name[] = {
+ 2, /* field[2] = Blue */
+ 1, /* field[1] = Green */
+ 0, /* field[0] = Red */
+};
+static const ProtobufCIntRange input_rgb__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 3 }
+};
+const ProtobufCMessageDescriptor input_rgb__descriptor =
+{
+ PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
+ "InputRGB",
+ "InputRGB",
+ "InputRGB",
+ "",
+ sizeof(InputRGB),
+ 3,
+ input_rgb__field_descriptors,
+ input_rgb__field_indices_by_name,
+ 1, input_rgb__number_ranges,
+ (ProtobufCMessageInit) input_rgb__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputRGB.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputRGB.pb-c.h
new file mode 100644
index 000000000..841071716
--- /dev/null
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputRGB.pb-c.h
@@ -0,0 +1,76 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: InputRGB.proto */
+
+#ifndef PROTOBUF_C_InputRGB_2eproto__INCLUDED
+#define PROTOBUF_C_InputRGB_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 _InputRGB InputRGB;
+
+
+/* --- enums --- */
+
+
+/* --- messages --- */
+
+struct _InputRGB
+{
+ ProtobufCMessage base;
+ protobuf_c_boolean has_red;
+ int32_t red;
+ protobuf_c_boolean has_green;
+ int32_t green;
+ protobuf_c_boolean has_blue;
+ int32_t blue;
+};
+#define INPUT_RGB__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&input_rgb__descriptor) \
+ , 0, 0, 0, 0, 0, 0 }
+
+
+/* InputRGB methods */
+void input_rgb__init
+ (InputRGB *message);
+size_t input_rgb__get_packed_size
+ (const InputRGB *message);
+size_t input_rgb__pack
+ (const InputRGB *message,
+ uint8_t *out);
+size_t input_rgb__pack_to_buffer
+ (const InputRGB *message,
+ ProtobufCBuffer *buffer);
+InputRGB *
+ input_rgb__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void input_rgb__free_unpacked
+ (InputRGB *message,
+ ProtobufCAllocator *allocator);
+/* --- per-message closures --- */
+
+typedef void (*InputRGB_Closure)
+ (const InputRGB *message,
+ void *closure_data);
+
+/* --- services --- */
+
+
+/* --- descriptors --- */
+
+extern const ProtobufCMessageDescriptor input_rgb__descriptor;
+
+PROTOBUF_C__END_DECLS
+
+
+#endif /* PROTOBUF_C_InputRGB_2eproto__INCLUDED */
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj
index 65bfc667b..224588ad3 100644
--- a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj
@@ -167,8 +167,11 @@
<ClInclude Include="PMR\ColorLab\ColorSpace.pb-c.h" />
<ClInclude Include="PMR\ColorLab\ConversionInput.pb-c.h" />
<ClInclude Include="PMR\ColorLab\ConversionOutput.pb-c.h" />
+ <ClInclude Include="PMR\ColorLab\GradientConversionInput.pb-c.h" />
+ <ClInclude Include="PMR\ColorLab\GradientConversionOutput.pb-c.h" />
<ClInclude Include="PMR\ColorLab\InputCoordinates.pb-c.h" />
<ClInclude Include="PMR\ColorLab\InputLiquid.pb-c.h" />
+ <ClInclude Include="PMR\ColorLab\InputRGB.pb-c.h" />
<ClInclude Include="PMR\ColorLab\LiquidType.pb-c.h" />
<ClInclude Include="PMR\ColorLab\OutputCoordinates.pb-c.h" />
<ClInclude Include="PMR\ColorLab\OutputLiquid.pb-c.h" />
@@ -194,8 +197,11 @@
<ClCompile Include="PMR\ColorLab\ColorSpace.pb-c.c" />
<ClCompile Include="PMR\ColorLab\ConversionInput.pb-c.c" />
<ClCompile Include="PMR\ColorLab\ConversionOutput.pb-c.c" />
+ <ClCompile Include="PMR\ColorLab\GradientConversionInput.pb-c.c" />
+ <ClCompile Include="PMR\ColorLab\GradientConversionOutput.pb-c.c" />
<ClCompile Include="PMR\ColorLab\InputCoordinates.pb-c.c" />
<ClCompile Include="PMR\ColorLab\InputLiquid.pb-c.c" />
+ <ClCompile Include="PMR\ColorLab\InputRGB.pb-c.c" />
<ClCompile Include="PMR\ColorLab\LiquidType.pb-c.c" />
<ClCompile Include="PMR\ColorLab\OutputCoordinates.pb-c.c" />
<ClCompile Include="PMR\ColorLab\OutputLiquid.pb-c.c" />
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters
index b929da503..5277161da 100644
--- a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters
@@ -102,6 +102,15 @@
<ClInclude Include="PMR\ColorLab\ProcessRange.pb-c.h">
<Filter>PMR</Filter>
</ClInclude>
+ <ClInclude Include="PMR\ColorLab\GradientConversionOutput.pb-c.h">
+ <Filter>PMR</Filter>
+ </ClInclude>
+ <ClInclude Include="PMR\ColorLab\InputRGB.pb-c.h">
+ <Filter>PMR</Filter>
+ </ClInclude>
+ <ClInclude Include="PMR\ColorLab\GradientConversionInput.pb-c.h">
+ <Filter>PMR</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Exports.cpp">
@@ -170,5 +179,14 @@
<ClCompile Include="PMR\ColorLab\ProcessRange.pb-c.c">
<Filter>PMR</Filter>
</ClCompile>
+ <ClCompile Include="PMR\ColorLab\GradientConversionOutput.pb-c.c">
+ <Filter>PMR</Filter>
+ </ClCompile>
+ <ClCompile Include="PMR\ColorLab\InputRGB.pb-c.c">
+ <Filter>PMR</Filter>
+ </ClCompile>
+ <ClCompile Include="PMR\ColorLab\GradientConversionInput.pb-c.c">
+ <Filter>PMR</Filter>
+ </ClCompile>
</ItemGroup>
</Project> \ No newline at end of file