|
|
@ -293,4 +293,21 @@ public class DrawImageTests |
|
|
appendPixelTypeToFileName: false, |
|
|
appendPixelTypeToFileName: false, |
|
|
appendSourceFileOrDescription: false); |
|
|
appendSourceFileOrDescription: false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
|
|
|
[WithFile(TestImages.Gif.Giphy, PixelTypes.Rgba32)] |
|
|
|
|
|
public void DrawImageAnimatedForegroundRepeatCount<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
|
|
{ |
|
|
|
|
|
using Image<TPixel> background = provider.GetImage(); |
|
|
|
|
|
using Image<TPixel> foreground = Image.Load<TPixel>(TestFile.Create(TestImages.Gif.Giphy).Bytes); |
|
|
|
|
|
|
|
|
|
|
|
Size size = new(foreground.Width / 4, foreground.Height / 4); |
|
|
|
|
|
foreground.Mutate(x => x.Resize(size.Width, size.Height, KnownResamplers.Bicubic)); |
|
|
|
|
|
|
|
|
|
|
|
background.Mutate(x => x.DrawImage(foreground, Point.Empty, 1F, 0)); |
|
|
|
|
|
|
|
|
|
|
|
background.DebugSaveMultiFrame(provider); |
|
|
|
|
|
background.CompareToReferenceOutputMultiFrame(provider, ImageComparer.TolerantPercentage(0.01f)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|