using System;
using System.Collections.Generic;
using System.Text;

using System;
using System.ComponentModel;
namespace OpenCVStudio_v0
{
    public sealed class EqualizeHistBlockProperties
    {
        private readonly ProjectManager projectManager; private readonly ProjectBlock projectBlock;
        private bool convertToGray;
        public EqualizeHistBlockProperties(ProjectManager projectManager, ProjectBlock projectBlock)
        {
            this.projectManager = projectManager ?? throw new ArgumentNullException(nameof(projectManager));
            this.projectBlock = projectBlock ?? throw new ArgumentNullException(nameof(projectBlock));
            convertToGray = projectManager.GetBlockParameter(projectBlock.Id, "ConvertToGray", true);
        }
        [Category("Обработка")]
        [DisplayName("Преобразовать в серое")]
        [Description("Автоматически преобразовывает цветное изображение в оттенки серого перед выравниванием гистограммы.")]
        public bool ConvertToGray
        {
            get => convertToGray;
            set
            {
                if (convertToGray == value) return;
                convertToGray = value;
                projectManager.SetBlockParameter(projectBlock.Id, "ConvertToGray", value);
            }
        }
        [Category("Блок")]
        [DisplayName("Название")]
        [ReadOnly(true)]
        public string BlockName => projectBlock.Name;
        [Category("Блок")]
        [DisplayName("Тип")]
        [ReadOnly(true)]
        public string BlockType => projectBlock.BlockType;
        [Category("Блок")]
        [DisplayName("Позиция")]
        [ReadOnly(true)]
        public int Position => projectBlock.Order + 1;
    }
}