Exemplo n.º 1
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.º 2
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");
        }