1
0
Fork 0
mirror of https://github.com/wagesj45/butterflow-ui.git synced 2024-12-22 09:12:42 -06:00

Added documentation.

This commit is contained in:
Jordan Wages 2018-07-09 14:49:48 -05:00
parent 329feaf342
commit 92f7229c96
4 changed files with 99 additions and 9 deletions

View file

@ -20,6 +20,7 @@ namespace butterflow_ui
/// </summary> /// </summary>
public partial class AboutWindow : Window public partial class AboutWindow : Window
{ {
/// <summary> Default constructor. </summary>
public AboutWindow() public AboutWindow()
{ {
InitializeComponent(); InitializeComponent();

View file

@ -15,12 +15,19 @@ namespace butterflow_ui
{ {
#region Members #region Members
/// <summary> The default pyramid scale setting. </summary>
private const decimal DEFAULT_PYRAMID_SCALE = 0.5m; private const decimal DEFAULT_PYRAMID_SCALE = 0.5m;
/// <summary> The default levels setting. </summary>
private const int DEFAULT_LEVELS = 3; private const int DEFAULT_LEVELS = 3;
/// <summary> The default window size setting. </summary>
private const int DEFAULT_WINDOW_SIZE = 25; private const int DEFAULT_WINDOW_SIZE = 25;
/// <summary> The default iterations setting. </summary>
private const int DEFAULT_ITERATIONS = 3; private const int DEFAULT_ITERATIONS = 3;
/// <summary> The default pixel neighborhood setting. </summary>
private const int DEFAULT_PIXEL_NEIGHBORHOOD = 5; private const int DEFAULT_PIXEL_NEIGHBORHOOD = 5;
/// <summary> The default smooth derivative standard deviation setting. </summary>
private const decimal DEFAULT_SMOOTH_DERIVATIVE_STANDARD_DEVIATION = 1.1m; private const decimal DEFAULT_SMOOTH_DERIVATIVE_STANDARD_DEVIATION = 1.1m;
/// <summary> The default flow filter type setting. </summary>
private const FlowFilterType DEFAULT_FLOW_FILTER_TYPE = FlowFilterType.box; private const FlowFilterType DEFAULT_FLOW_FILTER_TYPE = FlowFilterType.box;
/// <summary> An input interpreter used for converting string values to numeric values. </summary> /// <summary> An input interpreter used for converting string values to numeric values. </summary>
@ -29,24 +36,43 @@ namespace butterflow_ui
/// <summary> The aspect ratio used for calculating heights when the aspect ratio is locked. </summary> /// <summary> The aspect ratio used for calculating heights when the aspect ratio is locked. </summary>
private decimal aspectRatio = 0; private decimal aspectRatio = 0;
/// <summary> The playback rate. </summary>
private string playbackRate; private string playbackRate;
/// <summary> A value indicating whether or not to keep the original audio in the final video. </summary>
private bool keepAudio; private bool keepAudio;
/// <summary> The width of the output video. </summary>
private int width; private int width;
/// <summary> The height of the output video. </summary>
private int height; private int height;
private bool keepSubRegions; /// <summary> A value indicating whether or not to render unspecified subregions. </summary>
private bool keepSubregions;
/// <summary> A value indicating whether or not to render the final video with lossless quality. </summary>
private bool losslessQuality; private bool losslessQuality;
/// <summary> A value indicating whether or not to tune processing for smooth motion. </summary>
private bool smoothMotion; private bool smoothMotion;
/// <summary> A value indicating whether or not to lock the aspect ratio to the <seealso cref="width"/> of the video. </summary>
private bool lockAspectRatio; private bool lockAspectRatio;
/// <summary> The video input file. </summary>
private string videoInput; private string videoInput;
/// <summary> The video output file. </summary>
private string videoOutput; private string videoOutput;
/// <summary> A value indicating whether or not to use fast pyramids when processing a video. </summary>
private bool fastPyramid; private bool fastPyramid;
/// <summary> The pyramid scale setting. </summary>
private decimal pyramidScale; private decimal pyramidScale;
/// <summary> The level size setting. </summary>
private int levels; private int levels;
/// <summary> Size of the windowing average. </summary>
private int windowSize; private int windowSize;
/// <summary> The number of iterations per pyramid level. </summary>
private int iterations; private int iterations;
/// <summary> The size of pixel neighborhood. </summary>
private int pixelNeighborhood; private int pixelNeighborhood;
/// <summary> The standard deviation of smooth derivatives </summary>
private decimal smoothDerivativeStandardDeviation; private decimal smoothDerivativeStandardDeviation;
/// <summary> Type of the flow filter to use for processing. </summary>
private FlowFilterType flowFilterType = FlowFilterType.box; private FlowFilterType flowFilterType = FlowFilterType.box;
/// <summary> The subregions of the video on which to process. </summary>
private ObservableCollection<ButterflowSubregion> subregions = new ObservableCollection<ButterflowSubregion>(); private ObservableCollection<ButterflowSubregion> subregions = new ObservableCollection<ButterflowSubregion>();
#endregion #endregion
@ -79,7 +105,7 @@ namespace butterflow_ui
} }
/// <summary> Gets or sets a value indicating whether the keep audio. </summary> /// <summary> Gets or sets a value indicating whether the keep audio. </summary>
/// <value> True if keep audio, false if not. </value> /// <value> True if keeping audio in the final video, false if not. </value>
public bool KeepAudio public bool KeepAudio
{ {
get get
@ -177,11 +203,11 @@ namespace butterflow_ui
{ {
get get
{ {
return this.keepSubRegions; return this.keepSubregions;
} }
set set
{ {
this.keepSubRegions = value; this.keepSubregions = value;
OnPropertyChanged(); OnPropertyChanged();
} }
} }
@ -439,7 +465,7 @@ namespace butterflow_ui
FlowFilterType = this.flowFilterType, FlowFilterType = this.flowFilterType,
Iterations = this.iterations, Iterations = this.iterations,
KeepAudio = this.keepAudio, KeepAudio = this.keepAudio,
KeepSubregions = this.keepSubRegions, KeepSubregions = this.keepSubregions,
Levels = this.levels, Levels = this.levels,
LockAspectRatio = this.lockAspectRatio, LockAspectRatio = this.lockAspectRatio,
LosslessQuality = this.losslessQuality, LosslessQuality = this.losslessQuality,

View file

@ -6,25 +6,67 @@ using System.Threading.Tasks;
namespace butterflow_ui namespace butterflow_ui
{ {
/// <summary> An options configuration file. </summary> /// <summary> An options configuration file. This class is used to serialize out the configuration to a file. </summary>
[Serializable] [Serializable]
public class OptionsConfigurationFile public class OptionsConfigurationFile
{ {
#region Properties #region Properties
/// <summary> Gets or sets the playback rate. </summary>
/// <value> The playback rate. </value>
public string PlaybackRate { get; set; } public string PlaybackRate { get; set; }
/// <summary> Gets or sets a value indicating whether the keep audio. </summary>
/// <value> True if keep audio, false if not. </value>
public bool KeepAudio { get; set; } public bool KeepAudio { get; set; }
/// <summary> Gets or sets a value indicating whether the keep subregions that are not explicitly specified. </summary>
/// <value> True if keeping subregions not explicitly specified, false if not. </value>
public bool KeepSubregions { get; set; } public bool KeepSubregions { get; set; }
/// <summary> Gets or sets a value indicating whether the result is rendered in lossless quality. </summary>
/// <value> True if lossless quality is selected, false if not. </value>
public bool LosslessQuality { get; set; } public bool LosslessQuality { get; set; }
/// <summary> Gets or sets a value indicating whether the butterflow should be turned toward smooth motion. </summary>
/// <value> True if tuned toward smooth motion, false if not. </value>
public bool SmoothMotion { get; set; } public bool SmoothMotion { get; set; }
/// <summary> Gets or sets a value indicating whether to lock aspect ratio of the video. </summary>
/// <value> True if locking aspect ratio of the video, false if not. </value>
public bool LockAspectRatio { get; set; } public bool LockAspectRatio { get; set; }
/// <summary> Gets or sets a value indicating whether to use fast pyramids. </summary>
/// <value> True if using fast pyramids, false if not. </value>
public bool FastPyramid { get; set; } public bool FastPyramid { get; set; }
/// <summary> Gets or sets the pyramid scale factor. </summary>
/// <value> The pyramid scale factor. </value>
public decimal PyramidScale { get; set; } public decimal PyramidScale { get; set; }
/// <summary> Gets or sets the number of pyramid layers. </summary>
/// <value> The number of pyramid layers. </value>
public int Levels { get; set; } public int Levels { get; set; }
/// <summary> Gets or sets the size of the windowing average. </summary>
/// <value> The size of the windowing average. </value>
public int WindowSize { get; set; } public int WindowSize { get; set; }
/// <summary> Gets or sets the number of iterations at each pyramid level. </summary>
/// <value> The number of iterations at each pyramid level. </value>
public int Iterations { get; set; } public int Iterations { get; set; }
/// <summary> Gets or sets the size of the pixel neighborhood. </summary>
/// <value> The size of the pixel neighborhood. </value>
/// <remarks> Per butterflow's documentation, the valid range for --poly-n is {5,7}. </remarks>
public int PixelNeighborhood { get; set; } public int PixelNeighborhood { get; set; }
/// <summary> Gets or sets the standard deviation of smooth derivatives. </summary>
/// <value> The standard deviation of smooth derivatives. </value>
public decimal SmoothDerivativeStandardDeviation { get; set; } public decimal SmoothDerivativeStandardDeviation { get; set; }
/// <summary> Gets or sets the type of the flow filter used for optical flow calculations. </summary>
/// <value> The type of the flow filter used for optical flow calculations. </value>
public FlowFilterType FlowFilterType { get; set; } public FlowFilterType FlowFilterType { get; set; }
#endregion #endregion

View file

@ -28,8 +28,28 @@ namespace butterflow_ui
#region Methods #region Methods
/// <summary> Executes the property changed action. </summary> /// <summary>
/// <param name="name"> The name. </param> /// Executes the property changed action. This alerts subscribers to its change in value.
/// </summary>
/// <param name="name"> (Optional) The name of the property. </param>
/// <example>
/// This will automatically pass in "SomeProperty" as the property name, derived useing the
/// <see cref="CallerMemberNameAttribute" /> attribute.
/// <code lang="cs" title="Automatic Property Detection">
/// public bool SomeProperty
/// {
/// get
/// {
/// return this.someProperty;
/// }
/// set
/// {
/// this.someProperty = value;
/// OnPropertyChanged();
/// }
/// }
/// </code>
/// </example>
protected virtual void OnPropertyChanged([CallerMemberName]string name = null) protected virtual void OnPropertyChanged([CallerMemberName]string name = null)
{ {
if (!string.IsNullOrWhiteSpace(name)) if (!string.IsNullOrWhiteSpace(name))
@ -42,6 +62,7 @@ namespace butterflow_ui
} }
} }
/// <summary> Executes when all properties are changed and should be updated. </summary>
protected virtual void OnAllPropertiesChanged() protected virtual void OnAllPropertiesChanged()
{ {
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(string.Empty)); this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(string.Empty));