mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
Refactorings
This commit is contained in:
@@ -0,0 +1,185 @@
|
||||
//--------------------------------------
|
||||
//--- 010 Editor v6.0.3 Binary Template
|
||||
//
|
||||
// File: ctb
|
||||
// Author: Tim Slater
|
||||
// Revision: 1
|
||||
// Purpose: CTB File Format
|
||||
//--------------------------------------
|
||||
|
||||
struct HEADER {
|
||||
uint Magic <fgcolor=cBlack, bgcolor=cRed, format=hex>;
|
||||
uint HeaderSize <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint HeaderOffset <fgcolor=cBlack, bgcolor=cRed, format=hex>;
|
||||
uint unknown1;
|
||||
uint unknown2;
|
||||
uint SignatureSize <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint SignatureOffset <fgcolor=cBlack, bgcolor=cRed, format=hex>;
|
||||
uint unknown3;
|
||||
ushort unknown4;
|
||||
ushort unknown5;
|
||||
uint unknown6;
|
||||
uint unknown7;
|
||||
uint unknown9;
|
||||
} header;
|
||||
|
||||
FSeek(header.HeaderOffset);
|
||||
|
||||
struct DECRYPTED_HEADER {
|
||||
uint64 checksumValue;
|
||||
uint LayerTableOffset;
|
||||
float SizeX;
|
||||
float SizeY;
|
||||
float SizeZ;
|
||||
uint Padding1;
|
||||
uint Padding2;
|
||||
float TotalHeightMilimeter;
|
||||
float LayerHeight;
|
||||
float ExposureTime;
|
||||
float BottomExposureTime;
|
||||
float LightOffDelay;
|
||||
uint BottomLayerCount;
|
||||
uint ResolutionX;
|
||||
uint ResolutionY;
|
||||
uint LayerCount;
|
||||
uint LargePreviewOffset;
|
||||
uint SmallPreviewOffset;
|
||||
uint PrintTime;
|
||||
uint unknown5;
|
||||
float BottomLiftHeight;
|
||||
float BottomLiftSpeed;
|
||||
float LiftHeight;
|
||||
float LiftSpeed;
|
||||
float RetractSpeed; /* might be bottom retract speed, need to verify */
|
||||
float ModelVolume;
|
||||
float ModelWeight;
|
||||
float Cost;
|
||||
float BottomLightOffDelay;
|
||||
uint unknown9;
|
||||
ushort LightPWM; /* these might be in the wrong order */
|
||||
ushort BottomLightPWM;
|
||||
uint LayerXorKey;
|
||||
float BottomLiftHeight2;
|
||||
float BottomLiftSpeed2;
|
||||
float LiftingHeight2;
|
||||
float LiftingSpeed2;
|
||||
float RetractHeight2;
|
||||
float RetractSpeed2;
|
||||
float RestTimeAfterLift;
|
||||
uint PrinterNameOffset;
|
||||
uint PrinterNameSize;
|
||||
uint unknown12;
|
||||
uint unknown13;
|
||||
uint unknown14;
|
||||
float RestTimeAfterRetract;
|
||||
float RestTimeAfterLift;
|
||||
uint unknown15;
|
||||
float BottomRetractSpeed;
|
||||
float BottomRetractSpeed2;
|
||||
uint unknown15;
|
||||
float unknown16;
|
||||
uint unknown17;
|
||||
float unknown18;
|
||||
float RestTimeAfterRetract;
|
||||
float RestTimeAfterLift;
|
||||
float RestTimeBeforeLift;
|
||||
float BottomRetractHeight;
|
||||
float unknown23;
|
||||
uint unknown24;
|
||||
uint unknown25;
|
||||
uint LastLayerIndex;
|
||||
uint unknown26[4];
|
||||
uint DisclaimerOffset;
|
||||
uint DisclaimerSize;
|
||||
uint Padding3;
|
||||
uint Padding4;
|
||||
uint Padding5;
|
||||
uint Padding6;
|
||||
};
|
||||
|
||||
|
||||
DECRYPTED_HEADER decryptedHeader;
|
||||
|
||||
struct PREVIEW {
|
||||
uint ResolutionX <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint ResolutionY <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint ImageOffset <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint ImageLength <fgcolor=cBlack, bgcolor=cRed>;
|
||||
|
||||
byte Data[ImageLength] <fgcolor=cBlack, bgcolor=cGreen>;
|
||||
} LargePreview;
|
||||
|
||||
PREVIEW SmallPreview;
|
||||
|
||||
FSeek(decryptedHeader.PrinterNameOffset);
|
||||
char MachineName[decryptedHeader.PrinterNameSize] <fgcolor=cBlack, bgcolor=cYellow>;
|
||||
|
||||
char Disclaimer[320] <fgcolor=cBlack, bgcolor=cPurple>;
|
||||
|
||||
FSeek(decryptedHeader.LayerTableOffset);
|
||||
|
||||
/* need to walk the layer index table to get a count of them.
|
||||
the actual count field is in the encrypted header */
|
||||
|
||||
struct LayerPointer {
|
||||
uint Offset;
|
||||
uint unknown1;
|
||||
uint unknown2;
|
||||
uint unknown3;
|
||||
} layerPointers[decryptedHeader.LayerCount];
|
||||
|
||||
struct LAYER_HEADER{
|
||||
uint LayerMarker <hidden=true>;
|
||||
float PositionZ;
|
||||
float ExposureTime;
|
||||
float LightOffDelay;
|
||||
uint LayerDataOffset;
|
||||
uint unknown2;
|
||||
uint LayerDataLength;
|
||||
uint unknown3;
|
||||
uint EncryptedDataOffset;
|
||||
uint EncryptedDataLength;
|
||||
float LiftHeight;
|
||||
float LiftSpeed;
|
||||
float LiftHeight2;
|
||||
float LiftSpeed2;
|
||||
float RetractSpeed;
|
||||
float RetractHeight2;
|
||||
float RetractSpeed2;
|
||||
float RestTimeBeforeLift;
|
||||
float RestTimeAfterLift;
|
||||
float RestTimeAfterRetract;
|
||||
float LightPWM; /* just a guess, has value 255 as a float */
|
||||
uint unknown6;
|
||||
};
|
||||
|
||||
struct LAYER {
|
||||
LAYER_HEADER layerHeader;
|
||||
FSeek(layerHeader.LayerDataOffset);
|
||||
|
||||
/* do we have encrypted data? */
|
||||
if (layerHeader.EncryptedDataLength > 0) {
|
||||
|
||||
if (layerHeader.EncryptedDataOffset > 0) {
|
||||
ubyte normalLayerData1[layerHeader.EncryptedDataOffset];
|
||||
ubyte encrytedLayerData[layerHeader.EncryptedDataLength];
|
||||
ubyte normalLayerData2[layerHeader.LayerDataLength - (layerHeader.EncryptedDataOffset + layerHeader.EncryptedDataLength)];
|
||||
} else {
|
||||
ubyte encrytedLayerData[layerHeader.EncryptedDataLength];
|
||||
ubyte normalLayerData[layerHeader.LayerDataLength - layerHeader.EncryptedDataLength];
|
||||
}
|
||||
|
||||
} else {
|
||||
ubyte layerData[layerHeader.LayerDataLength] <format=binary>;
|
||||
}
|
||||
};
|
||||
|
||||
struct LAYERS {
|
||||
local uint x;
|
||||
for(x = 0; x < decryptedHeader.LayerCount; x++) {
|
||||
FSeek(layerPointers[x].Offset);
|
||||
LAYER layer;
|
||||
}
|
||||
} layers;
|
||||
|
||||
ubyte Sha256Hash[0x20]<format=hex>;
|
||||
@@ -0,0 +1,132 @@
|
||||
//--------------------------------------
|
||||
//--- 010 Editor v6.0.3 Binary Template
|
||||
//
|
||||
// File: ctb
|
||||
// Author: Tim Slater
|
||||
// Revision: 1
|
||||
// Purpose: CTB File Format
|
||||
//--------------------------------------
|
||||
|
||||
struct HEADER {
|
||||
uint Magic <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint EncryptedHeaderSize <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint EncryptedHeaderOffset <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint unknown1;
|
||||
uint unknown2;
|
||||
uint SignatureSize <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint SignatureOffset <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint unknown3;
|
||||
ushort unknown4;
|
||||
ushort unknown5;
|
||||
uint unknown6;
|
||||
uint unknown7;
|
||||
uint unknown9;
|
||||
} header;
|
||||
|
||||
FSeek(header.EncryptedHeaderOffset);
|
||||
ubyte encryptedHeader[header.EncryptedHeaderSize];
|
||||
|
||||
struct PREVIEW {
|
||||
uint ResolutionX <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint ResolutionY <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint ImageOffset <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint ImageLength <fgcolor=cBlack, bgcolor=cRed>;
|
||||
|
||||
byte Data[ImageLength] <fgcolor=cBlack, bgcolor=cGreen>;
|
||||
} LargePreview;
|
||||
|
||||
PREVIEW SmallPreview;
|
||||
|
||||
local ushort machineNameLength = 1;
|
||||
while (ReadString(FTell()+machineNameLength, 17 ) != "Layout and record") {
|
||||
machineNameLength++;
|
||||
if(machineNameLength > 255) return;
|
||||
}
|
||||
|
||||
char MachineName[machineNameLength] <fgcolor=cBlack, bgcolor=cYellow>;
|
||||
|
||||
char Disclaimer[320] <fgcolor=cBlack, bgcolor=cPurple>;
|
||||
|
||||
/* need to walk the layer index table to get a count of them.
|
||||
the actual count field is in the encrypted header */
|
||||
local uint curOffset = FTell();
|
||||
local uint finalOffset;
|
||||
|
||||
while (true) {
|
||||
uint a <hidden=true>;
|
||||
uint b <hidden=true>;
|
||||
uint c <hidden=true>;
|
||||
uint d <hidden=true>;
|
||||
if (a == 88) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
FSkip(-16);
|
||||
finalOffset = FTell();
|
||||
local uint tableSize = finalOffset - curOffset;
|
||||
local uint layerCount = tableSize / 16;
|
||||
|
||||
FSeek(curOffset);
|
||||
|
||||
struct LAYER_POINTER {
|
||||
uint Offset <format=hex>;
|
||||
uint unknown1;
|
||||
uint unknown2;
|
||||
uint unknown3;
|
||||
} layerPointers[layerCount];
|
||||
|
||||
struct LAYER_HEADER{
|
||||
uint LayerMarker <hidden=true>;
|
||||
float PositionZ;
|
||||
float ExposureTime;
|
||||
float LightOffDelay;
|
||||
uint LayerDataOffset;
|
||||
uint unknown2;
|
||||
uint LayerDataLength;
|
||||
ubyte unknown3[4];
|
||||
uint EncryptedDataOffset;
|
||||
uint EncryptedDataLength;
|
||||
float LiftHeight;
|
||||
float LiftSpeed;
|
||||
float LiftHeight2;
|
||||
float LiftSpeed2;
|
||||
float RetractSpeed;
|
||||
float RetractHeight2;
|
||||
float RetractSpeed2;
|
||||
float RestTimeBeforeLift;
|
||||
float RestTimeAfterLift;
|
||||
float RestTimeAfterRetract;
|
||||
float LightPWM; /* just a guess, has value 255 as a float */
|
||||
uint unknown6;
|
||||
};
|
||||
|
||||
struct LAYER {
|
||||
LAYER_HEADER layerHeader;
|
||||
FSeek(layerHeader.LayerDataOffset);
|
||||
|
||||
/* do we have encrypted data? */
|
||||
if (layerHeader.EncryptedDataLength > 0) {
|
||||
|
||||
if (layerHeader.EncryptedDataOffset > 0) {
|
||||
ubyte normalLayerData1[layerHeader.EncryptedDataOffset];
|
||||
ubyte encrytedLayerData[layerHeader.EncryptedDataLength];
|
||||
ubyte normalLayerData2[layerHeader.LayerDataLength - (layerHeader.EncryptedDataOffset + layerHeader.EncryptedDataLength)];
|
||||
} else {
|
||||
ubyte encrytedLayerData[layerHeader.EncryptedDataLength];
|
||||
ubyte normalLayerData[layerHeader.LayerDataLength - layerHeader.EncryptedDataLength];
|
||||
}
|
||||
|
||||
} else {
|
||||
ubyte layerData[layerHeader.LayerDataLength] <format=binary>;
|
||||
}
|
||||
};
|
||||
|
||||
struct LAYERS {
|
||||
local uint x;
|
||||
for(x = 0; x < layerCount; x++) {
|
||||
FSeek(layerPointers[x].Offset);
|
||||
LAYER layer;
|
||||
}
|
||||
} layers;
|
||||
|
||||
ubyte Sha256Hash[0x20]<format=hex>;
|
||||
@@ -114,5 +114,45 @@ namespace UVtools.Core.Extensions
|
||||
}
|
||||
|
||||
|
||||
public static byte[] ToBytesLittleEndian(ulong value)
|
||||
{
|
||||
var bytes = new byte[8];
|
||||
ToBytesLittleEndian(value, bytes);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static void ToBytesLittleEndian(ulong value, byte[] buffer, ulong offset = 0)
|
||||
{
|
||||
buffer[offset] = (byte)value;
|
||||
buffer[offset + 1] = (byte)(value >> 8);
|
||||
buffer[offset + 2] = (byte)(value >> 16);
|
||||
buffer[offset + 3] = (byte)(value >> 24);
|
||||
|
||||
buffer[offset + 4] = (byte)(value >> 32);
|
||||
buffer[offset + 5] = (byte)(value >> 40);
|
||||
buffer[offset + 6] = (byte)(value >> 48);
|
||||
buffer[offset + 7] = (byte)(value >> 56);
|
||||
}
|
||||
|
||||
public static byte[] ToBytesBigEndian(ulong value)
|
||||
{
|
||||
var bytes = new byte[8];
|
||||
ToBytesBigEndian(value, bytes);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static void ToBytesBigEndian(ulong value, byte[] buffer, ulong offset = 0)
|
||||
{
|
||||
buffer[offset] = (byte)(value >> 56);
|
||||
buffer[offset + 1] = (byte)(value >> 48);
|
||||
buffer[offset + 2] = (byte)(value >> 40);
|
||||
buffer[offset + 3] = (byte)(value >> 32);
|
||||
buffer[offset + 4] = (byte)(value >> 24);
|
||||
buffer[offset + 5] = (byte)(value >> 16);
|
||||
buffer[offset + 6] = (byte)(value >> 8);
|
||||
buffer[offset + 7] = (byte)value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* Version 3, 19 November 2007
|
||||
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
* Everyone is permitted to copy and distribute verbatim copies
|
||||
* of this license document, but changing it is not allowed.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace UVtools.Core.Extensions
|
||||
{
|
||||
public static class CryptExtensions
|
||||
{
|
||||
public static SHA1CryptoServiceProvider SHA1 { get; } = new();
|
||||
public static string ComputeSHA1Hash(byte[] input)
|
||||
{
|
||||
return Convert.ToBase64String(SHA1.ComputeHash(input));
|
||||
}
|
||||
|
||||
public static SHA256 SHA256 { get; } = SHA256.Create();
|
||||
public static byte[] ComputeSHA256Hash(byte[] input)
|
||||
{
|
||||
return SHA256.ComputeHash(input);
|
||||
}
|
||||
|
||||
public static byte[] AesCryptBytes(byte[] data, byte[] key, CipherMode mode, PaddingMode paddingMode, bool encrypt, byte[] iv = null)
|
||||
{
|
||||
if (data.Length % 16 != 0)
|
||||
{
|
||||
var temp = new byte[((data.Length / 16) + 1) * 16];
|
||||
Array.Copy(data, 0, temp, 0, data.Length);
|
||||
data = temp;
|
||||
}
|
||||
|
||||
var aes = new AesManaged
|
||||
{
|
||||
KeySize = key.Length * 8,
|
||||
Key = key,
|
||||
Padding = paddingMode,
|
||||
Mode = mode,
|
||||
};
|
||||
|
||||
if (iv != null)
|
||||
{
|
||||
aes.IV = iv;
|
||||
}
|
||||
|
||||
var cryptor = encrypt ? aes.CreateEncryptor() : aes.CreateDecryptor();
|
||||
|
||||
using var msDecrypt = new MemoryStream(data);
|
||||
using var csDecrypt = new CryptoStream(msDecrypt, cryptor, CryptoStreamMode.Read);
|
||||
var outputBuffer = new byte[data.Length];
|
||||
csDecrypt.Read(outputBuffer, 0, data.Length);
|
||||
|
||||
return outputBuffer;
|
||||
}
|
||||
|
||||
public static MemoryStream AesCryptMemoryStream(byte[] data, byte[] key, CipherMode mode, PaddingMode paddingMode, bool encrypt, byte[] iv = null)
|
||||
=> new(AesCryptBytes(data, key, mode, paddingMode, encrypt, iv));
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1915,7 +1915,7 @@ namespace UVtools.Core.FileFormats
|
||||
|
||||
if (CanHash)
|
||||
{
|
||||
var hash = Helpers.ComputeSHA1Hash(layerDef.EncodedRle);
|
||||
var hash = CryptExtensions.ComputeSHA1Hash(layerDef.EncodedRle);
|
||||
if (layersHash.TryGetValue(hash, out layerDefHash))
|
||||
{
|
||||
layerDef.DataAddress = layerDefHash.DataAddress;
|
||||
|
||||
@@ -1032,7 +1032,7 @@ namespace UVtools.Core.FileFormats
|
||||
|
||||
if (HeaderSettings.EncryptionKey == 0)
|
||||
{
|
||||
string hash = Helpers.ComputeSHA1Hash(layerDef.EncodedRle);
|
||||
string hash = CryptExtensions.ComputeSHA1Hash(layerDef.EncodedRle);
|
||||
if (layersHash.TryGetValue(hash, out layerDefHash))
|
||||
{
|
||||
layerDef.DataAddress = layerDefHash.DataAddress;
|
||||
|
||||
@@ -543,7 +543,7 @@ namespace UVtools.Core.FileFormats
|
||||
progress.Token.ThrowIfCancellationRequested();
|
||||
|
||||
// Try to reuse layers
|
||||
var hash = Helpers.ComputeSHA1Hash(layerBytes[layerIndex]);
|
||||
var hash = CryptExtensions.ComputeSHA1Hash(layerBytes[layerIndex]);
|
||||
if (layersHash.TryGetValue(hash, out var address))
|
||||
{
|
||||
layerDataAddresses[layerIndex] = address;
|
||||
|
||||
@@ -1059,7 +1059,7 @@ namespace UVtools.Core.FileFormats
|
||||
|
||||
if (HeaderSettings.EncryptionKey == 0)
|
||||
{
|
||||
string hash = Helpers.ComputeSHA1Hash(layerDef.EncodedRle);
|
||||
string hash = CryptExtensions.ComputeSHA1Hash(layerDef.EncodedRle);
|
||||
if (layersHash.TryGetValue(hash, out layerDefHash))
|
||||
{
|
||||
layerDef.DataAddress = layerDefHash.DataAddress;
|
||||
|
||||
@@ -14,7 +14,6 @@ using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using BinarySerialization;
|
||||
using Emgu.CV;
|
||||
using Emgu.CV.CvEnum;
|
||||
using UVtools.Core.Extensions;
|
||||
using UVtools.Core.Operations;
|
||||
|
||||
@@ -1353,7 +1352,7 @@ namespace UVtools.Core.FileFormats
|
||||
|
||||
var layerDef = LayersDefinition.Layers[layerIndex];
|
||||
|
||||
var hash = Helpers.ComputeSHA1Hash(layerDef.EncodedRle);
|
||||
var hash = CryptExtensions.ComputeSHA1Hash(layerDef.EncodedRle);
|
||||
|
||||
if (layersHash.TryGetValue(hash, out var layerDataHash))
|
||||
{
|
||||
|
||||
@@ -51,53 +51,6 @@ namespace UVtools.Core
|
||||
return JsonConvert.DeserializeObject<T>(tr.ReadToEnd());
|
||||
}
|
||||
|
||||
public static SHA1CryptoServiceProvider SHA1 { get; } = new();
|
||||
public static string ComputeSHA1Hash(byte[] input)
|
||||
{
|
||||
return Convert.ToBase64String(SHA1.ComputeHash(input));
|
||||
}
|
||||
|
||||
public static SHA256 SHA256 { get; } = SHA256.Create();
|
||||
public static byte[] ComputeSHA256Hash(byte[] input)
|
||||
{
|
||||
return SHA256.ComputeHash(input);
|
||||
}
|
||||
|
||||
public static byte[] AesCryptBytes(byte[] data, byte[] key, CipherMode mode, PaddingMode paddingMode, bool encrypt, byte[] iv = null)
|
||||
{
|
||||
if (data.Length % 0x10 != 0)
|
||||
{
|
||||
byte[] temp = new byte[((data.Length / 0x10) + 1) * 0x10];
|
||||
Array.Copy(data, 0, temp, 0, data.Length);
|
||||
data = temp;
|
||||
}
|
||||
|
||||
|
||||
AesManaged aes = new AesManaged();
|
||||
|
||||
aes.KeySize = key.Length * 8;
|
||||
aes.Key = key;
|
||||
aes.Padding = paddingMode;
|
||||
aes.Mode = mode;
|
||||
if (iv != null)
|
||||
{
|
||||
aes.IV = iv;
|
||||
}
|
||||
ICryptoTransform cryptor = encrypt ? aes.CreateEncryptor() : aes.CreateDecryptor();
|
||||
|
||||
byte[] outputBuffer = null;
|
||||
using (MemoryStream msDecrypt = new MemoryStream(data))
|
||||
{
|
||||
using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, cryptor, CryptoStreamMode.Read))
|
||||
{
|
||||
outputBuffer = new byte[data.Length];
|
||||
csDecrypt.Read(outputBuffer, 0, data.Length);
|
||||
}
|
||||
}
|
||||
|
||||
return outputBuffer;
|
||||
}
|
||||
|
||||
public static bool SetPropertyValue(PropertyInfo attribute, object obj, string value)
|
||||
{
|
||||
var name = attribute.PropertyType.Name.ToLower();
|
||||
|
||||
@@ -424,9 +424,15 @@ namespace UVtools.Core
|
||||
if (ParentLayerManager is not null)
|
||||
ParentLayerManager.BoundingRectangle = Rectangle.Empty;
|
||||
RaisePropertyChanged();
|
||||
RaisePropertyChanged(nameof(HaveImage));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True if this layer have an valid initialized image, otherwise false
|
||||
/// </summary>
|
||||
public bool HaveImage => _compressedBytes is not null && _compressedBytes.Length > 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a new image instance
|
||||
/// </summary>
|
||||
@@ -1023,6 +1029,15 @@ namespace UVtools.Core
|
||||
return result;
|
||||
}*/
|
||||
|
||||
public void CopyImageTo(Layer layer)
|
||||
{
|
||||
if (!HaveImage) return;
|
||||
layer.CompressedBytes = _compressedBytes.ToArray();
|
||||
layer.BoundingRectangle = _boundingRectangle;
|
||||
layer.NonZeroPixelCount = _nonZeroPixelCount;
|
||||
|
||||
}
|
||||
|
||||
public Layer Clone()
|
||||
{
|
||||
//var layer = (Layer)MemberwiseClone();
|
||||
|
||||
Reference in New Issue
Block a user