Esempio n. 1
0
        /// <summary>
        /// Changes the saturation of the current image.
        /// </summary>
        /// <param name="percentage">
        /// The percentage by which to alter the images saturation.
        /// Any integer between -100 and 100.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        public ImageFactory Saturation(int percentage)
        {
            if (this.ShouldProcess)
            {
                // Sanitize the input.
                if (percentage > 100 || percentage < -100)
                {
                    percentage = 0;
                }

                Saturation saturate = new Saturation {
                    DynamicParameter = percentage
                };

                this.Image = saturate.ProcessImage(this);
            }

            return(this);
        }
        public string Post([FromBody] Saturation req)
        {
            var response = Saturation.ProcessImage(req);

            return(response);
        }