diff options
Diffstat (limited to 'UVtools.Core/Layer/Layer.cs')
-rw-r--r-- | UVtools.Core/Layer/Layer.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/UVtools.Core/Layer/Layer.cs b/UVtools.Core/Layer/Layer.cs index 84df8fb..20fa46c 100644 --- a/UVtools.Core/Layer/Layer.cs +++ b/UVtools.Core/Layer/Layer.cs @@ -15,6 +15,7 @@ using Emgu.CV.Util; using UVtools.Core.Extensions; using UVtools.Core.FileFormats; using UVtools.Core.Objects; +using UVtools.Core.Operations; using Stream = System.IO.Stream; namespace UVtools.Core @@ -304,9 +305,7 @@ namespace UVtools.Core } set { - using var vector = new VectorOfByte(); - CvInvoke.Imencode(".png", value, vector); - CompressedBytes = vector.ToArray(); + CompressedBytes = value.GetPngByes(); GetBoundingRectangle(value, true); RaisePropertyChanged(); } @@ -502,6 +501,16 @@ namespace UVtools.Core #region Methods + public float CalculateLightOffDelay(float extraTime = 0) + { + return OperationCalculator.LightOffDelayC.CalculateSeconds(_liftHeight, _liftSpeed, _retractSpeed, extraTime); + } + + public void UpdateLightOffDelay(float extraTime = 0) + { + LightOffDelay = CalculateLightOffDelay(extraTime); + } + public string FormatFileName(string name) { return $"{name}{Index.ToString().PadLeft(ParentLayerManager.LayerDigits, '0')}.png"; |