public void UpdateTest(string atlasFile, string textureNameToUpdate, string newTexture) { TexAtlas atlas = new TexAtlas(TexAtlas.TexLayout.Import(Module.PathToInputImages + Path.GetFileNameWithoutExtension(atlasFile) + TexAtlas.TexLayout.Extension), TestTools.Load(fiLib, atlasFile)); var updateTexture = TestTools.Load(fiLib, newTexture); library.Execute(atlas, new AtlasUpdateRequest(updateTexture, textureNameToUpdate)); library.EndLibrary(atlas); //Console.WriteLine("AtlasTexLibrary_Update_" + textureNameToUpdate + "_" + atlasFile + "." + TestTools.ComputeSHA1(atlas.Data, atlas.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["AtlasTexLibrary_Update_" + textureNameToUpdate + "_" + atlasFile], TestTools.ComputeSHA1(atlas.Data, atlas.DataSize)); updateTexture.Dispose(); atlas.Dispose(); }
public void RemoveTest(string arrayFile, int indice) { TexImage array = TestTools.Load(dxtLib, arrayFile); int arraySize = array.ArraySize; dxtLib.EndLibrary(array); library.StartLibrary(array); // for fun cause it's empty library.Execute(array, new ArrayElementRemovalRequest(indice)); array.CurrentLibrary = library; array.Update(); Assert.True(arraySize == array.ArraySize + 1); //Console.WriteLine("ArrayTexLibrary_Remove_" + indice + "_" + arrayFile + "." + TestTools.ComputeSHA1(array.Data, array.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["ArrayTexLibrary_Remove_" + indice + "_" + arrayFile], TestTools.ComputeSHA1(array.Data, array.DataSize)); array.Dispose(); }
public void CreateArrayTest(string file1, string file2) { var list = new List <TexImage>(); for (int i = 0; i < 5; ++i) { var temp = new TexImage(); fiLib.Execute(temp, new LoadingRequest(Module.PathToAtlasImages + file1, false)); list.Add(temp); temp = new TexImage(); fiLib.Execute(temp, new LoadingRequest(Module.PathToAtlasImages + file2, false)); list.Add(temp); } var array = new TexImage(); library.Execute(array, new ArrayCreationRequest(list)); Assert.True(array.ArraySize == list.Count); //Console.WriteLine("ArrayTexLibrary_CreateArray_" + Path.GetFileName(file1) + "_" + Path.GetFileName(file2) + "." + TestTools.ComputeSHA1(array.Data, array.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["ArrayTexLibrary_CreateArray_" + Path.GetFileName(file1) + "_" + Path.GetFileName(file2)], TestTools.ComputeSHA1(array.Data, array.DataSize)); array.Dispose(); foreach (var image in list) { image.Dispose(); } }
public void UpdateArrayTest(string arrayFile, string textureName, int indice) { var array = texTool.Load(Module.PathToInputImages + arrayFile); var updateTexture = texTool.Load(Module.PathToInputImages + textureName); texTool.Update(array, updateTexture, indice); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_UpdateArray_" + arrayFile + "_" + indice + "_" + Path.GetFileName(textureName)], TestTools.ComputeSHA1(array.Data, array.DataSize)); //Console.WriteLine("TextureTool_UpdateArray_" + arrayFile + "_" + indice + "_" + Path.GetFileName(textureName) + "." + TestTools.ComputeSHA1(array.Data, array.DataSize)); array.Dispose(); updateTexture.Dispose(); try { texTool.Update(array, updateTexture, array.ArraySize); Assert.True(false); } catch (TextureToolsException) { Assert.True(true); } }
public void ExtractAllTest(string file1, string file2) { var list = new List <TexImage>(); for (int i = 0; i < 5; ++i) { var temp = new TexImage(); fiLib.Execute(temp, new LoadingRequest(Module.PathToInputImages + file1, false)); temp.Name = Path.GetFileName(file1); list.Add(temp); //Console.WriteLine("ExtractAll_" + Path.GetFileName(file1) + "." + TestTools.ComputeSHA1(temp.Data, temp.DataSize)); temp = new TexImage(); fiLib.Execute(temp, new LoadingRequest(Module.PathToInputImages + file2, false)); temp.Name = Path.GetFileName(file2); list.Add(temp); //Console.WriteLine("ExtractAll_" + Path.GetFileName(file2) + "." + TestTools.ComputeSHA1(temp.Data, temp.DataSize)); } var array = new TexImage(); library.Execute(array, new ArrayCreationRequest(list)); var request = new ArrayExtractionRequest(0); library.Execute(array, request); library.EndLibrary(array); Assert.True(list.Count == request.Textures.Count); for (int i = 0; i < array.ArraySize; ++i) { var temp = request.Textures[i]; Assert.Equal(TestTools.GetInstance().Checksum["ExtractAll_" + list[i].Name], TestTools.ComputeSHA1(temp.Data, temp.DataSize)); temp.Dispose(); } array.Dispose(); foreach (var image in list) { image.Dispose(); } }
public void ExtractTest(string arrayFile, int indice) { TexImage array = texTool.Load(Module.PathToInputImages + arrayFile); var extracted = texTool.Extract(array, indice); //Console.WriteLine("TextureTool_Extract_" + indice + "_" + arrayFile + "." + TestTools.ComputeSHA1(extracted.Data, extracted.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_Extract_" + indice + "_" + arrayFile], TestTools.ComputeSHA1(extracted.Data, extracted.DataSize)); extracted.Dispose(); array.Dispose(); }
public void InsertTest(string arrayFile, string newTexture, int indice) { var array = texTool.Load(Module.PathToInputImages + arrayFile); var texture = texTool.Load(Module.PathToInputImages + newTexture); texTool.Compress(texture, PixelFormat.BC3_UNorm); texTool.Insert(array, texture, indice); //Console.WriteLine("TextureTool_Insert_" + indice + "_" + Path.GetFileName(newTexture) + "_" + arrayFile + "." + TestTools.ComputeSHA1(array.Data, array.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_Insert_" + indice + "_" + Path.GetFileName(newTexture) + "_" + arrayFile], TestTools.ComputeSHA1(array.Data, array.DataSize)); try { texTool.Insert(array, texture, array.ArraySize + 1); Assert.True(false); } catch (TextureToolsException) { Assert.True(true); } array.Dispose(); texture.Dispose(); }
public void CorrectGammaTest(string file) { TexImage image = texTool.Load(Module.PathToInputImages + file); texTool.CorrectGamma(image, 1 / 2.2); image.Update(); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_CorrectGamma_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); //Console.WriteLine("TextureTool_CorrectGamma_" + image.Name + "." + TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); }
public void GenerateNormalMapTest(string file) { TexImage image = texTool.Load(Module.PathToInputImages + file); var normal = texTool.GenerateNormalMap(image, 0.5f); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_GenerateNormalMap_" + image.Name], TestTools.ComputeSHA1(normal.Data, normal.DataSize)); //Console.WriteLine("TextureTool_GenerateNormalMap_" + image.Name + "." + TestTools.ComputeSHA1(normal.Data, normal.DataSize)); normal.Dispose(); image.Dispose(); }
public void CompressTest(string filename, PixelFormat format) { TexImage image = texTool.Load(Module.PathToInputImages + filename); texTool.Compress(image, format); Assert.True(image.Format == format); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_Compress_" + format + "_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); //Console.WriteLine("TextureTool_Compress_" + format + "_" + image.Name + "." + TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); }
public void GenerateMipMapTest(string file, Filter.MipMapGeneration filter) { TexImage image = texTool.Load(Module.PathToInputImages + file); texTool.GenerateMipMaps(image, filter); Assert.True(image.MipmapCount > 1); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_GenerateMipMap_" + filter + "_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); //Console.WriteLine("TextureTool_GenerateMipMap_" + filter + "_" + image.Name + "." + TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); }
public void PreMultiplyAlphaTest(string file) { TexImage image = texTool.Load(Module.PathToInputImages + file); texTool.PreMultiplyAlpha(image); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_PreMultiplyAlpha_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); //Console.WriteLine("TextureTool_PreMultiplyAlpha_" + image.Name + "." + TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); }
public void ExtractTest(string atlasFile, string extractedName) { TexAtlas atlas = new TexAtlas(TexAtlas.TexLayout.Import(Module.PathToInputImages + Path.GetFileNameWithoutExtension(atlasFile) + TexAtlas.TexLayout.Extension), TestTools.Load(dxtLib, atlasFile)); var request = new AtlasExtractionRequest(extractedName, 16); library.Execute(atlas, request); atlas.CurrentLibrary = library; var extracted = request.Texture; string nameWOExtension = Path.GetFileNameWithoutExtension(extractedName); //Console.WriteLine("AtlasTexLibrary_Extract_" + nameWOExtension + ".dds." + TestTools.ComputeSHA1(extracted.Data, extracted.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["AtlasTexLibrary_Extract_" + nameWOExtension + ".dds"], TestTools.ComputeSHA1(extracted.Data, extracted.DataSize)); extracted.Dispose(); atlas.Dispose(); }
public void CreateAtlasTest(string directory, bool generateMipMaps, bool forceSquaredAtlas) { string path = Module.PathToInputImages + directory; string[] fileList = Directory.GetFiles(path); var list = new List <TexImage>(fileList.Length); foreach (string filePath in fileList) { var temp = Load(fiLib, filePath); list.Add(temp); if (generateMipMaps) { fiLib.EndLibrary(temp); dxtLib.StartLibrary(temp); dxtLib.Execute(temp, new MipMapsGenerationRequest(Filter.MipMapGeneration.Cubic)); temp.CurrentLibrary = dxtLib; } } var atlas = new TexAtlas(); library.Execute(atlas, new AtlasCreationRequest(list, forceSquaredAtlas)); //Console.WriteLine("AtlasTexLibrary_CreateAtlas_" + generateMipMaps + "_" + forceSquaredAtlas + "." + TestTools.ComputeSHA1(atlas.Data, atlas.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["AtlasTexLibrary_CreateAtlas_" + generateMipMaps + "_" + forceSquaredAtlas], TestTools.ComputeSHA1(atlas.Data, atlas.DataSize)); if (forceSquaredAtlas) { Assert.True(atlas.Width == atlas.Height); } atlas.Dispose(); foreach (var image in list) { image.Dispose(); } }
public void DecompressTest() { TexImage img; int mipmapCount, arraySize, width, height, depth, subImageArrayLenght; // ------------------- Test with BC3 image ------------------- img = texTool.Load(Module.PathToInputImages + "TextureArray_WMipMaps_BC3.dds"); Assert.True(img.Format == PixelFormat.BC3_UNorm); mipmapCount = img.MipmapCount; arraySize = img.ArraySize; width = img.Width; height = img.Height; depth = img.Depth; subImageArrayLenght = img.SubImageArray.Length; texTool.Decompress(img, false); Assert.True(img.Format == PixelFormat.R8G8B8A8_UNorm); Assert.True(mipmapCount == img.MipmapCount); Assert.True(arraySize == img.ArraySize); Assert.True(width == img.Width); Assert.True(height == img.Height); Assert.True(depth == img.Depth); Assert.True(subImageArrayLenght == img.SubImageArray.Length); Assert.Equal(TestTools.GetInstance().Checksum["DecompressTest_TextureArray_WMipMaps_BC3.dds"], TestTools.ComputeSHA1(img.Data, img.DataSize)); img.Dispose(); // ------------------- Test with uncompress image ------------------- img = texTool.Load(Module.PathToInputImages + "stones.png"); texTool.Decompress(img, false); Assert.True(img.Format == PixelFormat.B8G8R8A8_UNorm); //FITexLibrary loads image in BGRA order... img.Dispose(); }
public void ResizeTest(string file) { TexImage image = texTool.Load(Module.PathToInputImages + file); int width = image.Width; int height = image.Height; Assert.True(image.MipmapCount > 1); texTool.Resize(image, width / 2, height / 2, Filter.Rescaling.Bicubic); Assert.True(image.Width == width / 2); Assert.True(image.Height == height / 2); Assert.True(image.MipmapCount == 1); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_Rescale_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); //Console.WriteLine("TextureTool_Rescale_" + image.Name + "." + TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); }
public void CreateCubeTest(string file1, string file2) { var list = new List <TexImage>(); for (int i = 0; i < 3; ++i) { list.Add(texTool.Load(Module.PathToInputImages + file1)); list.Add(texTool.Load(Module.PathToInputImages + file2)); } var array = texTool.CreateTextureCube(list); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_CreateCube_" + Path.GetFileName(file1) + "_" + Path.GetFileName(file2)], TestTools.ComputeSHA1(array.Data, array.DataSize)); //Console.WriteLine("TextureTool_CreateCube_" + Path.GetFileName(file1) + "_" + Path.GetFileName(file2) + "." + TestTools.ComputeSHA1(array.Data, array.DataSize)); array.Dispose(); foreach (var image in list) { image.Dispose(); } }
public void SwitchChannelTest(string file) { var image = texTool.Load(Module.PathToInputImages + file); var isInBgraOrder = image.Format.IsBGRAOrder(); texTool.SwitchChannel(image); image.Update(); Assert.True(isInBgraOrder != image.Format.IsBGRAOrder()); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_SwitchChannel_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); //Console.WriteLine("TextureTool_SwitchChannel_" + image.Name + "." + TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); }
public void ExtractAllTest(string file1, string file2) { var list = new List <TexImage>(); for (int i = 0; i < 5; ++i) { list.Add(texTool.Load(Module.PathToInputImages + file1)); //Console.WriteLine("ArrayTexLibrary_ExtractAll_" + Path.GetFileName(file1) + "." + TestTools.ComputeSHA1(temp.Data, temp.DataSize)); list.Add(texTool.Load(Module.PathToInputImages + file2)); //Console.WriteLine("ArrayTexLibrary_ExtractAll_" + Path.GetFileName(file2) + "." + TestTools.ComputeSHA1(temp.Data, temp.DataSize)); } var array = texTool.CreateTextureArray(list); var extracted = texTool.ExtractAll(array); Assert.True(list.Count == extracted.Count); for (int i = 0; i < array.ArraySize; ++i) { Assert.Equal(TestTools.GetInstance().Checksum["ExtractAll_" + list[i].Name], TestTools.ComputeSHA1(extracted[i].Data, extracted[i].DataSize)); extracted[i].Dispose(); } array.Dispose(); foreach (var image in list) { image.Dispose(); } }
public void SaveTest(string input, string extension, PixelFormat compressionFormat, int minimumMipmapSize) { TexImage image = texTool.Load(Module.PathToInputImages + input); string output = Path.GetFileNameWithoutExtension(input) + extension; if (compressionFormat == PixelFormat.None) { texTool.Save(image, Module.PathToOutputImages + output, minimumMipmapSize); } else { texTool.Save(image, Module.PathToOutputImages + output, compressionFormat, minimumMipmapSize); } Assert.True(File.Exists(Module.PathToOutputImages + output)); var loaded = texTool.Load(Module.PathToOutputImages + output); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_Save_" + compressionFormat + "_" + minimumMipmapSize + "_" + loaded.Name], TestTools.ComputeSHA1(loaded.Data, loaded.DataSize)); //Console.WriteLine("TextureTool_Save_" + compressionFormat + "_" + minimumMipmapSize + "_" + loaded.Name + "." + TestTools.ComputeSHA1(loaded.Data, loaded.DataSize)); File.Delete(Module.PathToOutputImages + output); loaded.Dispose(); image.Dispose(); }
public void RemoveTest(string arrayFile, int indice) { var array = texTool.Load(Module.PathToInputImages + arrayFile); texTool.Remove(array, indice); //Console.WriteLine("TextureTool_Remove_" + indice + "_" + arrayFile + "." + TestTools.ComputeSHA1(array.Data, array.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_Remove_" + indice + "_" + arrayFile], TestTools.ComputeSHA1(array.Data, array.DataSize)); try { texTool.Remove(array, array.ArraySize); Assert.True(false); } catch (TextureToolsException) { Assert.True(true); } array.Dispose(); }
public void CreateAtlasTest() { string[] fileList = Directory.GetFiles(Module.PathToInputImages + "atlas/"); var list = new List <TexImage>(fileList.Length); foreach (string filePath in fileList) { list.Add(texTool.Load(filePath)); } var atlas = texTool.CreateAtlas(list); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_CreateAtlas"], TestTools.ComputeSHA1(atlas.Data, atlas.DataSize)); //Console.WriteLine("TextureTool_CreateAtlas." + TestTools.ComputeSHA1(atlas.Data, atlas.DataSize)); atlas.Dispose(); var another = texTool.Load(fileList[fileList.Length - 1]); texTool.Compress(another, PixelFormat.BC3_UNorm); list.Add(another); try { atlas = texTool.CreateAtlas(list); Assert.True(false); } catch (TextureToolsException) { Assert.True(true); } foreach (var image in list) { image.Dispose(); } }
public void FlipTest(string file, Orientation orientation) { TexImage image = texTool.Load(Module.PathToInputImages + file); texTool.Flip(image, orientation); image.Update(); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_Flip_" + orientation + "_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); //Console.WriteLine("TextureTool_Flip_" + orientation + "_" + image.Name + "." + TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); }
public void ExtractAtlasTest(string atlasFile, string textureName) { var atlas = texTool.LoadAtlas(Module.PathToInputImages + atlasFile); var extracted = texTool.Extract(atlas, textureName, 16); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_ExtractAtlas_" + atlasFile + "_" + textureName], TestTools.ComputeSHA1(extracted.Data, extracted.DataSize)); //Console.WriteLine("TextureTool_ExtractAtlas_" + atlasFile + "_" + textureName + "." + TestTools.ComputeSHA1(extracted.Data, extracted.DataSize)); extracted.Dispose(); atlas.Dispose(); }
public void UpdateTest(string arrayFile, int indice, string newTexture) { TexImage array = TestTools.Load(dxtLib, arrayFile); dxtLib.EndLibrary(array); var updateTexture = TestTools.Load(fiLib, newTexture); library.Execute(array, new ArrayUpdateRequest(updateTexture, indice)); library.EndLibrary(array); //Console.WriteLine("ArrayTexLibrary_Update_" + indice + "_" + arrayFile + "." + TestTools.ComputeSHA1(array.Data, array.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["ArrayTexLibrary_Update_" + indice + "_" + arrayFile], TestTools.ComputeSHA1(array.Data, array.DataSize)); updateTexture.Dispose(); array.Dispose(); }
public void ExtractAllAtlasTest(string atlasFile) { string[] fileList = Directory.GetFiles(Module.PathToInputImages + "atlas/"); var list = new List <TexImage>(fileList.Length); foreach (string filePath in fileList) { list.Add(texTool.Load(filePath)); } var atlas = texTool.CreateAtlas(list); var extracted = texTool.ExtractAll(atlas); Assert.True(extracted.Count == list.Count); foreach (var image in extracted) { Assert.Equal(TestTools.GetInstance().Checksum["ExtractAll_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); } atlas.Dispose(); foreach (var image in list) { image.Dispose(); } }
public void InsertTest(string arrayFile, string newTexture, int indice) { TexImage array = TestTools.Load(dxtLib, arrayFile); int arraySize = array.ArraySize; var texture = TestTools.Load(fiLib, newTexture); dxtLib.EndLibrary(array); library.StartLibrary(array); // for fun cause it's empty library.Execute(array, new ArrayInsertionRequest(texture, indice)); array.CurrentLibrary = library; array.Update(); Assert.True(arraySize == array.ArraySize - 1); //Console.WriteLine("ArrayTexLibrary_Insert_" + Path.GetFileName(newTexture) + "_" + indice + "_" + arrayFile + "." + TestTools.ComputeSHA1(array.Data, array.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["ArrayTexLibrary_Insert_" + Path.GetFileName(newTexture) + "_" + indice + "_" + arrayFile], TestTools.ComputeSHA1(array.Data, array.DataSize)); array.Dispose(); }
public void UpdateAtlasTest(string atlasFile, string textureName) { var atlas = texTool.LoadAtlas(TexAtlas.TexLayout.Import(Module.PathToInputImages + Path.GetFileNameWithoutExtension(atlasFile) + TexAtlas.TexLayout.Extension), Module.PathToInputImages + atlasFile); var updateTexture = texTool.Load(Module.PathToInputImages + textureName); texTool.Update(atlas, updateTexture); Assert.Equal(TestTools.GetInstance().Checksum["TextureTool_UpdateAtlas_" + atlasFile + "_" + Path.GetFileName(textureName)], TestTools.ComputeSHA1(atlas.Data, atlas.DataSize)); //Console.WriteLine("TextureTool_UpdateAtlas_" + atlasFile + "_" + Path.GetFileName(textureName) + "." + TestTools.ComputeSHA1(atlas.Data, atlas.DataSize)); atlas.Dispose(); updateTexture.Dispose(); }
public void ExtractTest(string arrayFile, int indice) { TexImage array = TestTools.Load(dxtLib, arrayFile); var request = new ArrayExtractionRequest(indice, 16); library.Execute(array, request); array.CurrentLibrary = library; var extracted = request.Texture; //Console.WriteLine("ArrayTexLibrary_Extract_" + arrayFile + "." + TestTools.ComputeSHA1(extracted.Data, extracted.DataSize)); Assert.Equal(TestTools.GetInstance().Checksum["ArrayTexLibrary_Extract_" + arrayFile], TestTools.ComputeSHA1(extracted.Data, extracted.DataSize)); extracted.Dispose(); array.Dispose(); }
public void ExtractAllTest(string directory) { string path = Module.PathToInputImages + directory; string[] fileList = Directory.GetFiles(path); var list = new List <TexImage>(fileList.Length); foreach (string filePath in fileList) { var temp = Load(fiLib, filePath); list.Add(temp); //Console.WriteLine("ExtractAll_" + Path.GetFileName(filePath) + "." + TestTools.ComputeSHA1(temp.Data, temp.DataSize)); } var atlas = new TexAtlas(); library.Execute(atlas, new AtlasCreationRequest(list)); var request = new AtlasExtractionRequest(0); library.Execute(atlas, request); library.EndLibrary(atlas); Assert.True(list.Count == request.Textures.Count); foreach (var image in request.Textures) { Assert.Equal(TestTools.GetInstance().Checksum["ExtractAll_" + image.Name], TestTools.ComputeSHA1(image.Data, image.DataSize)); image.Dispose(); } atlas.Dispose(); foreach (var image in list) { image.Dispose(); } }