Пример #1
0
        private static void HandleFirstRow(ImageMatrices imageMatrices, NearLosslessOptions nearLosslessOptions, INearLosslessPredictor predictor)
        {
            const byte a = 0;
            const byte c = 0;

            for (var column = 1; column < imageMatrices.Height; column++)
            {
                var b          = imageMatrices.Decoded[0, column - 1];
                var prediction = predictor.PredictValue(nearLosslessOptions.PredictionLowerLimit, nearLosslessOptions.PredictionUpperLimit, a, b, c);

                HandlePrediction(imageMatrices, nearLosslessOptions, 0, column, prediction);
            }
        }
Пример #2
0
        private static void HandleFirstColumn(ImageMatrices imageMatrices, NearLosslessOptions nearLosslessOptions, INearLosslessPredictor predictor)
        {
            const byte b = 0;
            const byte c = 0;

            for (var row = 1; row < imageMatrices.Width; row++)
            {
                var a          = imageMatrices.Decoded[row - 1, 0];
                var prediction = predictor.PredictValue(nearLosslessOptions.PredictionLowerLimit, nearLosslessOptions.PredictionUpperLimit, a, b, c);

                HandlePrediction(imageMatrices, nearLosslessOptions, row, 0, prediction);
            }
        }