Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Conceição <Tiago_caza@hotmail.com>2020-08-08 05:10:16 +0300
committerTiago Conceição <Tiago_caza@hotmail.com>2020-08-08 05:10:16 +0300
commit292db4090fad93a5cecbeb63de1e56dd2b95b164 (patch)
treeecb4ca44430760caaf877d38aa302fedf0285fb1 /UVtools.GUI/Forms/FrmMutation.cs
parentf53dc038818c487120de1915b563b1f1f6ec0818 (diff)
v0.6.5.0v0.6.5.0
* (Add) Mutators: Custom kernels, auto kernels and anchor where applicable * (Add) Mutator - Blur: Box Blur * (Add) Mutator - Blur: Filter2D * (Improvement) Mutator: Group all blurs into one window * (Fix) Mutators: Sample images was gone * (Fix) Mutator - Solidify: Remove the disabled input box * (Fix) Mutator - Pixel Dimming: Disable word wrap on pattern text box
Diffstat (limited to 'UVtools.GUI/Forms/FrmMutation.cs')
-rw-r--r--UVtools.GUI/Forms/FrmMutation.cs36
1 files changed, 10 insertions, 26 deletions
diff --git a/UVtools.GUI/Forms/FrmMutation.cs b/UVtools.GUI/Forms/FrmMutation.cs
index 24035e4..16b2a49 100644
--- a/UVtools.GUI/Forms/FrmMutation.cs
+++ b/UVtools.GUI/Forms/FrmMutation.cs
@@ -7,7 +7,9 @@
*/
using System;
+using System.Drawing;
using System.Windows.Forms;
+using Emgu.CV;
using UVtools.Core;
namespace UVtools.GUI.Forms
@@ -47,6 +49,9 @@ namespace UVtools.GUI.Forms
get => cbIterationsFade.Checked;
set => cbIterationsFade.Checked = value;
}
+
+ public Matrix<byte> KernelMatrix { get; private set; }
+ public Point KernelAnchor => ctrlKernel.KernelAnchor;
#endregion
#region Constructors
@@ -62,9 +67,7 @@ namespace UVtools.GUI.Forms
Mutation = mutation;
DialogResult = DialogResult.Cancel;
- if (defaultIterations == 0 ||
- mutation.Mutate == LayerManager.Mutate.PyrDownUp ||
- mutation.Mutate == LayerManager.Mutate.Solidify)
+ if (defaultIterations == 0)
{
lbIterationsStart.Enabled =
numIterationsStart.Enabled =
@@ -79,15 +82,6 @@ namespace UVtools.GUI.Forms
numIterationsStart.Select();
}
- if (Mutation.Mutate == LayerManager.Mutate.SmoothGaussian ||
- Mutation.Mutate == LayerManager.Mutate.SmoothMedian)
- {
- lbIterationsStop.Enabled =
- nmIterationsEnd.Enabled =
- cbIterationsFade.Enabled =
- false;
- }
-
Text = $"Mutate: {mutation.MenuName}";
lbDescription.Text = Mutation.Description;
@@ -112,6 +106,7 @@ namespace UVtools.GUI.Forms
base.OnKeyUp(e);
if (e.KeyCode == Keys.Enter)
{
+ if (ctrlKernel.tbKernel.ContainsFocus) return;
btnMutate.PerformClick();
e.Handled = true;
return;
@@ -192,20 +187,9 @@ namespace UVtools.GUI.Forms
return;
}
- if (Mutation.Mutate == LayerManager.Mutate.SmoothGaussian ||
- Mutation.Mutate == LayerManager.Mutate.SmoothMedian)
- {
- if (IterationsFade)
- {
- MessageBox.Show("Smooth doesn't support fading.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (Iterations % 2 != 1)
- {
- MessageBox.Show("Iterations must be a odd number.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- }
+ KernelMatrix = ctrlKernel.GetMatrix();
+ if (ReferenceEquals(KernelMatrix, null)) return;
+
var operationName = string.IsNullOrEmpty(Mutation.MenuName) ? Mutation.Mutate.ToString() : Mutation.MenuName;
if (MessageBox.Show($"Are you sure you want to {operationName}?", Text, MessageBoxButtons.YesNo,