public void TestThatSetImageMatricesSetsImageMatricesAsExpected1()
        {
            SetupCase1();

            PredictionMatrixHelper.SetImageMatrices(imageMatrices, options);

            var compareLogic = new CompareLogic();

            Assert.IsTrue(compareLogic.Compare(expectedImageMatrices, imageMatrices).AreEqual);
        }
        public void Encode(string sourceFilepath, string destinationFilepath, NearLosslessOptions nearLosslessOptions)
        {
            var image         = GetImageOrThrow(sourceFilepath);
            var imageMatrices = new ImageMatrices(image);

            image.Dispose();

            PredictionMatrixHelper.SetImageMatrices(imageMatrices, nearLosslessOptions);

            fileReader.Open(sourceFilepath);
            fileWriter.Open(destinationFilepath);

            CopyBitmapHeader();
            WriteOptions(nearLosslessOptions);
            var errorMatrixWriter = NearLosslessErrorMatrixWriterSelector.GetErrorMatrixWriter(nearLosslessOptions.SaveMode);

            errorMatrixWriter.WriteErrorMatrix(imageMatrices.QuantizedErrors, fileWriter);
            fileWriter.Flush();

            fileReader.Close();
            fileWriter.Close();
        }