1
0
Fork 0
mirror of https://github.com/wagesj45/butterflow-ui.git synced 2024-12-22 01:02:43 -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>
public partial class AboutWindow : Window
{
/// <summary> Default constructor. </summary>
public AboutWindow()
{
InitializeComponent();

View file

@ -15,12 +15,19 @@ namespace butterflow_ui
{
#region Members
/// <summary> The default pyramid scale setting. </summary>
private const decimal DEFAULT_PYRAMID_SCALE = 0.5m;
/// <summary> The default levels setting. </summary>
private const int DEFAULT_LEVELS = 3;
/// <summary> The default window size setting. </summary>
private const int DEFAULT_WINDOW_SIZE = 25;
/// <summary> The default iterations setting. </summary>
private const int DEFAULT_ITERATIONS = 3;
/// <summary> The default pixel neighborhood setting. </summary>
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;
/// <summary> The default flow filter type setting. </summary>
private const FlowFilterType DEFAULT_FLOW_FILTER_TYPE = FlowFilterType.box;
/// <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>
private decimal aspectRatio = 0;
/// <summary> The playback rate. </summary>
private string playbackRate;
/// <summary> A value indicating whether or not to keep the original audio in the final video. </summary>
private bool keepAudio;
/// <summary> The width of the output video. </summary>
private int width;
/// <summary> The height of the output video. </summary>
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;
/// <summary> A value indicating whether or not to tune processing for smooth motion. </summary>
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;
/// <summary> The video input file. </summary>
private string videoInput;
/// <summary> The video output file. </summary>
private string videoOutput;
/// <summary> A value indicating whether or not to use fast pyramids when processing a video. </summary>
private bool fastPyramid;
/// <summary> The pyramid scale setting. </summary>
private decimal pyramidScale;
/// <summary> The level size setting. </summary>
private int levels;
/// <summary> Size of the windowing average. </summary>
private int windowSize;
/// <summary> The number of iterations per pyramid level. </summary>
private int iterations;
/// <summary> The size of pixel neighborhood. </summary>
private int pixelNeighborhood;
/// <summary> The standard deviation of smooth derivatives </summary>
private decimal smoothDerivativeStandardDeviation;
/// <summary> Type of the flow filter to use for processing. </summary>
private FlowFilterType flowFilterType = FlowFilterType.box;
/// <summary> The subregions of the video on which to process. </summary>
private ObservableCollection<ButterflowSubregion> subregions = new ObservableCollection<ButterflowSubregion>();
#endregion
@ -79,7 +105,7 @@ namespace butterflow_ui
}
/// <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
{
get
@ -177,11 +203,11 @@ namespace butterflow_ui
{
get
{
return this.keepSubRegions;
return this.keepSubregions;
}
set
{
this.keepSubRegions = value;
this.keepSubregions = value;
OnPropertyChanged();
}
}
@ -439,7 +465,7 @@ namespace butterflow_ui
FlowFilterType = this.flowFilterType,
Iterations = this.iterations,
KeepAudio = this.keepAudio,
KeepSubregions = this.keepSubRegions,
KeepSubregions = this.keepSubregions,
Levels = this.levels,
LockAspectRatio = this.lockAspectRatio,
LosslessQuality = this.losslessQuality,

View file

@ -6,25 +6,67 @@ using System.Threading.Tasks;
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]
public class OptionsConfigurationFile
{
#region Properties
/// <summary> Gets or sets the playback rate. </summary>
/// <value> The playback rate. </value>
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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <summary> Gets or sets the pyramid scale factor. </summary>
/// <value> The pyramid scale factor. </value>
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; }
/// <summary> Gets or sets the size of the windowing average. </summary>
/// <value> The size of the windowing average. </value>
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; }
/// <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; }
/// <summary> Gets or sets the standard deviation of smooth derivatives. </summary>
/// <value> The standard deviation of smooth derivatives. </value>
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; }
#endregion

View file

@ -28,8 +28,28 @@ namespace butterflow_ui
#region Methods
/// <summary> Executes the property changed action. </summary>
/// <param name="name"> The name. </param>
/// <summary>
/// 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)
{
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()
{
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(string.Empty));
@ -51,7 +72,7 @@ namespace butterflow_ui
/// <param name="name"> The name of the property. </param>
public void AddConstantCallProperty(string name)
{
if(this.alwaysCall == null)
if (this.alwaysCall == null)
{
// This item has been deserialized and the list needs to be reinitialized.
this.alwaysCall = new List<string>();