diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-07-08 00:41:12 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-07-08 00:41:12 +0300 |
commit | 29c485458ce300e0085d9af01ce2ecc87fd0cbd5 (patch) | |
tree | 668baad2ef63010f22344a27c5edc0c88bde301d /UVtools.Core/Extensions/EmguExtensions.cs | |
parent | c56ddb904c5990fa9557882158333edfe9745fb8 (diff) |
v2.14.1v2.14.1
- (Upgrade) EmguCV from 4.5.1 to 4.5.2
- **File formats:**
- (Add) Getter `IsAntiAliasingEmulated`: Gets whatever a file format uses real or emulated AntiAliasing
- (Add) Getter `IsDisplayPortrait`: Gets if the display is in portrait mode
- (Add) Getter `IsDisplayLandscape`: Gets if the display is in landscape mode
- **Tool - Resize:** (#235)
- (Fix) Division by 0 when start layer is equal to end layer
- (Fix) Calculations when using the option "Increase or decrease towards 100%"
- (Add) About window: OpenCV build number and a button to copy build information to clipboard
- (Improvement) Exposure exposure finder: Improve the **Multiple brightness** section to auto fill with correct values for file formats that use time fractions to emulate AntiAliasing, this can be used to replace the **Multiple exposures** section
- (Fix) UVJ: Error when using a null or empty layer array on manifest `config.json` file (#232)
- (Fix) GCode parser: When only a G4/wait command is present on a layer it was setting the global exposure time and discard the this value per layer
Diffstat (limited to 'UVtools.Core/Extensions/EmguExtensions.cs')
-rw-r--r-- | UVtools.Core/Extensions/EmguExtensions.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/UVtools.Core/Extensions/EmguExtensions.cs b/UVtools.Core/Extensions/EmguExtensions.cs index 0399fa6..1a6cd42 100644 --- a/UVtools.Core/Extensions/EmguExtensions.cs +++ b/UVtools.Core/Extensions/EmguExtensions.cs @@ -346,9 +346,7 @@ namespace UVtools.Core.Extensions /// <returns></returns> public static byte[] GetPngByes(this Mat mat) { - using var vector = new VectorOfByte(); - CvInvoke.Imencode(".png", mat, vector); - return vector.ToArray(); + return CvInvoke.Imencode(".png", mat); } #endregion @@ -609,7 +607,7 @@ namespace UVtools.Core.Extensions /// <param name="thickness"></param> /// <param name="lineType"></param> /// <param name="flip"></param> - public static void DrawPolygon(this Mat src, int sides, int radius, Point center, MCvScalar color, double startingAngle = 0, int thickness = -1, LineType lineType = LineType.EightConnected, FlipType flip = FlipType.None) + public static void DrawPolygon(this Mat src, int sides, int radius, Point center, MCvScalar color, double startingAngle = 0, int thickness = -1, LineType lineType = LineType.EightConnected, FlipType? flip = null) { if (sides == 1) { @@ -627,8 +625,9 @@ namespace UVtools.Core.Extensions } var points = DrawingExtensions.GetPolygonVertices(sides, radius, center, startingAngle, - (flip & FlipType.Horizontal) != 0, (flip & FlipType.Vertical) != 0); - + flip is FlipType.Horizontal or FlipType.Both, + flip is FlipType.Vertical or FlipType.Both); + if (thickness <= 0) { using var vec = new VectorOfPoint(points); |