Beispiel #1
0
        /// <summary>
        /// Constructor caller of base constructor
        /// Also reads a saves LUT file by its filename
        /// </summary>
        /// <param name="mod">One of provided image modifications</param>
        /// <param name="imageSet">Pointer to image set from engine</param>
        /// <param name="name">LUT filename</param>
        public ApplyLUT(ImageModification mod, ImageSet imageSet, string name) : base(mod, imageSet)
        {
            Tuple <int, Tuple <byte, byte, byte> [, , ]> lut = LookUpTable.Read(name);

            size = lut.Item1;
            map  = lut.Item2;
        }
Beispiel #2
0
        /// <summary>
        /// Processes adjustment of saturation, brightness and clarity
        /// </summary>
        /// <param name="mod">adjustment type</param>
        /// <param name="newValue">new value from numeric field</param>
        private void OnSyncValues(ImageModification mod, int newValue)
        {
            ColorEdit task;

            switch (mod)
            {
            case ImageModification.Saturation:
                task = new SaturationEdit(ImageModification.Saturation, imageSet, newValue);
                log.Add("Image saturation modified");
                break;

            case ImageModification.Brightness:
                task = new BrightnessEdit(ImageModification.Brightness, imageSet, newValue);
                log.Add("Image brightness modified");
                break;

            case ImageModification.Clarity:
                task = new ClarityEdit(ImageModification.Clarity, imageSet, newValue);
                log.Add("Image clarity modified");
                break;

            default:
                task = null;
                break;
            }
            taskControl.Add(task);
            taskControl.CheckAndProcess();
        }
Beispiel #3
0
        /// <summary>
        /// Constructor caller of base constructor and color exchange parser
        /// </summary>
        /// <param name="mod">One of provided image modifications</param>
        /// <param name="imageSet">Pointer to image set from engine</param>
        /// <param name="first">First color</param>
        /// <param name="second">Second color</param>
        public ColorChange(ImageModification mod, ImageSet imageSet, string first, string second) : base(mod, imageSet)
        {
            this.first  = -1;
            this.second = -1;
            switch (first)
            {
            case "red":
                this.first = 0;
                break;

            case "green":
                this.first = 1;
                break;

            case "blue":
                this.first = 2;
                break;
            }
            switch (second)
            {
            case "red":
                this.second = 0;
                break;

            case "green":
                this.second = 1;
                break;

            case "blue":
                this.second = 2;
                break;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Initialize image task type, image color filter (as image view mode), image set and
        /// other variables with defaults
        /// </summary>
        /// <param name="mod">One of provided image modifications</param>
        /// <param name="imageSet">Pointer to image set from engine</param>
        public ImageTask(ImageModification mod, ImageSet imageSet)
        {
            taskType = mod;

            ongoing  = false;
            previous = null;
            next     = null;

            iSet  = imageSet;
            iMode = iSet.imageMode;
        }
Beispiel #5
0
        public void ShuiYinToImage(string imgPath)
        {
            try
            {
                ImageModification imgM = new ImageModification();
                imgM.ModifyImagePath = imgPath;
                imgM.DrawedImagePath = Server.MapPath("~/") + "UserFiles\\shuiyinSource.png";

                imgM.LucencyPercent = 80;
                imgM.BottoamSpace   = 50;
                imgM.RightSpace     = 260;
                imgM.DrawImage();
            }
            catch
            {
            }
        }
Beispiel #6
0
 /// <summary>
 /// Create restore point and initialize values from current image set
 /// </summary>
 /// <param name="mode">Image view mode</param>
 /// <param name="taskType">Task type</param>
 /// <param name="image">Main image</param>
 /// <param name="thumb">Thumbnail image</param>
 /// <param name="saturation">Saturation level</param>
 /// <param name="brightness">Brightness level</param>
 /// <param name="clarity">Clarity level</param>
 public RestorePoint(
     ImageMode mode,
     ImageModification taskType,
     Bitmap image,
     Bitmap thumb,
     int saturation,
     int brightness,
     int clarity
     )
 {
     this.mode       = mode;
     this.taskType   = taskType;
     this.image      = image;
     this.thumb      = thumb;
     this.saturation = saturation;
     this.brightness = brightness;
     this.clarity    = clarity;
 }
Beispiel #7
0
        static void Main(string[] args)
        {
            Console.Write("Write the path to the picture you want to alternate here: ");

            var inputPath        = Console.ReadLine();
            var inputImage       = Image.FromFile(inputPath);
            var inputImageWidth  = inputImage.Width;
            var inputImageHeight = inputImage.Height;

            if (inputImageWidth < 200 && inputImageHeight < 200)
            {
                Console.WriteLine("Your input picture cannot be smaller then 200 x 200! Try again!");
            }
            else if (inputImageWidth > 1920 && inputImageHeight > 1080)
            {
                Console.WriteLine("Your input pictrue cannot be bigger then 1920 x 1080! Try again!");
            }
            else
            {
                var inputPicture    = new Bitmap(inputImage);
                var inputPictureOne = new Bitmap(inputImage);
                var inputPictureTwo = new Bitmap(inputImage);
                ImageModification.MakeNegativePicture(inputPicture, inputPath);
                ImageModification.MakeBlurredPicture(inputPictureOne, inputPath);
                ImageModification.MakeGrayscalePicture(inputPictureTwo, inputPath);
            }

            /*Löser inte detta
             * try
             * {
             *
             *
             * }
             * catch (FileNotFoundException fileNotFound)
             * {
             *  Console.WriteLine("The file was not found, please try again", fileNotFound);
             * }
             * catch (ArgumentException noFileInput)
             * {
             *  Console.WriteLine("You need to enter a path to an imagefile that you would like to modify", noFileInput);
             * }
             */
        }
Beispiel #8
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 public ColorInvert(ImageModification mod, ImageSet imageSet) : base(mod, imageSet)
 {
 }
Beispiel #9
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 public ColorTask(ImageModification mod, ImageSet imageSet) : base(mod, imageSet)
 {
 }
Beispiel #10
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 /// <param name="value">Particular edit level</param>
 public SaturationEdit(ImageModification mod, ImageSet imageSet, int value) : base(mod, imageSet, value)
 {
 }
Beispiel #11
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 public FlipTask(ImageModification mod, ImageSet imageSet) : base(mod, imageSet)
 {
 }
Beispiel #12
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 /// <param name="value">Particular edit level</param>
 public BrightnessEdit(ImageModification mod, ImageSet imageSet, int value) : base(mod, imageSet, value)
 {
 }
Beispiel #13
0
 /// <summary>
 /// Constructor caller of base constructor
 /// Inicialize also edit value
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 /// <param name="value">Particular edit level</param>
 public ColorEdit(ImageModification mod, ImageSet imageSet, int value) : base(mod, imageSet)
 {
     this.value = value;
 }
Beispiel #14
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 public FlipHorizontal(ImageModification mod, ImageSet imageSet) : base(mod, imageSet)
 {
 }
Beispiel #15
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 public ApplyGreyStyle(ImageModification mod, ImageSet imageSet) : base(mod, imageSet)
 {
 }
Beispiel #16
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 public FlipVertical(ImageModification mod, ImageSet imageSet) : base(mod, imageSet)
 {
 }
Beispiel #17
0
 /// <summary>
 /// Constructor caller of base constructor
 /// </summary>
 /// <param name="mod">One of provided image modifications</param>
 /// <param name="imageSet">Pointer to image set from engine</param>
 /// <param name="value">Particular edit level</param>
 public ClarityEdit(ImageModification mod, ImageSet imageSet, int value) : base(mod, imageSet, value)
 {
 }