static void Main(string[] args)
        {
            PictureProvider p         = new PictureProvider();
            IPicture        pic       = p.GetPicture("..\\..\\ImagenPruebas.jpg");
            IFilter         filter    = new FilterGreyscale();
            IFilter         filterDos = new FilterNegative();
            IPipe           isnull    = new PipeNull();

            IPipe serialDos = new PipeSerial(filterDos, isnull);
            IPipe serial    = new PipeSerial(filter, serialDos);

            IPicture pic2 = serial.Send(pic);
            IPicture pic3 = serialDos.Send(pic2);

            p.SavePicture(pic2, "..\\..\\ImagenPruebas1.jpg");
            p.SavePicture(pic3, "..\\..\\ImagenPruebas2.jpg");
        }
Exemplo n.º 2
0
        public IPicture Filter(IPicture image)
        {
            PictureProvider foto = new PictureProvider();

            foto.SavePicture(image, @"C:\Users\estudiante.fit\Documents\Semestre Dos\Programación 2\imagen.jpg");
            this.sender.PublishToTwitter("By Fmestre", @"C:\Users\estudiante.fit\Documents\Semestre Dos\Programación 2\imagen.jpg");
            return(image);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            PictureProvider pictureProvider = new PictureProvider();

            IPicture firstPicture  = pictureProvider.GetPicture("perro foto.jpg");
            IPicture resultPicture = new PipeSerial(new FilterGreyscale(), new PipeSerial(
                                                        new FilterSaveImage(), new PipeSerial(new FilterNegative(), new PipeNull()))
                                                    ).Send(firstPicture);

            pictureProvider.SavePicture(resultPicture, "perro foto final.jpg");
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            PictureProvider pictureProvider = new PictureProvider();
            IPicture        picOrig         = pictureProvider.GetPicture("jac.jpg");

            FilterNegative negative = new FilterNegative();
            //https://twitter.com/POOUCU?lang=en&lang=en
            FilterTwitterPublish twitterPublish = new FilterTwitterPublish();
            FilterCognitive      faceRecog      = new FilterCognitive();

            IConvolutionMatrix matrix    = new BlurConvolutionMatrix();
            FilterConvolution  blurConvo = new FilterConvolution(matrix);

            PipeNull pipeEnd = new PipeNull();
            //PipeSerial pipe32 = new PipeSerial(negative,pipeEnd);
            PipeSerial      pipe22 = new PipeSerial(negative, pipeEnd);
            PipeSerial      pipe21 = new PipeSerial(twitterPublish, pipeEnd);
            PipeConditional pipe1  = new PipeConditional(faceRecog, pipe21, pipe22);

            pictureProvider.SavePicture(pipe1.Send(picOrig), "jacFiltrado.jpg");
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            PictureProvider imgProvider = new PictureProvider();
            IPicture        pictureProv = imgProvider.GetPicture("Vikings.jpg");

            IConvolution      matrix     = new BlurConvolutionMatriz();
            FilterConvolution blurFilter = new FilterConvolution(matrix);


            FilterNegative  negativeFilter  = new FilterNegative();
            FilterTwitter   twitterFilter   = new FilterTwitter();
            FilterCognitive faceRecognition = new FilterCognitive();


            PipeNull   pipeEnd      = new PipeNull();
            PipeSerial pipeTwitter  = new PipeSerial(twitterFilter, pipeEnd);
            PipeSerial pipeBlur     = new PipeSerial(blurFilter, pipeEnd);
            PipeSerial pipeNegative = new PipeSerial(negativeFilter, pipeEnd);

            PipeConditional pipeFace = new PipeConditional(faceRecognition, pipeTwitter, pipeNegative);

            imgProvider.SavePicture(pipeFace.Send(pictureProv), "Vikings.jpg");
        }
Exemplo n.º 6
0
        public static void Persist(IPicture image, string pathToPersist)
        {
            PictureProvider provider = new PictureProvider();

            provider.SavePicture(image, pathToPersist);
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            //Ejercicio1

            PictureProvider p          = new PictureProvider();
            IPicture        pic        = p.GetPicture("..\\Adds\\índice.jpg");
            IPipe           thirdpipe  = new PipeNull();
            IPipe           secondpipe = new PipeSerial(new FilterNegative(), thirdpipe);
            IPipe           firstpipe  = new PipeSerial(new FilterGreyscale(), secondpipe);

            p.SavePicture(firstpipe.Send(pic), "..\\Adds\\Ejercicio1.jpg");

            //Ejercicio2

            PictureProvider p1          = new PictureProvider();
            IPicture        pic1        = p1.GetPicture("..\\Adds\\índice.jpg");
            IPipe           fifthpipe1  = new PipeNull();
            IPipe           fourthpipe1 = new PipeSerial(new FilterSave(), fifthpipe1);
            IPipe           thirdpipe1  = new PipeSerial(new FilterNegative(), fourthpipe1);
            IPipe           secondpipe1 = new PipeSerial(new FilterSave(), thirdpipe1);
            IPipe           firstpipe1  = new PipeSerial(new FilterGreyscale(), secondpipe1);

            firstpipe1.Send(pic1);

            //Ejercicio3

            PictureProvider p2   = new PictureProvider();
            IPicture        pic2 = p2.GetPicture("..\\Adds\\índice.jpg");

            IPipe fifthpipe2 = new PipeNull();

            IPipe fourthpipe2 = new PipeSerial(new FilterTwitter(), fifthpipe2);

            IPipe thirdpipe2 = new PipeSerial(new FilterNegative(), fourthpipe2);

            IPipe secondpipe2 = new PipeSerial(new FilterTwitter(), thirdpipe2);

            IPipe firstpipe2 = new PipeSerial(new FilterGreyscale(), secondpipe2);

            firstpipe2.Send(pic2);


            //Ejercicio4

            PictureProvider p3   = new PictureProvider();
            PictureProvider p4   = new PictureProvider();
            IPicture        pic3 = p3.GetPicture("..\\Adds\\índice.jpg");
            IPicture        pic4 = p4.GetPicture("..\\Adds\\Auto.jpg");

            IPipe fifthpipe3 = new PipeNull();

            IPipe fourthpipe3 = new PipeSerial(new FilterNegative(), fifthpipe3);

            IPipe thirdpipe3 = new PipeSerial(new FilterTwitter(), fifthpipe3);

            IPipe secondpipe3 = new PipeConditionalFork(new FilterConditional(), thirdpipe3, fourthpipe3);

            IPipe firstpipe3 = new PipeSerial(new FilterGreyscale(), secondpipe3);

            firstpipe3.Send(pic3);
            p4.SavePicture(firstpipe.Send(pic4), "..\\Adds\\auto2.jpg");



            //Ejercicio5
            PictureProvider p5          = new PictureProvider();
            IPicture        pic5        = p5.GetPicture("..\\Adds\\índice.jpg");
            IPipe           secondpipe5 = new PipeNull();
            IPipe           firstpipe5  = new PipeSerial(new FilterRandomConvolution(), secondpipe5);

            p5.SavePicture(firstpipe5.Send(pic5), "..\\Adds\\Ejercicio5.jpg");
        }