-1

So I have no idea why I get a "cannot find symbol error" for img in the following code. This code is based off an ImageJ Plugin template that works perfectly fine, so something must be eluding me...

    import ij.*;
    import ij.process.*;
    import ij.plugin.filter.*;
    public class Plug2 implements PlugInFilter 
    {

           public int setup(String arg, ImagePlus imp)
           {
               return DOES_RGB;
           }

          public void run(ImageProcessor img)
          {
               int i, j, swap;
               for (j = 0; j < img.getLength(); j++)
                   for (i= 0; i < img.getWidth(); i++)
                   {
                         swap = img.getPixel(i, j);
                         img.setPixel(i, j, img.getPixel(img.getWidth()-i, j));
                         img.setPixel(img.getWidth()-i, j, swap);
                   }
          }
    }
WIlopu
  • 47
  • 6
  • 1
    possible duplicate of [What does a "Cannot find symbol" compilation error mean?](http://stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-compilation-error-mean) – Raedwald Aug 05 '15 at 12:13

1 Answers1

0

The ImageProcessor class does not have methods setPixel or getLength, thus the Cannot find symbol error.

I assume you want putPixel or set, and getWidth

Community
  • 1
  • 1
hinerm
  • 719
  • 3
  • 9