Example #1
0
 private void setupPicture() {
   BufferedImage bufferedPic = picture.getBufferedImage();
   ImageDisplay picDisplay = new ImageDisplay(bufferedPic);
   picDisplay.setBackground(new Color(70, 130, 180));
   payne.setViewportView(picDisplay);
 }
Example #2
0
  public void filter() {
    switch (anotherBox.getSelectedIndex()) {
      case 0:
        newPicture();
        setupPicture();
        break;

      case 1:
        newPicture();
        picture.sepia();
        setupPicture();
        break;

      case 2:
        newPicture();
        picture.zeroBlue();
        setupPicture();
        break;

      case 3:
        newPicture();
        picture.zeroRed();
        setupPicture();
        break;

      case 4:
        newPicture();
        picture.zeroGreen();
        setupPicture();
        break;

      case 5:
        newPicture();
        picture.keepOnlyBlue();
        setupPicture();
        break;

      case 6:
        newPicture();
        picture.keepOnlyRed();
        setupPicture();
        break;

      case 7:
        newPicture();
        picture.keepOnlyGreen();
        setupPicture();
        break;

      case 8:
        newPicture();
        picture.negate();
        setupPicture();
        break;

      case 9:
        newPicture();
        picture.grayscale();
        setupPicture();
        break;

      case 10:
        newPicture();
        picture.mirrorVertical();
        setupPicture();
        break;

      case 11:
        newPicture();
        picture.mirrorDiagonal();
        setupPicture();
        break;

      case 12:
        newPicture();
        picture.edgeDetection(6);
        setupPicture();
        break;

      case 13:
        newPicture();
        picture.random();
        setupPicture();
        break;
    }
  }