diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-11-19 14:24:18 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-11-19 14:24:18 +0200 |
| commit | 67b7ad5df61a833aa85ce18b6055cbdc8fce513f (patch) | |
| tree | 51b0efabe97a1debbf1f05fab7ee2fe6979ce4ee /Software/Visual_Studio/PPC/Modules | |
| parent | 839b52f073ae0da152d5942564d28889cc576fff (diff) | |
| download | Tango-67b7ad5df61a833aa85ce18b6055cbdc8fce513f.tar.gz Tango-67b7ad5df61a833aa85ce18b6055cbdc8fce513f.zip | |
Refactored PPC hive and color correction.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
5 files changed, 43 insertions, 13 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml index 4c100c2fc..bd31b88ce 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml @@ -59,7 +59,7 @@ </StackPanel> <DockPanel Grid.Row="2" Margin="0 0 0 0"> - <TextBlock DockPanel.Dock="Top" Margin="40 0 0 0">Please select an alternative</TextBlock> + <TextBlock DockPanel.Dock="Top" Margin="40 0 0 0">Please use the closest alternative</TextBlock> <touch:TouchListBox SelectionMode="Single" Style="{StaticResource TangoNoRippleListBox}" ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion,Mode=TwoWay}" Margin="0 20 0 0"> <touch:TouchListBox.ItemContainerStyle> @@ -81,7 +81,7 @@ </Setter> <Setter Property="Effect"> <Setter.Value> - <DropShadowEffect Color="{StaticResource TangoDarkForegroundColor}" ShadowDepth="0" BlurRadius="10" Opacity="0" /> + <DropShadowEffect Color="{StaticResource TangoGrayColor}" ShadowDepth="0" BlurRadius="10" Opacity="0" /> </Setter.Value> </Setter> <Style.Triggers> @@ -147,7 +147,10 @@ <DockPanel Grid.Row="3" Margin="40 10 20 0" LastChildFill="False"> <touch:TouchButton Command="{Binding MoreOptionsCommand}" VerticalAlignment="Top" Style="{StaticResource TangoLinkButton}" DockPanel.Dock="Left" Foreground="{StaticResource TangoPrimaryAccentBrush}"> - More Options + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/color-picker.png" Stretch="None" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">More Options</TextBlock> + </StackPanel> </touch:TouchButton> <touch:TouchButton Command="{Binding OKCommand}" CornerRadius="25" Style="{StaticResource TangoHollowButton}" DockPanel.Dock="Right" Width="170" Height="50" VerticalAlignment="Bottom"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/color-picker.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/color-picker.png Binary files differnew file mode 100644 index 000000000..d8d6f8470 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/color-picker.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index 50cd99b01..6d5b62295 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -483,10 +483,13 @@ <Resource Include="Images\small-cards-view - blue.png" /> <Resource Include="Images\small-cards-view.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\color-picker.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index a4cf491ba..7b0a8b436 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -880,23 +880,47 @@ namespace Tango.PPC.Jobs.ViewModels LogManager.Log($"Invoking triplet color adjustment dialog for brush stop {brushStop.StopIndex} at segment {brushStop.Segment.SegmentIndex}."); LogManager.Log("Retrieving color conversion suggestions for brush stop..."); - var conversionOutput = _converter.Convert(brushStop, true); + PMR.ColorLab.ConversionOutput conversionOutput = null; + + if (brushStop.IsOutOfGamut) + { + conversionOutput = _converter.Convert(brushStop, false); + } BasicColorCorrectionViewVM vm = null; - vm = await NotificationProvider.ShowDialog<BasicColorCorrectionViewVM>(new BasicColorCorrectionViewVM() + if (brushStop.IsOutOfGamut) { - InvalidBrushStop = brushStop, - Suggestions = conversionOutput.CreateTrippletSuggestions(), - }); + vm = await NotificationProvider.ShowDialog<BasicColorCorrectionViewVM>(new BasicColorCorrectionViewVM() + { + InvalidBrushStop = brushStop, + Suggestions = new List<ColorConversionSuggestion>() { new ColorConversionSuggestion(conversionOutput.SingleCoordinates, 0, 0) }, + }); + } - if (vm.Result == BasicColorCorrectionViewVM.ColorCorrectionDialogResult.MoreOptions) + if (vm == null || vm.Result == BasicColorCorrectionViewVM.ColorCorrectionDialogResult.MoreOptions) { + conversionOutput = _converter.Convert(brushStop, true); + + var suggestions = conversionOutput.CreateHiveSuggestions(); + + if (vm == null) + { + var center = suggestions.GetCenterSuggestion(); + center.Coordinates.Red = brushStop.Red; + center.Coordinates.Green = brushStop.Green; + center.Coordinates.Blue = brushStop.Blue; + + center.Coordinates.L = brushStop.L; + center.Coordinates.A = brushStop.A; + center.Coordinates.B = brushStop.B; + } + LogManager.Log("Invoking hive color conversion dialog..."); vm = await NotificationProvider.ShowDialog<AdvancedColorCorrectionViewVM>(new AdvancedColorCorrectionViewVM() { InvalidBrushStop = brushStop, - Suggestions = conversionOutput.CreateHiveSuggestions(), + Suggestions = suggestions, }); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index 57101569a..59b024a7b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -172,7 +172,7 @@ </StackPanel> <StackPanel Orientation="Horizontal" Margin="0 0 -130 0" HorizontalAlignment="Right" VerticalAlignment="Top"> - <touch:TouchImageButton Command="{Binding ElementName=view,Path=DataContext.ReplaceBrushStopCommand,IsAsync=True}" CommandParameter="{Binding}" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" Width="50" Height="50" Padding="10" Image="{StaticResource Image_Replace_Color}" CornerRadius="30"></touch:TouchImageButton> + <touch:TouchImageButton Command="{Binding ElementName=view,Path=DataContext.ReplaceBrushStopCommand,IsAsync=True}" CommandParameter="{Binding}" Visibility="{Binding ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter},IsAsync=True}" Width="50" Height="50" Padding="10" Image="{StaticResource Image_Replace_Color}" CornerRadius="30"></touch:TouchImageButton> <touch:TouchIconButton Margin="0 0 50 0" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding ElementName=view,Path=DataContext.RemoveBrushStopCommand,IsAsync=True}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> </StackPanel> </Grid> @@ -343,7 +343,7 @@ <MultiDataTrigger.Conditions> <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True" /> <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="False" /> - <Condition Binding="{Binding BrushStops[0].IsOutOfGamut,IsAsync=True}" Value="True" /> + <Condition Binding="{Binding BrushStops[0].ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter},IsAsync=True}" Value="Visible" /> </MultiDataTrigger.Conditions> <Setter Property="Visibility" Value="Visible"></Setter> </MultiDataTrigger> |
