Browse Source
Merge pull request #1362 from rold2007/master
Fixed typo in AdaptiveThreshold
js/color-alpha-handling
Brian Popow
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
4 additions and
2 deletions
-
src/ImageSharp/Processing/Processors/Binarization/AdaptiveThresholdProcessor{TPixel}.cs
-
tests/ImageSharp.Tests/Processing/Binarization/AdaptiveThresholdTests.cs
-
tests/Images/External
|
|
|
@ -67,7 +67,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Binarization |
|
|
|
ref TPixel color = ref Unsafe.Add(ref rowRef, x); |
|
|
|
color.ToRgba32(ref rgb); |
|
|
|
|
|
|
|
sum += (ulong)(rgb.R + rgb.G + rgb.G); |
|
|
|
sum += (ulong)(rgb.R + rgb.G + rgb.B); |
|
|
|
|
|
|
|
if (x - startX != 0) |
|
|
|
{ |
|
|
|
intImage[x - startX, y - startY] = intImage[x - startX - 1, y - startY] + sum; |
|
|
|
|
|
|
|
@ -100,6 +100,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Binarization |
|
|
|
[Theory] |
|
|
|
[WithFile(TestImages.Png.Bradley01, PixelTypes.Rgba32)] |
|
|
|
[WithFile(TestImages.Png.Bradley02, PixelTypes.Rgba32)] |
|
|
|
[WithFile(TestImages.Png.Ducky, PixelTypes.Rgba32)] |
|
|
|
public void AdaptiveThreshold_Works<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
|
|
|
|
@ -1 +1 @@ |
|
|
|
Subproject commit 6a003080674d1fedc66292c13ce5a357b2a33083 |
|
|
|
Subproject commit 28839f6eaa212a575005df630b6030bb4314a75b |