Commit 645876fb by liulongfei

裁切比例选择

parent b0dea177
...@@ -43,6 +43,8 @@ namespace VIZ.H2V.Connection ...@@ -43,6 +43,8 @@ namespace VIZ.H2V.Connection
{ {
message.roi = new RawRectangleF(package.roi[0], package.roi[1], package.roi[2], package.roi[3]); message.roi = new RawRectangleF(package.roi[0], package.roi[1], package.roi[2], package.roi[3]);
} }
message.center_x = package.center_x;
message.center_y = package.center_y;
if (package.target_bbox != null && package.target_bbox.Count == 4) if (package.target_bbox != null && package.target_bbox.Count == 4)
{ {
message.target_bbox = new RawRectangleF(package.target_bbox[0], package.target_bbox[1], package.target_bbox[2], package.target_bbox[3]); message.target_bbox = new RawRectangleF(package.target_bbox[0], package.target_bbox[1], package.target_bbox[2], package.target_bbox[3]);
......
...@@ -8,6 +8,7 @@ using VIZ.Framework.Core; ...@@ -8,6 +8,7 @@ using VIZ.Framework.Core;
using VIZ.Framework.Connection; using VIZ.Framework.Connection;
using VIZ.H2V.Domain; using VIZ.H2V.Domain;
using SharpDX.Mathematics.Interop; using SharpDX.Mathematics.Interop;
using VIZ.Framework.Storage;
namespace VIZ.H2V.Connection namespace VIZ.H2V.Connection
{ {
...@@ -50,6 +51,9 @@ namespace VIZ.H2V.Connection ...@@ -50,6 +51,9 @@ namespace VIZ.H2V.Connection
message.roi = new RawRectangleF(package.roi[0], package.roi[1], package.roi[2], package.roi[3]); message.roi = new RawRectangleF(package.roi[0], package.roi[1], package.roi[2], package.roi[3]);
} }
message.center_x = package.center_x;
message.center_y = package.center_y;
ApplicationDomainEx.MessageManager.Send(message); ApplicationDomainEx.MessageManager.Send(message);
} }
} }
......
...@@ -24,6 +24,16 @@ namespace VIZ.H2V.Connection ...@@ -24,6 +24,16 @@ namespace VIZ.H2V.Connection
public List<int> roi { get; set; } public List<int> roi { get; set; }
/// <summary> /// <summary>
/// 中心值X
/// </summary>
public int? center_x { get; set; }
/// <summary>
/// 中心值Y
/// </summary>
public int? center_y { get; set; }
/// <summary>
/// 跟踪目标(左上角x,y,右下角x,y) /// 跟踪目标(左上角x,y,右下角x,y)
/// </summary> /// </summary>
public List<int> target_bbox { get; set; } public List<int> target_bbox { get; set; }
......
...@@ -23,6 +23,16 @@ namespace VIZ.H2V.Connection ...@@ -23,6 +23,16 @@ namespace VIZ.H2V.Connection
public List<int> roi { get; set; } public List<int> roi { get; set; }
/// <summary> /// <summary>
/// 中心值X
/// </summary>
public int? center_x { get; set; }
/// <summary>
/// 中心值Y
/// </summary>
public int? center_y { get; set; }
/// <summary>
/// 时间码 /// 时间码
/// </summary> /// </summary>
public long timecode { get; set; } public long timecode { get; set; }
......
...@@ -32,6 +32,8 @@ namespace VIZ.H2V.Connection ...@@ -32,6 +32,8 @@ namespace VIZ.H2V.Connection
ClipPackage__crop_roi package = new ClipPackage__crop_roi(); ClipPackage__crop_roi package = new ClipPackage__crop_roi();
package.id = id; package.id = id;
package.roi = roi; package.roi = roi;
package.center_x = (roi[0] + roi[2]) / 2;
package.center_y = height / 2;
package.width = width; package.width = width;
package.height = height; package.height = height;
package.timecode = timeCode; package.timecode = timeCode;
......
...@@ -22,6 +22,16 @@ namespace VIZ.H2V.Connection ...@@ -22,6 +22,16 @@ namespace VIZ.H2V.Connection
public List<int> roi { get; set; } = new List<int>(); public List<int> roi { get; set; } = new List<int>();
/// <summary> /// <summary>
/// 中心值X
/// </summary>
public int? center_x { get; set; }
/// <summary>
/// 中心值Y
/// </summary>
public int? center_y { get; set; }
/// <summary>
/// 宽度 /// 宽度
/// </summary> /// </summary>
public int width { get; set; } public int width { get; set; }
......
...@@ -111,6 +111,10 @@ ...@@ -111,6 +111,10 @@
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project> <Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name> <Name>VIZ.Framework.Domain</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.H2V.Core\VIZ.H2V.Core.csproj"> <ProjectReference Include="..\VIZ.H2V.Core\VIZ.H2V.Core.csproj">
<Project>{6b1aba83-bf38-40f6-9f4e-bd2ed95898a4}</Project> <Project>{6b1aba83-bf38-40f6-9f4e-bd2ed95898a4}</Project>
<Name>VIZ.H2V.Core</Name> <Name>VIZ.H2V.Core</Name>
......
...@@ -5,6 +5,7 @@ using System.Text; ...@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Framework.Domain; using VIZ.Framework.Domain;
using VIZ.Framework.Storage;
using VIZ.H2V.Storage; using VIZ.H2V.Storage;
namespace VIZ.H2V.Domain namespace VIZ.H2V.Domain
...@@ -33,5 +34,23 @@ namespace VIZ.H2V.Domain ...@@ -33,5 +34,23 @@ namespace VIZ.H2V.Domain
/// 当前使用的GPIO模型 /// 当前使用的GPIO模型
/// </summary> /// </summary>
public static GPIOModel GPIOModel { get; set; } public static GPIOModel GPIOModel { get; set; }
// ---------------------------------------
// 裁切配置
/// <summary>
/// 视频裁切框宽度
/// </summary>
public static int VIDEO_CLIP_BOX_WIDTH { get; set; } = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_CLIP_BOX_WIDTH);
/// <summary>
/// 视频宽度
/// </summary>
public static int VIDEO_WIDTH { get; set; } = 1920;
/// <summary>
/// 视频高度
/// </summary>
public static int VIDEO_HEIGHT { get; set; } = 1080;
} }
} }
...@@ -19,6 +19,16 @@ namespace VIZ.H2V.Domain ...@@ -19,6 +19,16 @@ namespace VIZ.H2V.Domain
public RawRectangleF? roi { get; set; } public RawRectangleF? roi { get; set; }
/// <summary> /// <summary>
/// 中心值X
/// </summary>
public int? center_x { get; set; }
/// <summary>
/// 中心值Y
/// </summary>
public int? center_y { get; set; }
/// <summary>
/// 跟踪坐标 /// 跟踪坐标
/// </summary> /// </summary>
public RawRectangleF? target_bbox { get; set; } public RawRectangleF? target_bbox { get; set; }
......
...@@ -23,6 +23,16 @@ namespace VIZ.H2V.Domain ...@@ -23,6 +23,16 @@ namespace VIZ.H2V.Domain
public RawRectangleF? roi { get; set; } public RawRectangleF? roi { get; set; }
/// <summary> /// <summary>
/// 中心坐标X
/// </summary>
public int? center_x { get; set; }
/// <summary>
/// 中心坐标Y
/// </summary>
public int? center_y { get; set; }
/// <summary>
/// 时间码 /// 时间码
/// </summary> /// </summary>
public long timecode { get; set; } public long timecode { get; set; }
......
...@@ -21,5 +21,15 @@ namespace VIZ.H2V.Domain ...@@ -21,5 +21,15 @@ namespace VIZ.H2V.Domain
/// 裁切坐标 /// 裁切坐标
/// </summary> /// </summary>
RawRectangleF? roi { get; set; } RawRectangleF? roi { get; set; }
/// <summary>
/// 中心值X
/// </summary>
int? center_x { get; set; }
/// <summary>
/// 中心值Y
/// </summary>
int? center_y { get; set; }
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.H2V.Domain
{
/// <summary>
/// 视频裁切模式模型
/// </summary>
public class VideoClipModeModel : ModelBase
{
#region Name -- 名称
private string name;
/// <summary>
/// 名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region Value -- 裁切值
private int _value;
/// <summary>
/// 裁切值
/// </summary>
public int Value
{
get { return _value; }
set { _value = value; this.RaisePropertyChanged(nameof(Value)); }
}
#endregion
}
}
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
<Compile Include="Model\Algorithm\AlgorithmBorderScenceModel.cs" /> <Compile Include="Model\Algorithm\AlgorithmBorderScenceModel.cs" />
<Compile Include="Model\Algorithm\AlgorithmStrategyGroupModel.cs" /> <Compile Include="Model\Algorithm\AlgorithmStrategyGroupModel.cs" />
<Compile Include="Model\Algorithm\AlgorithmStrategyModel.cs" /> <Compile Include="Model\Algorithm\AlgorithmStrategyModel.cs" />
<Compile Include="Model\Config\VideoClipModeModel.cs" />
<Compile Include="Model\Navigation3D\Navigation3DMappingDomainModel.cs" /> <Compile Include="Model\Navigation3D\Navigation3DMappingDomainModel.cs" />
<Compile Include="Model\Navigation3D\Navigation3DMappingGroupModel.cs" /> <Compile Include="Model\Navigation3D\Navigation3DMappingGroupModel.cs" />
<Compile Include="Model\NDI\NDIStreamInfoModel.cs" /> <Compile Include="Model\NDI\NDIStreamInfoModel.cs" />
......
...@@ -272,5 +272,8 @@ ...@@ -272,5 +272,8 @@
<ItemGroup> <ItemGroup>
<Resource Include="Icons\full_four_24x24.png" /> <Resource Include="Icons\full_four_24x24.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Icons\exclamatory_mark_32x32.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
...@@ -365,7 +365,7 @@ namespace VIZ.H2V.Module ...@@ -365,7 +365,7 @@ namespace VIZ.H2V.Module
private void Setting() private void Setting()
{ {
SystemSettingView view = new SystemSettingView(); SystemSettingView view = new SystemSettingView();
NoneWindow window = new NoneWindow(1200, 1000, view); NoneWindow window = new NoneWindow(1200, 1050, view);
window.Owner = this.GetWindow(); window.Owner = this.GetWindow();
window.ShowDialog(); window.ShowDialog();
......
...@@ -45,7 +45,7 @@ namespace VIZ.H2V.Module ...@@ -45,7 +45,7 @@ namespace VIZ.H2V.Module
/// <summary> /// <summary>
/// 裁切框目标X坐标 /// 裁切框目标X坐标
/// </summary> /// </summary>
public double ClipBoxTargetX { get; set; } = 555; public double ClipBoxTargetX { get; set; } = (ApplicationDomainEx.VIDEO_WIDTH - ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH) / 2;
/// <summary> /// <summary>
/// 支持 /// 支持
...@@ -63,7 +63,7 @@ namespace VIZ.H2V.Module ...@@ -63,7 +63,7 @@ namespace VIZ.H2V.Module
// 居中模式直接返回居中位置 // 居中模式直接返回居中位置
if (this.Support.StrategyMode == AlgorithmStrategyMode.center_mode) if (this.Support.StrategyMode == AlgorithmStrategyMode.center_mode)
{ {
return this.GetCalculationValue_Auto(min, max, 555); return this.GetCalculationValue_Auto(min, max, (ApplicationDomainEx.VIDEO_WIDTH - ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH) / 2);
} }
// 手动模式 且 处于激活状态下进行计算 // 手动模式 且 处于激活状态下进行计算
......
...@@ -49,8 +49,9 @@ namespace VIZ.H2V.Module ...@@ -49,8 +49,9 @@ namespace VIZ.H2V.Module
{ {
SystemConfig config = ApplicationDomainEx.LiteDbContext.SystemConfig.FindAll().FirstOrDefault(); SystemConfig config = ApplicationDomainEx.LiteDbContext.SystemConfig.FindAll().FirstOrDefault();
this.ManualController.ClipBoxSmooth.Init(555, 555, config.ManualSmoothCoeff); int clipBoxTargetX = (ApplicationDomainEx.VIDEO_WIDTH - ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH) / 2;
this.ManualController.ClipBoxTargetX = 555; this.ManualController.ClipBoxSmooth.Init(clipBoxTargetX, clipBoxTargetX, config.ManualSmoothCoeff);
this.ManualController.ClipBoxTargetX = clipBoxTargetX;
} }
/// <summary> /// <summary>
...@@ -86,11 +87,11 @@ namespace VIZ.H2V.Module ...@@ -86,11 +87,11 @@ namespace VIZ.H2V.Module
return; return;
} }
this.ClipBoxX = this.ManualController.GetCalculationValue(0d, renderInfo.Frame.Width - this.CLIP_BOX_WIDTH); this.ClipBoxX = this.ManualController.GetCalculationValue(0d, renderInfo.Frame.Width - ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH);
ClipBoxInfo clipBox = new ClipBoxInfo(); ClipBoxInfo clipBox = new ClipBoxInfo();
clipBox.DrawingBorderWidth = this.CLIP_BOX_BORDER_WIDTH; clipBox.DrawingBorderWidth = this.CLIP_BOX_BORDER_WIDTH;
clipBox.SrcRect = new RawRectangleF((float)(this.ClipBoxX), 0, (float)(this.ClipBoxX) + (float)this.CLIP_BOX_WIDTH, renderInfo.Frame.Height); clipBox.SrcRect = new RawRectangleF((float)(this.ClipBoxX), 0, (float)(this.ClipBoxX) + (float)ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH, renderInfo.Frame.Height);
if (this.StrategyMode == AlgorithmStrategyMode.manual_mode) if (this.StrategyMode == AlgorithmStrategyMode.manual_mode)
{ {
clipBox.DrawingBorderColor = this.IsActive ? this.ClipBoxStrokeColor_Manual : this.ClipBoxStrokeColor_ManualNotfoucs; clipBox.DrawingBorderColor = this.IsActive ? this.ClipBoxStrokeColor_Manual : this.ClipBoxStrokeColor_ManualNotfoucs;
...@@ -152,7 +153,7 @@ namespace VIZ.H2V.Module ...@@ -152,7 +153,7 @@ namespace VIZ.H2V.Module
UdpEndpointManager manager_clip = ConnectionManager.UdpConnection.GetEndpointManager($"{this.ViewKey}__CLIP"); UdpEndpointManager manager_clip = ConnectionManager.UdpConnection.GetEndpointManager($"{this.ViewKey}__CLIP");
if (manager_clip != null) if (manager_clip != null)
{ {
ClipSender.CropRoi(manager_clip, 0, roi, CLIP_BOX_WIDTH, e.Frame.Height, e.Frame.TimeStamp); ClipSender.CropRoi(manager_clip, 0, roi, ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH, e.Frame.Height, e.Frame.TimeStamp);
} }
} }
} }
......
...@@ -180,7 +180,8 @@ namespace VIZ.H2V.Module ...@@ -180,7 +180,8 @@ namespace VIZ.H2V.Module
return; return;
} }
RawRectangleF rect = RawRectangleFExpand.ClipInVideoFrame(msg.roi.Value, 0, 0, renderInfo.Frame.Width, renderInfo.Frame.Height); RawRectangleF src = this.GetRawRectangleF(msg, renderInfo.Frame.Width, renderInfo.Frame.Height);
RawRectangleF rect = RawRectangleFExpand.ClipInVideoFrame(src, 0, 0, renderInfo.Frame.Width, renderInfo.Frame.Height);
if (!RawRectangleFExpand.IsEffective(rect)) if (!RawRectangleFExpand.IsEffective(rect))
{ {
...@@ -373,5 +374,38 @@ namespace VIZ.H2V.Module ...@@ -373,5 +374,38 @@ namespace VIZ.H2V.Module
return info; return info;
} }
/// <summary>
/// 获取转化前的裁切矩形
/// </summary>
/// <param name="msg">消息</param>
/// <param name="width">画面宽度</param>
/// <param name="height">画面高度</param>
/// <returns>裁切矩形</returns>
private RawRectangleF GetRawRectangleF(IAlgorithmMessage__roi msg, int width, int height)
{
if (msg.center_x == null)
{
return msg.roi.Value;
}
int VIDEO_CLIP_BOX_WIDTH = ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH;
int half_width = width / 2;
int x_max = msg.center_x.Value + half_width;
int x_min = x_max - VIDEO_CLIP_BOX_WIDTH;
if (x_min < 0)
{
x_min = 0;
x_max = VIDEO_CLIP_BOX_WIDTH;
}
if (x_max > width)
{
x_max = width;
x_min = width - VIDEO_CLIP_BOX_WIDTH;
}
return new RawRectangleF(x_min, 0, x_max, height);
}
} }
} }
...@@ -32,11 +32,6 @@ namespace VIZ.H2V.Module ...@@ -32,11 +32,6 @@ namespace VIZ.H2V.Module
/// <summary> /// <summary>
/// 剪切框宽度 /// 剪切框宽度
/// </summary> /// </summary>
private readonly int CLIP_BOX_WIDTH = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_CLIP_BOX_WIDTH);
/// <summary>
/// 剪切框宽度
/// </summary>
private readonly int CLIP_BOX_BORDER_WIDTH = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_CLIP_BOX_BORDER_WIDTH); private readonly int CLIP_BOX_BORDER_WIDTH = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_CLIP_BOX_BORDER_WIDTH);
/// <summary> /// <summary>
...@@ -310,7 +305,7 @@ namespace VIZ.H2V.Module ...@@ -310,7 +305,7 @@ namespace VIZ.H2V.Module
#region ClipBoxX -- 裁切框X坐标 #region ClipBoxX -- 裁切框X坐标
private double clipBoxX = 555; private double clipBoxX = (ApplicationDomainEx.VIDEO_WIDTH - ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH) / 2;
/// <summary> /// <summary>
/// 裁切框X坐标 /// 裁切框X坐标
/// </summary> /// </summary>
......
...@@ -234,7 +234,7 @@ namespace VIZ.H2V.Module ...@@ -234,7 +234,7 @@ namespace VIZ.H2V.Module
{ {
int left = (int)this.ClipBoxX; int left = (int)this.ClipBoxX;
int top = 0; int top = 0;
int right = left + this.CLIP_BOX_WIDTH; int right = left + ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH;
int bottom = 1080; int bottom = 1080;
return new List<int> { left, top, right, bottom }; return new List<int> { left, top, right, bottom };
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="70"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
...@@ -162,6 +163,31 @@ ...@@ -162,6 +163,31 @@
<CheckBox Grid.Column="1" Style="{StaticResource CheckBox_Setting}" HorizontalAlignment="Right" <CheckBox Grid.Column="1" Style="{StaticResource CheckBox_Setting}" HorizontalAlignment="Right"
IsChecked="{Binding Path=IsWhenNavigationTouchedChangeToManualMode,Mode=TwoWay}"></CheckBox> IsChecked="{Binding Path=IsWhenNavigationTouchedChangeToManualMode,Mode=TwoWay}"></CheckBox>
</Grid> </Grid>
<!-- 裁切比例 -->
<Grid Grid.Row="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="裁切比例" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="2"></TextBlock>
<ComboBox Style="{StaticResource ComboBox_Setting}" Grid.Column="1" Height="40"
ItemsSource="{Binding Path=VideoClipModeItems,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedVideoClipMode,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding Path=Name}" Foreground="White" FontSize="16"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
<Image Source="/VIZ.H2V.Module.Resource;component/Icons/exclamatory_mark_32x32.png"
Width="18" Height="18" Margin="10,0,10,0" VerticalAlignment="Center"></Image>
<TextBlock Text="重启后生效" VerticalAlignment="Center" Foreground="#aaffffff"></TextBlock>
</StackPanel>
</Grid>
</Grid> </Grid>
</Border> </Border>
</UserControl> </UserControl>
\ No newline at end of file
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Framework.Storage;
using VIZ.H2V.Domain; using VIZ.H2V.Domain;
using VIZ.H2V.Storage; using VIZ.H2V.Storage;
...@@ -202,6 +204,34 @@ namespace VIZ.H2V.Module ...@@ -202,6 +204,34 @@ namespace VIZ.H2V.Module
#endregion #endregion
#region VideoClipModeItems -- 视频裁切模式集合
private ObservableCollection<VideoClipModeModel> videoClipModeItems = new ObservableCollection<VideoClipModeModel>();
/// <summary>
/// 视频裁切模式集合
/// </summary>
public ObservableCollection<VideoClipModeModel> VideoClipModeItems
{
get { return videoClipModeItems; }
set { videoClipModeItems = value; this.RaisePropertyChanged(nameof(VideoClipModeItems)); }
}
#endregion
#region SelectedVideoClipMode -- 当前选中的视频裁切模式
private VideoClipModeModel selectedVideoClipMode;
/// <summary>
/// 当前选中的视频裁切模式
/// </summary>
public VideoClipModeModel SelectedVideoClipMode
{
get { return selectedVideoClipMode; }
set { selectedVideoClipMode = value; this.RaisePropertyChanged(nameof(SelectedVideoClipMode)); }
}
#endregion
// ====================================================================================== // ======================================================================================
// === Commond === // === Commond ===
// ====================================================================================== // ======================================================================================
...@@ -234,6 +264,11 @@ namespace VIZ.H2V.Module ...@@ -234,6 +264,11 @@ namespace VIZ.H2V.Module
this.ManualSmoothCoeff = this.SystemConfig.ManualSmoothCoeff; this.ManualSmoothCoeff = this.SystemConfig.ManualSmoothCoeff;
this.IsWhenNavigationTouchedChangeToManualMode = this.SystemConfig.IsWhenNavigationTouchedChangeToManualMode; this.IsWhenNavigationTouchedChangeToManualMode = this.SystemConfig.IsWhenNavigationTouchedChangeToManualMode;
this.VideoClipModeItems.Add(new VideoClipModeModel { Name = "4:3", Value = 810 });
this.VideoClipModeItems.Add(new VideoClipModeModel { Name = "16:9", Value = 607 });
this.SelectedVideoClipMode = this.VideoClipModeItems.FirstOrDefault(p => p.Value == ApplicationDomainEx.VIDEO_CLIP_BOX_WIDTH)
?? this.VideoClipModeItems[0];
// 加载3D鼠标映射模型 // 加载3D鼠标映射模型
this.Load3DNavigationMapping(); this.Load3DNavigationMapping();
} }
...@@ -304,6 +339,9 @@ namespace VIZ.H2V.Module ...@@ -304,6 +339,9 @@ namespace VIZ.H2V.Module
if (this.IsWhenNavigationTouchedChangeToManualMode != this.SystemConfig.IsWhenNavigationTouchedChangeToManualMode) if (this.IsWhenNavigationTouchedChangeToManualMode != this.SystemConfig.IsWhenNavigationTouchedChangeToManualMode)
return true; return true;
if (this.SelectedVideoClipMode.Value != ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_CLIP_BOX_WIDTH))
return true;
return false; return false;
} }
...@@ -328,6 +366,8 @@ namespace VIZ.H2V.Module ...@@ -328,6 +366,8 @@ namespace VIZ.H2V.Module
ApplicationDomainEx.LiteDbContext.SystemConfig.Update(this.SystemConfig); ApplicationDomainEx.LiteDbContext.SystemConfig.Update(this.SystemConfig);
ApplicationDomainEx.IniStorage.SetValue<VideoConfig>(p => p.VIDEO_CLIP_BOX_WIDTH, this.SelectedVideoClipMode.Value);
// 应用 // 应用
ApplicationDomainEx.ServiceManager.GetServiceList<INDIViewService>().ForEach(p => ApplicationDomainEx.ServiceManager.GetServiceList<INDIViewService>().ForEach(p =>
{ {
......
...@@ -58,10 +58,5 @@ namespace VIZ.H2V.Storage ...@@ -58,10 +58,5 @@ namespace VIZ.H2V.Storage
/// 手动校准半径 /// 手动校准半径
/// </summary> /// </summary>
public double ManualCorrectionRadius { get; set; } = 200; public double ManualCorrectionRadius { get; set; } = 200;
/// <summary>
/// 居中模式裁切框X坐标
/// </summary>
public double CenterClipBoxX { get; set; } = 555;
} }
} }
...@@ -33,7 +33,8 @@ VIDEO_FRAME_SELECTION_BORDER_WIDTH=4 ...@@ -33,7 +33,8 @@ VIDEO_FRAME_SELECTION_BORDER_WIDTH=4
;视频框选边框颜色(格式:#AARRGGBB) ;视频框选边框颜色(格式:#AARRGGBB)
VIDEO_FRAME_SELECTION_BORDER_COLOR=#FFFF6D87 VIDEO_FRAME_SELECTION_BORDER_COLOR=#FFFF6D87
;视频剪切宽度(单位:像素) ;视频剪切宽度(单位:像素)
VIDEO_CLIP_BOX_WIDTH=810 ;4:3 ==> 810 16:9 ==> 607
VIDEO_CLIP_BOX_WIDTH=607
;视频剪切边框宽度(单位:像素) ;视频剪切边框宽度(单位:像素)
VIDEO_CLIP_BOX_BORDER_WIDTH=4 VIDEO_CLIP_BOX_BORDER_WIDTH=4
;视频剪切边框颜色 ;视频剪切边框颜色
...@@ -58,8 +59,6 @@ VIDEO_MANUAL_CORRECTION_OPACITY=0.2 ...@@ -58,8 +59,6 @@ VIDEO_MANUAL_CORRECTION_OPACITY=0.2
; === Navigation3D === ; === Navigation3D ===
; ============================================================ ; ============================================================
[Navigation3D] [Navigation3D]
;3D鼠标X轴偏移最大值
NAVIGATION3D_MAX_VALUE=555
;3D鼠标配置名称 ;3D鼠标配置名称
NAVIGATION3D_PROFILE_NAME=VIZ.H2V NAVIGATION3D_PROFILE_NAME=VIZ.H2V
; ============================================================ ; ============================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment