Skip to content

Commit 9266321

Browse files
committed
remove unused LoadTest1()
1 parent a390fc6 commit 9266321

1 file changed

Lines changed: 0 additions & 43 deletions

File tree

IronSoftware.Drawing/IronSoftware.Drawing.Common.Tests/UnitTests/AnyBitmapFunctionality.cs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,48 +1167,5 @@ public void AnyBitmap_ExportTiff_Should_Works()
11671167
Image.DetectFormat(resultExport.ToArray()).Should().Be(SixLabors.ImageSharp.Formats.Tiff.TiffFormat.Instance);
11681168
}
11691169

1170-
1171-
//this should be faster than previous
1172-
//for manual test only
1173-
//[FactWithAutomaticDisplayName]
1174-
public void LoadTest1()
1175-
{
1176-
for (int i = 0; i < 50; i++)
1177-
{
1178-
string imagePath = GetRelativeFilePath("google_large_1500dpi.bmp");
1179-
var anyBitmap = AnyBitmap.FromFile(imagePath);
1180-
var imgFormat = anyBitmap.GetImageFormat();
1181-
var pixDepth = anyBitmap.BitsPerPixel;
1182-
if (pixDepth != 32)
1183-
{
1184-
anyBitmap = AnyBitmap.FromBytes(anyBitmap.GetBytes(), false);
1185-
pixDepth = anyBitmap.BitsPerPixel;
1186-
}
1187-
1188-
//var w = anyBitmap.Width;
1189-
//var h = anyBitmap.Height;
1190-
1191-
var rgba = anyBitmap.GetRGBABuffer();
1192-
1193-
1194-
for (int y = 0; y < anyBitmap.Height; y++) //calling anyBitmap.Height in the loop make it slower
1195-
{
1196-
for (int x = 0; x < anyBitmap.Width; x++)
1197-
{
1198-
int rgbaIndex = ((y * anyBitmap.Width) + x) * 4;
1199-
EncodeAsRGBA(rgba[rgbaIndex],
1200-
rgba[rgbaIndex + 1], rgba[rgbaIndex + 2], rgba[rgbaIndex + 3]);
1201-
}
1202-
}
1203-
}
1204-
1205-
uint EncodeAsRGBA(byte red, byte green, byte blue, byte alpha)
1206-
{
1207-
return (uint)((red << 24) |
1208-
(green << 16) |
1209-
(blue << 8) |
1210-
alpha);
1211-
}
1212-
}
12131170
}
12141171
}

0 commit comments

Comments
 (0)