Skip to content

Commit

Permalink
v0.6.5.0
Browse files Browse the repository at this point in the history
* (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
  • Loading branch information
sn4k3 committed Aug 8, 2020
1 parent f53dc03 commit 292db40
Show file tree
Hide file tree
Showing 18 changed files with 1,749 additions and 282 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 08/08/2020 - v0.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

## 06/08/2020 - v0.6.4.3

* (Add) Pixel Editor - Supports and Drain holes: AntiAliasing
Expand Down
26 changes: 26 additions & 0 deletions UVtools.Core/Layer/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,18 @@ public void MutateThresholdPixels(byte threshold, byte maximum, ThresholdType th
}
}

public void MutateBlur(Size size = default, Point anchor = default, BorderType borderType = BorderType.Reflect101)
{
if (size.IsEmpty) size = new Size(3, 3);
if (anchor.IsEmpty) anchor = new Point(-1, -1);
using (Mat dst = LayerMat)
{
CvInvoke.Blur(dst, dst, size, anchor, borderType);
LayerMat = dst;
}
}


public void MutatePyrDownUp(BorderType borderType = BorderType.Reflect101)
{
using (Mat dst = LayerMat)
Expand Down Expand Up @@ -762,6 +774,20 @@ public void MutateGaussianBlur(Size size = default, int sigmaX = 0, int sigmaY =
}
}

public void MutateFilter2D(IInputArray kernel = null, Point anchor = default, BorderType borderType = BorderType.Reflect101)
{
if (anchor.IsEmpty) anchor = new Point(-1, -1);
if (ReferenceEquals(kernel, null))
{
kernel = CvInvoke.GetStructuringElement(ElementShape.Rectangle, new Size(3, 3), anchor);
}
using (Mat dst = LayerMat)
{
CvInvoke.Filter2D(dst, dst, kernel, anchor, 0, borderType);
LayerMat = dst;
}
}

public void ChangeResolution(uint newResolutionX, uint newResolutionY, Rectangle roi)
{
using (var mat = LayerMat)
Expand Down
Loading

0 comments on commit 292db40

Please sign in to comment.