Removed useless switches to calculate blocksize when downscaling

This commit is contained in:
DarthAffe committed 2023-09-25 23:51:12 +02:00
1 parent c9ef36176d
commit 797a2bb7c1
2 files changed
+2 -24

No files matched your search

+1 -12
View File
@@ -131,18 +131,7 @@ public sealed class DX9ScreenCapture : AbstractScreenCapture<ColorBGRA>
ReadOnlySpan<byte> source = _buffer;
Span<byte> target = buffer;
int blockSize = captureZone.DownscaleLevel switch
{
1 => 2,
2 => 4,
3 => 8,
4 => 16,
5 => 32,
6 => 64,
7 => 128,
8 => 256,
_ => (int)Math.Pow(2, captureZone.DownscaleLevel),
};
int blockSize = 1 << captureZone.DownscaleLevel;
int offsetX = captureZone.X;
int offsetY = captureZone.Y;
+1 -12
View File
@@ -96,18 +96,7 @@ public sealed class X11ScreenCapture : AbstractScreenCapture<ColorBGRA>
ReadOnlySpan<byte> source = Data;
Span<byte> target = buffer;
int blockSize = captureZone.DownscaleLevel switch
{
1 => 2,
2 => 4,
3 => 8,
4 => 16,
5 => 32,
6 => 64,
7 => 128,
8 => 256,
_ => (int)Math.Pow(2, captureZone.DownscaleLevel),
};
int blockSize = 1 << captureZone.DownscaleLevel;
int offsetX = captureZone.X;
int offsetY = captureZone.Y;