using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Documents;
namespace OpenCVStudio_v0
{
    /// <summary>
    /// Создаёт объект параметров для выбранного блока.
    /// </summary>
    public static class BlockPropertiesFactory
    {
        public static object Create(
            ProjectManager projectManager,
            ProjectBlock projectBlock)
        {
            ArgumentNullException.ThrowIfNull(projectManager);
            ArgumentNullException.ThrowIfNull(projectBlock);

            return projectBlock.BlockType switch
            {
                "ColorChannel" =>
                    new ColorChannelBlockProperties(
                        projectManager,
                        projectBlock),


                "CvtColor" =>
                    new CvtColorBlockProperties(
                        projectManager,
                        projectBlock),

                "Demosaicing" =>
                    new DemosaicingBlockProperties(
                        projectManager,
                        projectBlock),

                "ExtractChannel" =>
                    new ExtractChannelBlockProperties(
                        projectManager,
                        projectBlock),


                "ApplyColorMap" =>
                    new ApplyColorMapBlockProperties(
                        projectManager,
                        projectBlock),

                "ConvertScaleAbs" =>
                    new ConvertScaleAbsBlockProperties(
                        projectManager,
                        projectBlock),


                "Blur" =>
                    new BlurBlockProperties(
                        projectManager,
                        projectBlock),

                "BoxFilter" =>
                    new BoxFilterBlockProperties(
                        projectManager,
                        projectBlock),


                "MedianBlur" =>
                     new MedianBlurBlockProperties(
                         projectManager,
                         projectBlock),

                "SimpleThreshold" =>
                    new SimpleThresholdBlockProperties(
                        projectManager,
                        projectBlock),


                "InRange" =>
                    new InRangeBlockProperties(
                        projectManager,
                        projectBlock),

                "Erode" =>
                    new ErodeBlockProperties(
                        projectManager,
                        projectBlock),

                "Dilate" =>
                    new DilateBlockProperties(
                        projectManager,
                        projectBlock),



                "AdaptiveThreshold" =>
                    new AdaptiveThresholdBlockProperties(
                        projectManager,
                        projectBlock),


                "Morphology" =>
                    new MorphologyBlockProperties(
                        projectManager,
                        projectBlock),

                "Thinning" =>
                    new ThinningBlockProperties(
                        projectManager,
                        projectBlock),

                "BitwiseNot" =>
                    new BitwiseNotBlockProperties(
                        projectManager,
                        projectBlock),

                "AddScalar" =>
                    new AddScalarBlockProperties(
                        projectManager,
                        projectBlock),

                "SubtractScalar" =>
                    new SubtractScalarBlockProperties(
                        projectManager,
                        projectBlock),

                "MultiplyScalar" =>
                    new MultiplyScalarBlockProperties(
                        projectManager,
                        projectBlock),


                "DivideScalar" =>
                    new DivideScalarBlockProperties(
                        projectManager,
                        projectBlock),

                "Pow" =>
                    new PowBlockProperties(
                        projectManager,
                        projectBlock),

                "Sqrt" =>
                    new SqrtBlockProperties(
                        projectManager,
                        projectBlock),

                "Abs" =>
                    new AbsBlockProperties(
                        projectManager,
                        projectBlock),



                "Canny" =>
                    new CannyBlockProperties(
                        projectManager,
                        projectBlock),

                "EqualizeHist" =>
                    new EqualizeHistBlockProperties(
                        projectManager,
                        projectBlock),

                "CLAHE" =>
                    new ClaheBlockProperties(
                        projectManager,
                        projectBlock),

                "BrightnessContrast" =>
                    new BrightnessContrastBlockProperties(
                        projectManager,
                        projectBlock),

                "GammaCorrection" =>
                    new GammaCorrectionBlockProperties(
                        projectManager,
                        projectBlock),

                "Normalize" =>
                    new NormalizeBlockProperties(
                        projectManager,
                        projectBlock),


                "Invert" =>
                     new InvertBlockProperties(
                         projectManager,
                         projectBlock),

                "Resize" =>
                      new ResizeBlockProperties(
                          projectManager,
                          projectBlock),

                "Crop" =>
                      new CropBlockProperties(
                          projectManager,
                          projectBlock),

                "Flip" =>
                    new FlipBlockProperties(
                        projectManager,
                        projectBlock),


                "Rotate" =>
                    new RotateBlockProperties(
                        projectManager,
                        projectBlock),


                "Translate" =>
                     new TranslateBlockProperties(
                         projectManager,
                         projectBlock),

                "AddBorder" =>
                     new AddBorderBlockProperties(
                         projectManager,
                         projectBlock),

                "GaussianBlur" =>
                      new GaussianBlurBlockProperties(
                          projectManager,
                          projectBlock),


                "BilateralFilter" =>
                       new BilateralFilterBlockProperties(
                           projectManager,
                           projectBlock),

                "Sobel" =>
                       new SobelBlockProperties(
                           projectManager,
                           projectBlock),

                "Scharr" =>
                       new ScharrBlockProperties(
                           projectManager,
                           projectBlock),

                "Laplacian" =>
                       new LaplacianBlockProperties(
                           projectManager,
                           projectBlock),

                "PyrDown" =>
                    new PyrDownBlockProperties(
                        projectManager,
                        projectBlock),

                "PyrUp" =>
                    new PyrUpBlockProperties(
                        projectManager,
                        projectBlock),

                "PyrMeanShiftFiltering" =>
                    new PyrMeanShiftFilteringBlockProperties(
                        projectManager,
                        projectBlock),

                "FindContours" =>
                    new FindContoursBlockProperties(
                        projectManager,
                        projectBlock),

                "ContourFilter" =>
                      new ContourFilterBlockProperties(
                          projectManager,
                          projectBlock),

                "ApproxPolyDP" =>
                    new ApproxPolyDPBlockProperties(
                        projectManager,
                        projectBlock),

                "DrawContours" =>
                    new DrawContoursBlockProperties(
                        projectManager,
                        projectBlock),

                "ContourArea" =>
                    new ContourAreaBlockProperties(
                        projectManager,
                        projectBlock),

                "ArcLength" =>
                    new ArcLengthBlockProperties(
                        projectManager,
                        projectBlock),

                "BoundingRect" =>
                    new BoundingRectBlockProperties(
                        projectManager,
                        projectBlock),

                "MinAreaRect" =>
                    new MinAreaRectBlockProperties(
                        projectManager,
                        projectBlock),

                "AbsDiff"=>
                    new AbsDiffBlockProperties(
                        projectManager,
                        projectBlock),


                "BitwiseAnd" =>
                    new BitwiseAndBlockProperties(
                        projectManager,
                        projectBlock),


                "BitwiseOr" =>
                    new BitwiseOrBlockProperties(
                        projectManager,
                        projectBlock),


                "BitwiseXor" =>
                    new BitwiseXorBlockProperties(
                        projectManager,
                        projectBlock),


                "AddWeighted" =>
                    new AddWeightedBlockProperties(
                        projectManager,
                        projectBlock),

                "Add" =>
                    new AddBlockProperties(
                        projectManager,
                        projectBlock),

                "Subtract" =>
                    new SubtractBlockProperties(
                        projectManager,
                        projectBlock),

                "Multiply" =>
                    new MultiplyBlockProperties(
                        projectManager,
                        projectBlock),

                "Divide" =>
                    new DivideBlockProperties(
                        projectManager,
                        projectBlock),

                "MorphologyOpen" =>
                    new MorphologyOpenBlockProperties(
                        projectManager,
                        projectBlock),

                "MorphologyClose" =>
                    new MorphologyCloseBlockProperties(
                        projectManager,
                        projectBlock),


                "MorphologyGradient" =>
                    new MorphologyGradientBlockProperties(
                        projectManager,
                        projectBlock),


                "ChannelSelector" =>
                    new ChannelSelectorBlockProperties(
                        projectManager,
                        projectBlock),

                "SplitChannels"=>
                    new SplitChannelsBlockProperties(
                        projectManager,
                        projectBlock),

       
                "MergeChannels"=>
                     new MergeChannelsBlockProperties(
                         projectManager,
                         projectBlock),


                "SwapChannels" =>
                    new SwapChannelsBlockProperties(
                        projectManager,
                        projectBlock),


                "ImageSave" =>
                    new ImageSaveBlockProperties(
                        projectManager,
                        projectBlock),


                  "MixChannels"=> 
                      new MixChannelsBlockProperties(
                          projectManager,
                          projectBlock),


                   "Transpose"=>
                   new TransposeBlockProperties(
                          projectManager,
                          projectBlock),


                "CopyMakeBorder" =>
                new CopyMakeBorderBlockProperties(
                    projectManager,
                    projectBlock),



                "GetRectSubPix" =>
                  new GetRectSubPixBlockProperties(
                       projectManager,
                       projectBlock),

                "Filter2D"=>
                   new Filter2DBlockProperties(
                       projectManager,
                       projectBlock),

                "SepFilter2D"=>
                   new  SepFilter2DBlockProperties(
                     projectManager,
            projectBlock),


            "FastNlMeansDenoising"=>
            new  FastNlMeansDenoisingBlockProperties(
                projectManager,
                projectBlock),


            "FastNlMeansDenoisingColored"=>

            new FastNlMeansDenoisingColoredBlockProperties(
                projectManager,
                projectBlock),


            "Magnitude"=>
     new MagnitudeBlockProperties(
        projectManager,
        projectBlock),

            "Phase"=>
     new PhaseBlockProperties(
        projectManager,
        projectBlock),




           " CompareScalar"=>

     new CompareScalarBlockProperties(
        projectManager,
        projectBlock),


            "MinEnclosingCircle"=>
     new MinEnclosingCircleBlockProperties(
        projectManager,
        projectBlock),




            "ConvexHull"=>

     new ConvexHullProperties(
        projectManager,
        projectBlock),



                "FitEllipse" =>
                    new FitEllipseBlockProperties(
                        projectManager,
                        projectBlock),


            "FindTransformECC"=>
     new FindTransformECCProperties(
        projectManager,
        projectBlock),



            "AlignImage"=>

     new AlignImageProperties(
        projectManager,
        projectBlock),


            _ => projectBlock
            };
        }
    }
}