diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-05 10:55:51 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-05 10:55:51 +0200 |
| commit | a9c3b16522c1aab52a6f4c6d6441f889fe4cb679 (patch) | |
| tree | efcc931ce936a970dd853e0ddbeeed2d8a49760d /Software/Visual_Studio/Native | |
| parent | 6561bc7a1beb1cd16a137b99208bbc76ee62e0a8 (diff) | |
| download | Tango-a9c3b16522c1aab52a6f4c6d6441f889fe4cb679.tar.gz Tango-a9c3b16522c1aab52a6f4c6d6441f889fe4cb679.zip | |
Implemented unit testing for ColorLib.
Diffstat (limited to 'Software/Visual_Studio/Native')
11 files changed, 231 insertions, 55 deletions
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp index 03637e750..97ed7d048 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp +++ b/Software/Visual_Studio/Native/Tango.ColorLib/ColorConverter.cpp @@ -41,6 +41,10 @@ size_t Tango::ColorLib::ColorConverter::ForwardConvert(uint8_t * input_buffer, s color->green = 2; color->blue = 3; + color->has_red = true; + color->has_green = true; + color->has_blue = true; + suggestions[i] = color; } diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/CalibrationData.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/CalibrationData.pb-c.c new file mode 100644 index 000000000..16d4bba56 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/CalibrationData.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: CalibrationData.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "CalibrationData.pb-c.h" +void calibration_data__init + (CalibrationData *message) +{ + static const CalibrationData init_value = CALIBRATION_DATA__INIT; + *message = init_value; +} +size_t calibration_data__get_packed_size + (const CalibrationData *message) +{ + assert(message->base.descriptor == &calibration_data__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t calibration_data__pack + (const CalibrationData *message, + uint8_t *out) +{ + assert(message->base.descriptor == &calibration_data__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t calibration_data__pack_to_buffer + (const CalibrationData *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &calibration_data__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +CalibrationData * + calibration_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (CalibrationData *) + protobuf_c_message_unpack (&calibration_data__descriptor, + allocator, len, data); +} +void calibration_data__free_unpacked + (CalibrationData *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &calibration_data__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor calibration_data__field_descriptors[1] = +{ + { + "CalibrationPoints", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(CalibrationData, n_calibrationpoints), + offsetof(CalibrationData, calibrationpoints), + &calibration_point__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned calibration_data__field_indices_by_name[] = { + 0, /* field[0] = CalibrationPoints */ +}; +static const ProtobufCIntRange calibration_data__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor calibration_data__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "CalibrationData", + "CalibrationData", + "CalibrationData", + "", + sizeof(CalibrationData), + 1, + calibration_data__field_descriptors, + calibration_data__field_indices_by_name, + 1, calibration_data__number_ranges, + (ProtobufCMessageInit) calibration_data__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/CalibrationData.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/CalibrationData.pb-c.h new file mode 100644 index 000000000..993056a04 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/CalibrationData.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: CalibrationData.proto */ + +#ifndef PROTOBUF_C_CalibrationData_2eproto__INCLUDED +#define PROTOBUF_C_CalibrationData_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 "CalibrationPoint.pb-c.h" + +typedef struct _CalibrationData CalibrationData; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _CalibrationData +{ + ProtobufCMessage base; + size_t n_calibrationpoints; + CalibrationPoint **calibrationpoints; +}; +#define CALIBRATION_DATA__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&calibration_data__descriptor) \ + , 0,NULL } + + +/* CalibrationData methods */ +void calibration_data__init + (CalibrationData *message); +size_t calibration_data__get_packed_size + (const CalibrationData *message); +size_t calibration_data__pack + (const CalibrationData *message, + uint8_t *out); +size_t calibration_data__pack_to_buffer + (const CalibrationData *message, + ProtobufCBuffer *buffer); +CalibrationData * + calibration_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void calibration_data__free_unpacked + (CalibrationData *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*CalibrationData_Closure) + (const CalibrationData *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor calibration_data__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_CalibrationData_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ConversionInput.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ConversionInput.pb-c.c index 8df9d0bb7..7fbeb8d03 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ConversionInput.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ConversionInput.pb-c.c @@ -129,11 +129,11 @@ static const ProtobufCFieldDescriptor conversion_input__field_descriptors[8] = { "CalibrationData", 7, - PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_MESSAGE, - offsetof(ConversionInput, n_calibrationdata), + 0, /* quantifier_offset */ offsetof(ConversionInput, calibrationdata), - &calibration_point__descriptor, + &calibration_data__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ConversionInput.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ConversionInput.pb-c.h index 15ef192de..101f82b7d 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ConversionInput.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/ConversionInput.pb-c.h @@ -15,7 +15,7 @@ PROTOBUF_C__BEGIN_DECLS #endif #include "InputColor.pb-c.h" -#include "CalibrationPoint.pb-c.h" +#include "CalibrationData.pb-c.h" typedef struct _ConversionInput ConversionInput; @@ -39,14 +39,13 @@ struct _ConversionInput ProtobufCBinaryData forwarddata; protobuf_c_boolean has_inversedata; ProtobufCBinaryData inversedata; - size_t n_calibrationdata; - CalibrationPoint **calibrationdata; + CalibrationData *calibrationdata; protobuf_c_boolean has_segmentlength; double segmentlength; }; #define CONVERSION_INPUT__INIT \ { PROTOBUF_C_MESSAGE_INIT (&conversion_input__descriptor) \ - , 0, 0, 0, 0, 0, 0, NULL, 0, {0,NULL}, 0, {0,NULL}, 0,NULL, 0, 0 } + , 0, 0, 0, 0, 0, 0, NULL, 0, {0,NULL}, 0, {0,NULL}, NULL, 0, 0 } /* ConversionInput methods */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputColor.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputColor.pb-c.c index 46cbadad2..2e5424bd8 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputColor.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputColor.pb-c.c @@ -199,48 +199,48 @@ static const ProtobufCFieldDescriptor input_color__field_descriptors[21] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V0", + "CV", 13, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(InputColor, has_v0), - offsetof(InputColor, v0), + offsetof(InputColor, has_cv), + offsetof(InputColor, cv), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V1", + "MV", 14, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(InputColor, has_v1), - offsetof(InputColor, v1), + offsetof(InputColor, has_mv), + offsetof(InputColor, mv), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V2", + "YV", 15, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(InputColor, has_v2), - offsetof(InputColor, v2), + offsetof(InputColor, has_yv), + offsetof(InputColor, yv), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V3", + "KV", 16, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(InputColor, has_v3), - offsetof(InputColor, v3), + offsetof(InputColor, has_kv), + offsetof(InputColor, kv), NULL, NULL, 0, /* flags */ @@ -312,22 +312,22 @@ static const unsigned input_color__field_indices_by_name[] = { 11, /* field[11] = B */ 8, /* field[8] = Black */ 4, /* field[4] = Blue */ + 12, /* field[12] = CV */ 0, /* field[0] = ColorSpace */ 5, /* field[5] = Cyan */ 3, /* field[3] = Green */ + 15, /* field[15] = KV */ 9, /* field[9] = L */ 1, /* field[1] = Length */ + 13, /* field[13] = MV */ 6, /* field[6] = Magenta */ 20, /* field[20] = PantonCode */ 2, /* field[2] = Red */ - 12, /* field[12] = V0 */ - 13, /* field[13] = V1 */ - 14, /* field[14] = V2 */ - 15, /* field[15] = V3 */ 16, /* field[16] = V4 */ 17, /* field[17] = V5 */ 18, /* field[18] = V6 */ 19, /* field[19] = V7 */ + 14, /* field[14] = YV */ 7, /* field[7] = Yellow */ }; static const ProtobufCIntRange input_color__number_ranges[1 + 1] = diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputColor.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputColor.pb-c.h index 8c27cc66b..d9f67383a 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputColor.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/InputColor.pb-c.h @@ -51,14 +51,14 @@ struct _InputColor double a; protobuf_c_boolean has_b; double b; - protobuf_c_boolean has_v0; - double v0; - protobuf_c_boolean has_v1; - double v1; - protobuf_c_boolean has_v2; - double v2; - protobuf_c_boolean has_v3; - double v3; + protobuf_c_boolean has_cv; + double cv; + protobuf_c_boolean has_mv; + double mv; + protobuf_c_boolean has_yv; + double yv; + protobuf_c_boolean has_kv; + double kv; protobuf_c_boolean has_v4; double v4; protobuf_c_boolean has_v5; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputColor.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputColor.pb-c.c index 2625a45f8..35d507fac 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputColor.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputColor.pb-c.c @@ -91,48 +91,48 @@ static const ProtobufCFieldDescriptor output_color__field_descriptors[13] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V0", + "CV", 4, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(OutputColor, has_v0), - offsetof(OutputColor, v0), + offsetof(OutputColor, has_cv), + offsetof(OutputColor, cv), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V1", + "MV", 5, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(OutputColor, has_v1), - offsetof(OutputColor, v1), + offsetof(OutputColor, has_mv), + offsetof(OutputColor, mv), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V2", + "YV", 6, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(OutputColor, has_v2), - offsetof(OutputColor, v2), + offsetof(OutputColor, has_yv), + offsetof(OutputColor, yv), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V3", + "KV", 7, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(OutputColor, has_v3), - offsetof(OutputColor, v3), + offsetof(OutputColor, has_kv), + offsetof(OutputColor, kv), NULL, NULL, 0, /* flags */ @@ -213,18 +213,18 @@ static const ProtobufCFieldDescriptor output_color__field_descriptors[13] = }; static const unsigned output_color__field_indices_by_name[] = { 2, /* field[2] = Blue */ + 3, /* field[3] = CV */ 1, /* field[1] = Green */ + 6, /* field[6] = KV */ 11, /* field[11] = Length */ + 4, /* field[4] = MV */ 12, /* field[12] = ProcessParametersTableIndex */ 0, /* field[0] = Red */ - 3, /* field[3] = V0 */ - 4, /* field[4] = V1 */ - 5, /* field[5] = V2 */ - 6, /* field[6] = V3 */ 7, /* field[7] = V4 */ 8, /* field[8] = V5 */ 9, /* field[9] = V6 */ 10, /* field[10] = V7 */ + 5, /* field[5] = YV */ }; static const ProtobufCIntRange output_color__number_ranges[1 + 1] = { diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputColor.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputColor.pb-c.h index c80c0e418..0c794c46c 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputColor.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/ColorLab/OutputColor.pb-c.h @@ -32,14 +32,14 @@ struct _OutputColor int32_t green; protobuf_c_boolean has_blue; int32_t blue; - protobuf_c_boolean has_v0; - double v0; - protobuf_c_boolean has_v1; - double v1; - protobuf_c_boolean has_v2; - double v2; - protobuf_c_boolean has_v3; - double v3; + protobuf_c_boolean has_cv; + double cv; + protobuf_c_boolean has_mv; + double mv; + protobuf_c_boolean has_yv; + double yv; + protobuf_c_boolean has_kv; + double kv; protobuf_c_boolean has_v4; double v4; protobuf_c_boolean has_v5; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj index 58c610ef3..4b9ffd3a2 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj @@ -149,6 +149,7 @@ </ItemGroup> <ItemGroup> <ClInclude Include="ColorConverter.h" /> + <ClInclude Include="PMR\ColorLab\CalibrationData.pb-c.h" /> <ClInclude Include="PMR\ColorLab\CalibrationPoint.pb-c.h" /> <ClInclude Include="PMR\ColorLab\ColorSpace.pb-c.h" /> <ClInclude Include="PMR\ColorLab\ConversionInput.pb-c.h" /> @@ -167,6 +168,7 @@ <ItemGroup> <ClCompile Include="ColorConverter.cpp" /> <ClCompile Include="Exports.cpp" /> + <ClCompile Include="PMR\ColorLab\CalibrationData.pb-c.c" /> <ClCompile Include="PMR\ColorLab\CalibrationPoint.pb-c.c" /> <ClCompile Include="PMR\ColorLab\ColorSpace.pb-c.c" /> <ClCompile Include="PMR\ColorLab\ConversionInput.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 871011841..e10d4b7c5 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters @@ -66,6 +66,9 @@ <ClInclude Include="PMR\ColorLab\CalibrationPoint.pb-c.h"> <Filter>PMR</Filter> </ClInclude> + <ClInclude Include="PMR\ColorLab\CalibrationData.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ClCompile Include="PMR\Common\ErrorCode.pb-c.c"> @@ -113,5 +116,8 @@ <ClCompile Include="PMR\ColorLab\ColorSpace.pb-c.c"> <Filter>PMR</Filter> </ClCompile> + <ClCompile Include="PMR\ColorLab\CalibrationData.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> </ItemGroup> </Project>
\ No newline at end of file |
