﻿using System.Drawing;
using LearningVisualizer.ViewModels.Base;

namespace LearningVisualizer.ViewModels
{
    public class SquaredErrorViewModel : ViewModelBase
    {
        public SquaredErrorViewModel(double minValue, double maxValue, Bitmap imgBitmap)
        {
            MinValue = minValue;
            MaxValue = maxValue;

            ImgSource = imgBitmap;

            var conv = new RangeValueToColor(0, 800);

            var scaleBitmap = new Bitmap(800, 20);
            for (int i = 0; i < 800; i++)
            {
                for (int j = 0; j < 20; j++)
                {
                    scaleBitmap.SetPixel(i, j, conv.ToColor(i));
                }
            }

            ScaleImgSource = scaleBitmap;
        }

        public double MinValue { get; set; }
        public double MaxValue { get; set; }
        public Bitmap ScaleImgSource { get; set; }
        public Bitmap ImgSource { get; set; }
    }
}
