Exemple #1
0
        public void Render(Image image, Drawable drawable, Progress progress)
        {
            var dimensions = image.Dimensions;

            Tile.CacheDefault(drawable);
            var pf = new PixelFetcher(drawable, false);

            var iter = new RgnIterator(drawable, RunMode.Interactive);

            iter.IterateSrcDest(src => src);

            int dropSize = GetValue <int>("drop_size");
            int fishEye  = GetValue <int>("fish_eye");
            int number   = GetValue <int>("number");

            var factory = new RaindropFactory(dropSize, fishEye, dimensions);

            for (int numBlurs = 0; numBlurs <= number; numBlurs++)
            {
                var raindrop = factory.Create();
                if (raindrop == null)
                {
                    if (progress != null)
                    {
                        progress.Update(1.0);
                    }
                    break;
                }

                raindrop.Render(factory.BoolMatrix, pf, drawable);

                if (progress != null)
                {
                    progress.Update((double)numBlurs / number);
                }
            }

            pf.Dispose();

            drawable.Flush();
            drawable.Update();
        }
Exemple #2
0
        public void Render(Image image, Drawable drawable, Progress progress)
        {
            var dimensions = image.Dimensions;

              Tile.CacheDefault(drawable);
              var pf = new PixelFetcher(drawable, false);

              var iter = new RgnIterator(drawable, RunMode.Interactive);
              iter.IterateSrcDest(src => src);

              int dropSize = GetValue<int>("drop_size");
              int fishEye = GetValue<int>("fish_eye");
              int number = GetValue<int>("number");

              var factory = new RaindropFactory(dropSize, fishEye, dimensions);

              for (int numBlurs = 0; numBlurs <= number; numBlurs++)
            {
              var raindrop = factory.Create();
              if (raindrop == null)
            {
              if (progress != null)
            progress.Update(1.0);
              break;
            }

              raindrop.Render(factory.BoolMatrix, pf, drawable);

              if (progress != null)
            progress.Update((double) numBlurs / number);
            }

              pf.Dispose();

              drawable.Flush();
              drawable.Update();
        }
Exemple #3
0
 public void Render(Drawable drawable)
 {
     var iter = new RgnIterator(drawable, _("Mezzotint"));
       iter.IterateSrcDest(pixel => DoMezzotint(pixel));
 }
Exemple #4
0
        public void Render(Drawable drawable)
        {
            var iter = new RgnIterator(drawable, _("Mezzotint"));

            iter.IterateSrcDest(pixel => DoMezzotint(pixel));
        }