Example #1
0
        static void Main(string[] args)
        {
            PictureProvider foto  = new PictureProvider();
            IPicture        foto1 = foto.GetPicture(@"C:\Users\estudiante.fit\Documents\GitHub\CompAndDel\fotojpg.jpg");

            int[,] matriz = new int[3, 3] {
                { -1, 0, -1, }, { 0, 4, 0 }, { -1, 0, -1 }
            };
            Propiedades       data            = new Propiedades(matriz, 1, 27);
            FilterConvolution FiltroDeMatriz  = new FilterConvolution(data);
            FilterGreyscale   FiltroGreyscale = new FilterGreyscale();
            BoolFilter        FiltroBooleano  = new BoolFilter();

            TwitterImage sender = new TwitterImage("dtOgpyjBBXglAzMEjMMZtFf73",
                                                   "Qzm0FxotJ9YyoXiGLJ4JI9IZFWmYvB4LWpteWPGVYofxSG4FnN",
                                                   "1396065818-13uONd7FgFVXhW1xhUCQshKgGv4UOnKeDipg4cz",
                                                   "HXtlP1SRnJCL5a37R98hFrIRlEIouZX3Ra4s6JuFOpXZF");
            TwitterFilter FiltroTwitter = new TwitterFilter(sender);

            PipeNull   cañofinal     = new PipeNull();
            PipeSerial caño3         = new PipeSerial(FiltroGreyscale, cañofinal);
            PipeSerial caño1         = new PipeSerial(FiltroTwitter, cañofinal);
            BoolPipe   CañoBifurcado = new BoolPipe(caño1, caño3, FiltroBooleano);

            IPicture foto2 = CañoBifurcado.Send(foto1);

            foto.SavePicture(foto2, @"C:\Users\estudiante.fit\Documents\GitHub\CompAndDel\foto12.jpg");
        }
Example #2
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");
        }
Example #3
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");
        }