diff options
Diffstat (limited to 'UVtools.Core/FileFormats/PHZFile.cs')
-rw-r--r-- | UVtools.Core/FileFormats/PHZFile.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/UVtools.Core/FileFormats/PHZFile.cs b/UVtools.Core/FileFormats/PHZFile.cs index 3131b43..6ede707 100644 --- a/UVtools.Core/FileFormats/PHZFile.cs +++ b/UVtools.Core/FileFormats/PHZFile.cs @@ -350,7 +350,7 @@ namespace UVtools.Core.FileFormats public static unsafe byte[] Encode(Mat image) { - List<byte> rawData = new List<byte>(); + List<byte> rawData = new(); var span = image.GetBytePointer(); var imageLength = image.GetLength(); @@ -481,7 +481,7 @@ namespace UVtools.Core.FileFormats if (Parent.HeaderSettings.EncryptionKey > 0) { - KeyRing kr = new KeyRing(Parent.HeaderSettings.EncryptionKey, layerIndex); + KeyRing kr = new(Parent.HeaderSettings.EncryptionKey, layerIndex); EncodedRle = kr.Read(EncodedRle); } @@ -541,7 +541,7 @@ namespace UVtools.Core.FileFormats public void Encode(Mat image, uint layerIndex) { - List<byte> rawData = new List<byte>(); + List<byte> rawData = new(); //byte color = byte.MaxValue >> 1; byte color = byte.MaxValue; @@ -606,7 +606,7 @@ namespace UVtools.Core.FileFormats if (Parent.HeaderSettings.EncryptionKey > 0) { - KeyRing kr = new KeyRing(Parent.HeaderSettings.EncryptionKey, layerIndex); + KeyRing kr = new(Parent.HeaderSettings.EncryptionKey, layerIndex); EncodedRle = kr.Read(rawData).ToArray(); } else @@ -655,7 +655,7 @@ namespace UVtools.Core.FileFormats public List<byte> Read(List<byte> input) { - List<byte> data = new List<byte>(input.Count); + List<byte> data = new(input.Count); data.AddRange(input.Select(t => (byte)(t ^ Next()))); return data; @@ -988,7 +988,7 @@ namespace UVtools.Core.FileFormats - Preview preview = new Preview + Preview preview = new() { ResolutionX = (uint) image.Width, ResolutionY = (uint) image.Height, @@ -1015,7 +1015,7 @@ namespace UVtools.Core.FileFormats Parallel.For(0, LayerCount, /*new ParallelOptions{MaxDegreeOfParallelism = 1},*/ layerIndex => { if(progress.Token.IsCancellationRequested) return; - LayerData layer = new LayerData(this, (uint) layerIndex); + LayerData layer = new(this, (uint) layerIndex); using (var image = this[layerIndex].LayerMat) { layer.Encode(image, (uint) layerIndex); |