Example #1
0
        public void TestThatFileIsEncodedThenDecodedCorrectly1(NearLosslessPredictorType predictorType)
        {
            var filepathImage = $"{Environment.CurrentDirectory}\\Images\\Lenna256an.bmp";

            TestMethods.CopyFileAndReplaceIfAlreadyExists(filepathImage, filepathSource);

            encoder.Encode(filepathSource, filepathEncodedFile, GetOptions(predictorType));
            decoder.Decode(filepathEncodedFile, filepathDecodedFile);

            Assert.IsTrue(TestMethods.FilesHaveTheSameContent(filepathSource, filepathDecodedFile));
        }
Example #2
0
        private void PredictClick(object sender, EventArgs e)
        {
            var options = GetOptions();
            var filePathEncodedImage = $"{filePathOriginalImage}.pre";

            if (File.Exists(filePathEncodedImage))
            {
                File.Delete(filePathEncodedImage);
            }

            nearLosslessPredictiveEncoder.Encode(filePathOriginalImage, filePathEncodedImage, options);
        }