From 8a1e772f025eaf3bfdf17905d9e33c460993e559 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 1 Jul 2019 17:56:49 +0300 Subject: Many bug fixes !!! --- .../Native/Tango.ColorLib/ColorConverter.cpp | 56 +++++++++++----------- .../Native/Tango.ColorLib/Exports.cpp | 2 +- .../Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.c | 4 +- .../Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.h | 2 +- .../Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.c | 8 ++-- .../Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.h | 2 +- .../PMR/ColorLab/OutputCoordinates.pb-c.c | 45 +++++++++++++++-- .../PMR/ColorLab/OutputCoordinates.pb-c.h | 8 +++- 8 files changed, 86 insertions(+), 41 deletions(-) (limited to 'Software/Visual_Studio/Native') diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp index 1ede4a356..b64ece88a 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp +++ b/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp @@ -920,20 +920,20 @@ void Tango::ColorLib::ColorConverter::ConvertColorToLinearInks(ConversionInput* } break; } - case(COLOR_SPACE__PANTON): - { - int32_t inData; - if (conversionInput->inputcoordinates->has_pantoncode) - inData = conversionInput->inputcoordinates->pantoncode; - else - { - //mismatch between color space and data - throw std::exception("Mismatch between color space and data"); - return; - } - break; - //missing calculation method and pantone table, either in terms of RGB or CMY or Lab - } + //case(COLOR_SPACE__PANTON): + //{ + // int32_t inData; + // if (conversionInput->inputcoordinates->has_pantoncode) + // inData = conversionInput->inputcoordinates->pantoncode; + // else + // { + // //mismatch between color space and data + // throw std::exception("Mismatch between color space and data"); + // return; + // } + // break; + // //missing calculation method and pantone table, either in terms of RGB or CMY or Lab + //} default: { @@ -1962,20 +1962,20 @@ size_t Tango::ColorLib::ColorConverter::P_IsInGamut(uint8_t * input_buffer, size // just convert Lab for rgb display InGamut = true; } - case(COLOR_SPACE__PANTON): - { - int32_t inData; - if (conversionInput->inputcoordinates->has_pantoncode) - inData = conversionInput->inputcoordinates->pantoncode; - else - { - //mismatch between color space and data - throw std::exception("Mismatch between color space and data"); - return(0); - } - break; - //missing calclulation method and pantone table, either in terms of RGB or CMY or Lab - } + //case(COLOR_SPACE__PANTON): + //{ + // int32_t inData; + // if (conversionInput->inputcoordinates->has_pantoncode) + // inData = conversionInput->inputcoordinates->pantoncode; + // else + // { + // //mismatch between color space and data + // throw std::exception("Mismatch between color space and data"); + // return(0); + // } + // break; + // //missing calclulation method and pantone table, either in terms of RGB or CMY or Lab + //} default: { throw std::exception(" Unsupported Color Space"); diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp index 9a9a18b38..61410fdc4 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp @@ -18,6 +18,6 @@ extern "C" EXPORT_API size_t __cdecl Convert(uint8_t* input_buffer, size_t input 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); + return converter.ConvertGradient(input_buffer, input_buffer_size, output_buffer); } diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.c index b67d99784..78cae4462 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.c @@ -13,7 +13,7 @@ static const ProtobufCEnumValue color_space__enum_values_by_number[6] = { "RGB", "COLOR_SPACE__RGB", 1 }, { "CMYK", "COLOR_SPACE__CMYK", 2 }, { "LAB", "COLOR_SPACE__LAB", 3 }, - { "PANTON", "COLOR_SPACE__PANTON", 4 }, + { "Coats", "COLOR_SPACE__Coats", 4 }, { "Twine", "COLOR_SPACE__Twine", 5 }, }; static const ProtobufCIntRange color_space__value_ranges[] = { @@ -22,8 +22,8 @@ static const ProtobufCIntRange color_space__value_ranges[] = { static const ProtobufCEnumValueIndex color_space__enum_values_by_name[6] = { { "CMYK", 2 }, + { "Coats", 4 }, { "LAB", 3 }, - { "PANTON", 4 }, { "RGB", 1 }, { "Twine", 5 }, { "Volume", 0 }, diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.h index 07226817d..17bfb420f 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ColorSpace.pb-c.h @@ -24,7 +24,7 @@ typedef enum _ColorSpace { COLOR_SPACE__RGB = 1, COLOR_SPACE__CMYK = 2, COLOR_SPACE__LAB = 3, - COLOR_SPACE__PANTON = 4, + COLOR_SPACE__Coats = 4, COLOR_SPACE__Twine = 5 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(COLOR_SPACE) } ColorSpace; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.c index d1bc8c432..e4baae5c6 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.c @@ -15,18 +15,18 @@ static const ProtobufCEnumValue liquid_type__enum_values_by_number[7] = { "Black", "LIQUID_TYPE__Black", 3 }, { "TransparentInk", "LIQUID_TYPE__TransparentInk", 4 }, { "Lubricant", "LIQUID_TYPE__Lubricant", 5 }, - { "Red", "LIQUID_TYPE__Red", 7 }, + { "Cleaner", "LIQUID_TYPE__Cleaner", 6 }, }; static const ProtobufCIntRange liquid_type__value_ranges[] = { -{0, 0},{7, 6},{0, 7} +{0, 0},{0, 7} }; static const ProtobufCEnumValueIndex liquid_type__enum_values_by_name[7] = { { "Black", 3 }, + { "Cleaner", 6 }, { "Cyan", 0 }, { "Lubricant", 5 }, { "Magenta", 1 }, - { "Red", 6 }, { "TransparentInk", 4 }, { "Yellow", 2 }, }; @@ -41,7 +41,7 @@ const ProtobufCEnumDescriptor liquid_type__descriptor = liquid_type__enum_values_by_number, 7, liquid_type__enum_values_by_name, - 2, + 1, liquid_type__value_ranges, NULL,NULL,NULL,NULL /* reserved[1234] */ }; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.h index 19f99411c..da9ec1c60 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/LiquidType.pb-c.h @@ -26,7 +26,7 @@ typedef enum _LiquidType { LIQUID_TYPE__Black = 3, LIQUID_TYPE__TransparentInk = 4, LIQUID_TYPE__Lubricant = 5, - LIQUID_TYPE__Red = 7 + LIQUID_TYPE__Cleaner = 6 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(LIQUID_TYPE) } LiquidType; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputCoordinates.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputCoordinates.pb-c.c index c41585415..85aeb6ee5 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputCoordinates.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputCoordinates.pb-c.c @@ -52,7 +52,7 @@ void output_coordinates__free_unpacked assert(message->base.descriptor == &output_coordinates__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor output_coordinates__field_descriptors[5] = +static const ProtobufCFieldDescriptor output_coordinates__field_descriptors[8] = { { "Red", @@ -114,10 +114,49 @@ static const ProtobufCFieldDescriptor output_coordinates__field_descriptors[5] = 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "L", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(OutputCoordinates, has_l), + offsetof(OutputCoordinates, l), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "A", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(OutputCoordinates, has_a), + offsetof(OutputCoordinates, a), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "B", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(OutputCoordinates, has_b), + offsetof(OutputCoordinates, b), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned output_coordinates__field_indices_by_name[] = { + 6, /* field[6] = A */ + 7, /* field[7] = B */ 2, /* field[2] = Blue */ 1, /* field[1] = Green */ + 5, /* field[5] = L */ 3, /* field[3] = OutputLiquids */ 4, /* field[4] = ProcessParametersTableIndex */ 0, /* field[0] = Red */ @@ -125,7 +164,7 @@ static const unsigned output_coordinates__field_indices_by_name[] = { static const ProtobufCIntRange output_coordinates__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 5 } + { 0, 8 } }; const ProtobufCMessageDescriptor output_coordinates__descriptor = { @@ -135,7 +174,7 @@ const ProtobufCMessageDescriptor output_coordinates__descriptor = "OutputCoordinates", "", sizeof(OutputCoordinates), - 5, + 8, output_coordinates__field_descriptors, output_coordinates__field_indices_by_name, 1, output_coordinates__number_ranges, diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputCoordinates.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputCoordinates.pb-c.h index 410f0660a..749ba3e7b 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputCoordinates.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputCoordinates.pb-c.h @@ -33,6 +33,12 @@ struct _OutputCoordinates int32_t green; protobuf_c_boolean has_blue; int32_t blue; + protobuf_c_boolean has_l; + double l; + protobuf_c_boolean has_a; + double a; + protobuf_c_boolean has_b; + double b; size_t n_outputliquids; OutputLiquid **outputliquids; protobuf_c_boolean has_processparameterstableindex; @@ -40,7 +46,7 @@ struct _OutputCoordinates }; #define OUTPUT_COORDINATES__INIT \ { PROTOBUF_C_MESSAGE_INIT (&output_coordinates__descriptor) \ - , 0, 0, 0, 0, 0, 0, 0,NULL, 0, 0 } + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,NULL, 0, 0 } /* OutputCoordinates methods */ -- cgit v1.3.1