aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-11-19 14:24:18 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-11-19 14:24:18 +0200
commit67b7ad5df61a833aa85ce18b6055cbdc8fce513f (patch)
tree51b0efabe97a1debbf1f05fab7ee2fe6979ce4ee /Software
parent839b52f073ae0da152d5942564d28889cc576fff (diff)
downloadTango-67b7ad5df61a833aa85ce18b6055cbdc8fce513f.tar.gz
Tango-67b7ad5df61a833aa85ce18b6055cbdc8fce513f.zip
Refactored PPC hive and color correction.
Diffstat (limited to 'Software')
-rw-r--r--Software/DB/PPC/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/PPC/Tango_log.ldfbin53673984 -> 53673984 bytes
-rw-r--r--Software/Graphics/Mobile/color-picker.pngbin1376 -> 1171 bytes
-rw-r--r--Software/Graphics/Mobile/color-picker@2x.pngbin2661 -> 2380 bytes
-rw-r--r--Software/Graphics/Mobile/color-picker@3x.pngbin3984 -> 3541 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml9
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/color-picker.pngbin0 -> 1171 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj5
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs38
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml4
-rw-r--r--Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ColorConversionSuggestionExtensions.cs6
11 files changed, 48 insertions, 14 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf
index b7604d584..7dd2f9afd 100644
--- a/Software/DB/PPC/Tango.mdf
+++ b/Software/DB/PPC/Tango.mdf
Binary files differ
diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf
index ecab6b86c..9c7e63986 100644
--- a/Software/DB/PPC/Tango_log.ldf
+++ b/Software/DB/PPC/Tango_log.ldf
Binary files differ
diff --git a/Software/Graphics/Mobile/color-picker.png b/Software/Graphics/Mobile/color-picker.png
index e09d23190..d8d6f8470 100644
--- a/Software/Graphics/Mobile/color-picker.png
+++ b/Software/Graphics/Mobile/color-picker.png
Binary files differ
diff --git a/Software/Graphics/Mobile/color-picker@2x.png b/Software/Graphics/Mobile/color-picker@2x.png
index 8953e08a7..16f51f17f 100644
--- a/Software/Graphics/Mobile/color-picker@2x.png
+++ b/Software/Graphics/Mobile/color-picker@2x.png
Binary files differ
diff --git a/Software/Graphics/Mobile/color-picker@3x.png b/Software/Graphics/Mobile/color-picker@3x.png
index d5c95846d..0a45334dc 100644
--- a/Software/Graphics/Mobile/color-picker@3x.png
+++ b/Software/Graphics/Mobile/color-picker@3x.png
Binary files differ
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
new file mode 100644
index 000000000..d8d6f8470
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/color-picker.png
Binary files differ
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>
diff --git a/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ColorConversionSuggestionExtensions.cs b/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ColorConversionSuggestionExtensions.cs
index 076890230..6bd0520ad 100644
--- a/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ColorConversionSuggestionExtensions.cs
+++ b/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ColorConversionSuggestionExtensions.cs
@@ -14,7 +14,11 @@ public static class ColorConversionSuggestionExtensions
/// <returns></returns>
public static ColorConversionSuggestion GetCenterSuggestion(this IEnumerable<ColorConversionSuggestion> suggestions)
{
- if (suggestions.Count() == 3)
+ if (suggestions.Count() == 1)
+ {
+ return suggestions.ElementAt(0);
+ }
+ else if (suggestions.Count() == 3)
{
return suggestions.ElementAt(1);
}