private void CheckSettings()
        {
            if (AdaptiveBlur < 0.0)
            {
                throw new InvalidOperationException("Invalid adaptive blur specified, value must be zero or higher.");
            }

            if (!CropOffset.IsValid)
            {
                throw new InvalidOperationException("Invalid crop offset specified, values must be zero or higher.");
            }

            if (FilterSize < 0)
            {
                throw new InvalidOperationException("Invalid filter size specified, value must be zero or higher.");
            }

            if (Padding < 0)
            {
                throw new InvalidOperationException("Invalid padding specified, value must be zero or higher.");
            }

            if (Sharpen < 0.0)
            {
                throw new InvalidOperationException("Invalid sharpen specified, value must be zero or higher.");
            }

            if (Saturation.ToDouble() < 0.0)
            {
                throw new InvalidOperationException("Invalid saturation specified, value must be zero or higher.");
            }

            if (SmoothingThreshold != null)
            {
                double textSmoothingThreshold = SmoothingThreshold.Value.ToDouble();
                if (textSmoothingThreshold < 0 || textSmoothingThreshold > 100)
                {
                    throw new InvalidOperationException("Invalid smoothing threshold specified, value must be between zero and 100.");
                }
            }
        }
        private void CheckSettings()
        {
            if (Brightness < 0.0)
            {
                throw new InvalidOperationException("Invalid brightness specified, value must be zero or higher.");
            }

            if (Contrast < -10.0 || Contrast > 10.0)
            {
                throw new InvalidOperationException("Invalid contrast specified, the range is -10 to 10.");
            }

            if (Darkness < 1.0)
            {
                throw new InvalidOperationException("Invalid darkness specified, value must be 1 or higher.");
            }

            if (Saturation.ToDouble() < 0.0)
            {
                throw new InvalidOperationException("Invalid saturation specified, value must be zero or higher.");
            }
        }