diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-01-20 13:58:55 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-01-20 13:58:55 +0200 |
| commit | 6faa0e140a4203c13d60b93aa1bad62b37b8ddb9 (patch) | |
| tree | 4062c9a41f0224055056598ee07fe65050a35ca0 | |
| parent | 35933fd41b29cd713c646f79dbe266dc5a32c611 (diff) | |
| download | Tango-6faa0e140a4203c13d60b93aa1bad62b37b8ddb9.tar.gz Tango-6faa0e140a4203c13d60b93aa1bad62b37b8ddb9.zip | |
Meeting Commit.
5 files changed, 40 insertions, 25 deletions
diff --git a/Software/PMR/Messages/ColorLab/OutOfGamutInput.proto b/Software/PMR/Messages/ColorLab/OutOfGamutInput.proto index 167d95af8..29a05a42d 100644 --- a/Software/PMR/Messages/ColorLab/OutOfGamutInput.proto +++ b/Software/PMR/Messages/ColorLab/OutOfGamutInput.proto @@ -15,6 +15,5 @@ message OutOfGamutInput ColorSpace ColorSpace = 4; InputCoordinates InputCoordinates = 5; bytes ForwardData = 6; - double SegmentLength = 7; - repeated ProcessRange ProcessRanges = 8; + repeated ProcessRange ProcessRanges = 7; }
\ No newline at end of file diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp index 373ffeceb..4da243745 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp @@ -4087,7 +4087,7 @@ size_t Tango::ColorLib::ColorConverter::GetRecommendedProcessParameters(uint8_t input = recommended_process_table_input__unpack(NULL, input_buffer_size, input_buffer); //Process.... - + //Process.... //Init Output 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 index 8f763f324..e51e63783 100644 --- 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 @@ -52,7 +52,7 @@ void out_of_gamut_input__free_unpacked 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[8] = +static const ProtobufCFieldDescriptor out_of_gamut_input__field_descriptors[7] = { { "ThreadL", @@ -127,20 +127,8 @@ static const ProtobufCFieldDescriptor out_of_gamut_input__field_descriptors[8] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "SegmentLength", - 7, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_DOUBLE, - offsetof(OutOfGamutInput, has_segmentlength), - offsetof(OutOfGamutInput, segmentlength), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { "ProcessRanges", - 8, + 7, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(OutOfGamutInput, n_processranges), @@ -155,8 +143,7 @@ static const unsigned out_of_gamut_input__field_indices_by_name[] = { 3, /* field[3] = ColorSpace */ 5, /* field[5] = ForwardData */ 4, /* field[4] = InputCoordinates */ - 7, /* field[7] = ProcessRanges */ - 6, /* field[6] = SegmentLength */ + 6, /* field[6] = ProcessRanges */ 1, /* field[1] = ThreadA */ 2, /* field[2] = ThreadB */ 0, /* field[0] = ThreadL */ @@ -164,7 +151,7 @@ static const unsigned out_of_gamut_input__field_indices_by_name[] = { static const ProtobufCIntRange out_of_gamut_input__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 8 } + { 0, 7 } }; const ProtobufCMessageDescriptor out_of_gamut_input__descriptor = { @@ -174,7 +161,7 @@ const ProtobufCMessageDescriptor out_of_gamut_input__descriptor = "OutOfGamutInput", "", sizeof(OutOfGamutInput), - 8, + 7, out_of_gamut_input__field_descriptors, out_of_gamut_input__field_indices_by_name, 1, out_of_gamut_input__number_ranges, 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 index b35cd3b6a..bcaec7a85 100644 --- 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 @@ -40,14 +40,12 @@ struct _OutOfGamutInput InputCoordinates *inputcoordinates; protobuf_c_boolean has_forwarddata; ProtobufCBinaryData forwarddata; - protobuf_c_boolean has_segmentlength; - double segmentlength; 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, 0, 0,NULL } + , 0, 0, 0, 0, 0, 0, 0, COLOR_SPACE__Volume, NULL, 0, {0,NULL}, 0,NULL } /* OutOfGamutInput methods */ diff --git a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs index 780542ae2..91f39c503 100644 --- a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs +++ b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs @@ -253,6 +253,10 @@ namespace Tango.ColorConversion public bool IsOutOfGamut(BrushStop stop) { return Convert(stop, false).OutOfGamut; + + OutOfGamutInput input = new OutOfGamutInput(); + input.ColorSpace = (PMR.ColorLab.ColorSpace)stop.BrushColorSpace; + //TODO: Use IsOutOfGamut(OutOfGamutInput input, 4); } @@ -293,7 +297,34 @@ 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).Where(x => x.BrushColorSpace != ColorSpaces.Catalog).ToList(); + + foreach (var stop in stops) + { + input.Stops.Add(new GradientInputStop() + { + + }); + } + + RecommendedProcessTableOutput output = GetRecommendedProcessParameters(input, job.Rml.ColorConversionVersion); + + var catalogIndex = job.Segments.SelectMany(x => x.BrushStops).Where(x => x.BrushColorSpace == ColorSpaces.Catalog).Max(x => x.ColorCatalogsItem.ProcessParametersTableIndex); + + var maxIndex = Math.Max(output.ProcessParametersTableIndex, catalogIndex); + + var processTable = group.ProcessParametersTables.FirstOrDefault(x => x.TableIndex == maxIndex); + + if (processTable == null) + { + //Handle + } + + return processTable; } private ProcessParametersTable GetRecommendedProcessParametersByProcessParameters(Job job, ProcessParametersTablesGroup group) |
