public override void Transform(ColorChannels channels)
 {
     foreach (var color in new[] { channels.Red, channels.Green, channels.Blue })
     {
         Transform(color, this.Iterations);
     }
 }
 public override void Transform(ColorChannels channels)
 {
     foreach (var color in new[] { channels.Red, channels.Green, channels.Blue })
     {
         Transform(color, this.Iterations);
     }
 }
예제 #3
0
        private void ApplyHaarTransform(bool forward, bool safe, int iterations, Bitmap bmp)
        {
            var maxScale = WaveletTransform.GetMaxScale(bmp.Width, bmp.Height);

            if (iterations < 1 || iterations > maxScale)
            {
                MessageBox.Show(string.Format("Iteration must be Integer from 1 to {0}", maxScale));
                return;
            }

            var time = Environment.TickCount;

            var channels = ColorChannels.CreateColorChannels(safe, bmp.Width, bmp.Height);

            var transform = WaveletTransform.CreateTransform(forward, iterations);

            var imageProcessor = new ImageProcessor(channels, transform);

            imageProcessor.ApplyTransform(bmp);

            if (forward)
            {
                this.TransformedImage = new Bitmap(bmp);
            }

            this.pictureBox1.Image     = bmp;
            this.lblDirection.Text     = forward ? "Forward" : "Inverse";
            this.lblTransformTime.Text = string.Format("{0} milis.", Environment.TickCount - time);
        }
예제 #4
0
 public ImageProcessor(ColorChannels channels, WaveletTransform transform)
 {
     this.channels  = channels;
     this.transform = transform;
 }
 public abstract void Transform(ColorChannels channels);