diff --git a/sources/LocalLaplacianFilters.csproj b/sources/LocalLaplacianFilters.csproj index b5798c5..1ac2ef5 100644 --- a/sources/LocalLaplacianFilters.csproj +++ b/sources/LocalLaplacianFilters.csproj @@ -51,13 +51,14 @@ prompt MinimumRecommendedRules.ruleset false + false bin\Release\ TRACE true true - pdbonly + none AnyCPU prompt MinimumRecommendedRules.ruleset @@ -77,8 +78,8 @@ - - packages\UMapx.4.0.2.3\lib\netstandard2.0\UMapx.dll + + packages\UMapx.5.0.1.1\lib\netstandard2.0\UMapx.dll diff --git a/sources/Properties/AssemblyInfo.cs b/sources/Properties/AssemblyInfo.cs index 50e04b3..e7c5a06 100644 --- a/sources/Properties/AssemblyInfo.cs +++ b/sources/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ // Можно задать все значения или принять номер построения и номер редакции по умолчанию, // используя "*", как показано ниже: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] [assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/sources/filters/BilateralGammaFilter.cs b/sources/filters/BilateralGammaFilter.cs index d2df41d..0a01cb4 100644 --- a/sources/filters/BilateralGammaFilter.cs +++ b/sources/filters/BilateralGammaFilter.cs @@ -9,7 +9,7 @@ namespace LaplacianHDR.Filters public class BilateralGammaCorrection : Correction { #region Private data - private double g; + private float g; #endregion #region Filter components @@ -18,14 +18,14 @@ public class BilateralGammaCorrection : Correction /// /// Gamma /// Space - public BilateralGammaCorrection(double g, Space space) + public BilateralGammaCorrection(float g, Space space) { Value = g; Space = space; } /// /// Gets or sets gamma value. /// - public double Value + public float Value { get { @@ -53,13 +53,13 @@ protected override void Rebuild() /// Gamma /// Length /// Array - public static double[] Gamma(double g, int length) + public static float[] Gamma(float g, int length) { - double[] table = new double[length]; + float[] table = new float[length]; for (int x = 0; x < length; x++) { - table[x] = Gamma(x / (double)length, g); + table[x] = Gamma(x / (float)length, g); } return table; } @@ -69,7 +69,7 @@ public static double[] Gamma(double g, int length) /// Argument /// Gamma /// Double - public static double Gamma(double x, double g) + public static float Gamma(float x, float g) { double y, z, w; @@ -90,9 +90,9 @@ public static double Gamma(double x, double g) // check if (double.IsNaN(y)) - return 1.0; + return 1.0f; - return y; + return (float)y; } #endregion } diff --git a/sources/filters/GeneralizedLocalLaplacianFilter.cs b/sources/filters/GeneralizedLocalLaplacianFilter.cs index ef4e37e..4c43766 100644 --- a/sources/filters/GeneralizedLocalLaplacianFilter.cs +++ b/sources/filters/GeneralizedLocalLaplacianFilter.cs @@ -35,7 +35,7 @@ public GeneralizedLocalLaplacianFilter() /// Number of levels /// Factor /// Colorspace - public void SetParams(int radius, double lightshadows, double sigma, int discrets, int levels, double factor, Space space) + public void SetParams(int radius, float lightshadows, float sigma, int discrets, int levels, float factor, Space space) { this.bgc.Value = lightshadows; this.bgc.Space = space; diff --git a/sources/filters/HueSaturationLightnessFilter.cs b/sources/filters/HueSaturationLightnessFilter.cs index dae3982..a24f07a 100644 --- a/sources/filters/HueSaturationLightnessFilter.cs +++ b/sources/filters/HueSaturationLightnessFilter.cs @@ -26,7 +26,7 @@ public HueSaturationLightnessFilter() /// Hue /// Saturation /// Lightness - public void SetParams(double h, double s, double l) + public void SetParams(float h, float s, float l) { this.hsl.Hue = h; this.hsl.Saturation = s; diff --git a/sources/filters/SaturationContrastBrightnessFilter.cs b/sources/filters/SaturationContrastBrightnessFilter.cs index ba7c664..21b9369 100644 --- a/sources/filters/SaturationContrastBrightnessFilter.cs +++ b/sources/filters/SaturationContrastBrightnessFilter.cs @@ -37,7 +37,7 @@ public SaturationContrastBrightnessFilter() /// Exposure /// Gamma /// Colorspace - public void SetParams(double saturation, double contrast, double brightness, double exposure, double gamma, Space space) + public void SetParams(float saturation, float contrast, float brightness, float exposure, float gamma, Space space) { this.sc.Saturation = saturation; diff --git a/sources/filters/TemperatureFilter.cs b/sources/filters/TemperatureFilter.cs index ac5a374..edae9a2 100644 --- a/sources/filters/TemperatureFilter.cs +++ b/sources/filters/TemperatureFilter.cs @@ -25,7 +25,7 @@ public TemperatureFilter() /// /// Temperature /// Strength - public void SetParams(double temperature, double strenght) + public void SetParams(float temperature, float strenght) { this.temp.Temperature = temperature; this.temp.Strength = strenght; diff --git a/sources/forms/Form1.Designer.cs b/sources/forms/Form1.Designer.cs index b47b37a..739bb99 100644 --- a/sources/forms/Form1.Designer.cs +++ b/sources/forms/Form1.Designer.cs @@ -57,6 +57,7 @@ private void InitializeComponent() this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); + this.textBox1 = new System.Windows.Forms.TextBox(); this.label16 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); this.label15 = new System.Windows.Forms.Label(); @@ -72,7 +73,6 @@ private void InitializeComponent() this.trackBar4 = new System.Windows.Forms.TrackBar(); this.trackBar1 = new System.Windows.Forms.TrackBar(); this.textBox4 = new System.Windows.Forms.TextBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); this.label14 = new System.Windows.Forms.Label(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.trackBar5 = new System.Windows.Forms.TrackBar(); @@ -122,7 +122,7 @@ private void InitializeComponent() // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(110, 22); this.openToolStripMenuItem.Text = "Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // @@ -130,7 +130,7 @@ private void InitializeComponent() // this.reloadToolStripMenuItem.Enabled = false; this.reloadToolStripMenuItem.Name = "reloadToolStripMenuItem"; - this.reloadToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.reloadToolStripMenuItem.Size = new System.Drawing.Size(110, 22); this.reloadToolStripMenuItem.Text = "Reload"; this.reloadToolStripMenuItem.Click += new System.EventHandler(this.reloadToolStripMenuItem_Click); // @@ -138,7 +138,7 @@ private void InitializeComponent() // this.saveToolStripMenuItem.Enabled = false; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(110, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // @@ -146,7 +146,7 @@ private void InitializeComponent() // this.closeToolStripMenuItem.Enabled = false; this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.closeToolStripMenuItem.Size = new System.Drawing.Size(110, 22); this.closeToolStripMenuItem.Text = "Close"; this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); // @@ -261,6 +261,7 @@ private void InitializeComponent() this.pictureBox1.Size = new System.Drawing.Size(876, 934); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox1.TabIndex = 1; + this.pictureBox1.TabStop = false; // // comboBox1 // @@ -404,6 +405,19 @@ private void InitializeComponent() this.panel1.Size = new System.Drawing.Size(291, 961); this.panel1.TabIndex = 36; // + // textBox1 + // + this.textBox1.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.textBox1.BackColor = System.Drawing.Color.White; + this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox1.Location = new System.Drawing.Point(235, 667); + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(36, 23); + this.textBox1.TabIndex = 45; + this.textBox1.Text = "0"; + this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // // label16 // this.label16.Anchor = System.Windows.Forms.AnchorStyles.Top; @@ -594,19 +608,6 @@ private void InitializeComponent() this.textBox4.Text = "0"; this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // - // textBox1 - // - this.textBox1.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.textBox1.BackColor = System.Drawing.Color.White; - this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.textBox1.Location = new System.Drawing.Point(235, 667); - this.textBox1.Name = "textBox1"; - this.textBox1.ReadOnly = true; - this.textBox1.Size = new System.Drawing.Size(36, 23); - this.textBox1.TabIndex = 45; - this.textBox1.Text = "0"; - this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // // label14 // this.label14.Anchor = System.Windows.Forms.AnchorStyles.Top; diff --git a/sources/forms/Form1.cs b/sources/forms/Form1.cs index 6b7fc55..932a7b9 100644 --- a/sources/forms/Form1.cs +++ b/sources/forms/Form1.cs @@ -519,7 +519,7 @@ private void ResetAdjustments() return; } - private void Processor(Bitmap bitmap, SingleFilter filter, bool cache = true) + private void Processor(Bitmap bitmap, Filter filter, bool cache = true) { // check if null if (bitmap != null) @@ -545,7 +545,7 @@ private void Processor(Bitmap bitmap, SingleFilter filter, bool cache = true) return; } - private void Processor(Bitmap[] bitmap, ComplexFilter filter) + private void Processor(Bitmap[] bitmap, MultiFilter filter) { // check if null if (bitmap != null) @@ -568,11 +568,11 @@ private void Processor(Bitmap[] bitmap, ComplexFilter filter) public Bitmap Apply(Bitmap image) { // parsing - double saturation = int.Parse(textBox1.Text); - double contrast = double.Parse(textBox2.Text) / 100.0; - double brightness = double.Parse(textBox5.Text) / 100.0; - double exposure = double.Parse(textBox4.Text) / 100.0; - double gamma = Math.Pow(2, -3 * double.Parse(textBox3.Text) / 100.0); + float saturation = int.Parse(textBox1.Text); + float contrast = float.Parse(textBox2.Text) / 100.0f; + float brightness = float.Parse(textBox5.Text) / 100.0f; + float exposure = float.Parse(textBox4.Text) / 100.0f; + float gamma = (float)Math.Pow(2, -3 * float.Parse(textBox3.Text) / 100.0f); // parameters scf.SetParams(saturation, contrast, brightness, exposure, gamma, Space); diff --git a/sources/forms/Form2.cs b/sources/forms/Form2.cs index f6ddc8f..e218b46 100644 --- a/sources/forms/Form2.cs +++ b/sources/forms/Form2.cs @@ -72,11 +72,11 @@ public Space Space public Bitmap Apply(Bitmap image) { // parsing - double lightshadows = Math.Pow(2, double.Parse(textBox1.Text) / 100.0); - double sigma = double.Parse(textBox2.Text); + float lightshadows = (float)Math.Pow(2, float.Parse(textBox1.Text) / 100.0); + float sigma = float.Parse(textBox2.Text); int discrets = int.Parse(textBox3.Text); int levels = int.Parse(textBox4.Text); - double factor = double.Parse(textBox5.Text); + float factor = float.Parse(textBox5.Text); int radius = 2 * (int.Parse(textBox6.Text) + 1); // applying filter diff --git a/sources/forms/Form3.cs b/sources/forms/Form3.cs index e34830d..76a812c 100644 --- a/sources/forms/Form3.cs +++ b/sources/forms/Form3.cs @@ -33,8 +33,8 @@ private void Form3_Load(object sender, EventArgs e) public Bitmap Apply(Bitmap image) { // parsing - double saturation = double.Parse(textBox1.Text); - double contrast = double.Parse(textBox2.Text); + float saturation = float.Parse(textBox1.Text); + float contrast = float.Parse(textBox2.Text); // applying temp.SetParams(saturation, contrast); diff --git a/sources/forms/Form4.cs b/sources/forms/Form4.cs index 7306c88..224ab1a 100644 --- a/sources/forms/Form4.cs +++ b/sources/forms/Form4.cs @@ -36,9 +36,9 @@ private void Form4_Load(object sender, EventArgs e) public Bitmap Apply(Bitmap image) { // parsing - double h = double.Parse(textBox1.Text); - double s = double.Parse(textBox2.Text) / 100.0; - double l = double.Parse(textBox3.Text) / 100.0; + float h = float.Parse(textBox1.Text); + float s = float.Parse(textBox2.Text) / 100.0f; + float l = float.Parse(textBox3.Text) / 100.0f; // applying filter hsl.SetParams(h, s, l); diff --git a/sources/forms/Form5.cs b/sources/forms/Form5.cs index ea5ca1a..4913ec3 100644 --- a/sources/forms/Form5.cs +++ b/sources/forms/Form5.cs @@ -29,7 +29,7 @@ private void Form5_Load(object sender, EventArgs e) public Bitmap Apply(params Bitmap[] images) { - this.fusion = new ExposureFusion(int.MaxValue, double.Parse(textBox2.Text)); + this.fusion = new ExposureFusion(int.MaxValue, float.Parse(textBox2.Text)); return this.fusion.Apply(images); } diff --git a/sources/helpers/DelegateHelper.cs b/sources/helpers/DelegateHelper.cs index 0db915a..14c6c32 100644 --- a/sources/helpers/DelegateHelper.cs +++ b/sources/helpers/DelegateHelper.cs @@ -8,12 +8,12 @@ namespace LaplacianHDR.Helpers /// /// Bitmap /// Bitmap - public delegate Bitmap SingleFilter(Bitmap bitmap); + public delegate Bitmap Filter(Bitmap bitmap); /// /// Filter delegate. /// /// Bitmap /// Bitmap - public delegate Bitmap ComplexFilter(Bitmap[] bitmap); + public delegate Bitmap MultiFilter(Bitmap[] bitmap); #endregion } diff --git a/sources/helpers/ImageHelper.cs b/sources/helpers/ImageHelper.cs index 0e0437e..95b05e2 100644 --- a/sources/helpers/ImageHelper.cs +++ b/sources/helpers/ImageHelper.cs @@ -145,7 +145,7 @@ public static Bitmap Crop(Bitmap bitmap, int box) double k = min / (double)box; return (new Bitmap(bitmap, (int)(width / k + 1), (int)(height / k + 1))). - Clone(new Rectangle(0, 0, box, box), System.Drawing.Imaging.PixelFormat.Format32bppArgb); + Clone(new Rectangle(0, 0, box, box), PixelFormat.Format32bppArgb); } /// /// Checks if bitmaps in array have the same sizes. diff --git a/sources/packages.config b/sources/packages.config index 9ad35ad..9767d65 100644 --- a/sources/packages.config +++ b/sources/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file