예제 #1
0
        public void OpenBmp_SaveJpeg <TPixel>(TestImageProvider <TPixel> provider, JpegSubsample subSample, int quality)
            where TPixel : struct, IPixel <TPixel>
        {
            using (Image <TPixel> image = provider.GetImage())
            {
                ImagingTestCaseUtility utility = provider.Utility;
                utility.TestName += "_" + subSample + "_Q" + quality;

                using (FileStream outputStream = File.OpenWrite(utility.GetTestOutputFileName("jpg")))
                {
                    image.Save(outputStream, new JpegEncoder()
                    {
                        Subsample = subSample,
                        Quality   = quality
                    });
                }
            }
        }
예제 #2
0
        public void OpenBmp_SaveJpeg <TColor>(TestImageProvider <TColor> provider, JpegSubsample subSample, int quality)
            where TColor : struct, IPackedPixel, IEquatable <TColor>
        {
            Image <TColor> image = provider.GetImage();

            ImagingTestCaseUtility utility = provider.Utility;

            utility.TestName += "_" + subSample + "_Q" + quality;

            using (var outputStream = File.OpenWrite(utility.GetTestOutputFileName("jpg")))
            {
                var encoder = new JpegEncoder()
                {
                    Subsample = subSample,
                    Quality   = quality
                };

                image.Save(outputStream, encoder);
            }
        }