Package java.awt.image

Examples of java.awt.image.AffineTransformOp.filter()


        AffineTransform at = AffineTransform.getScaleInstance(widthScale, heightScale);
        AffineTransformOp ato = new AffineTransformOp(at, renderHints);

        // must create the result image manually, otherwise the size of the result image may be 1 pixel off
        BufferedImage result = createImage(image.getColorModel(), targetWidth, targetHeight);
        result = ato.filter(image, result);

        threadSetNormal();
        return result;
    }
View Full Code Here


                                BufferedImage img = ImageIO.read(in);
                                log.debug("Read image " + uri + " (" + img.getWidth() + "," + img.getHeight() + ")");
                                AffineTransform tx = AffineTransform.getScaleInstance(-1, 1);
                                tx.translate(-img.getWidth(null), 0);
                                AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
                                img = op.filter(img, null);
                                log.debug("Mirrored image " + uri + " (" + img.getWidth() + "," + img.getHeight() + ")");
                                ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
                                ImageIO.write(img, imageType.getFormat(), baos);
                                baos.close();
                                return new Image(imageType, baos.toByteArray());
View Full Code Here

        gs.fillRect(0, 0, w, h);// 以给定颜色绘制旋转后图片的背景
        AffineTransform at = new AffineTransform();
        at.rotate(ang, w / 2, h / 2);// 旋转图象
        at.translate(x, y);
        AffineTransformOp op = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
        op.filter(image, rotatedImage);
        image = rotatedImage;
        return image;
    }

    /**
 
View Full Code Here

      AffineTransform at = new AffineTransform();
      at.scale(xScale, yScale);
     
      // instantiate and apply affine transformation filter
      BufferedImageOp bio = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);
      return bio.filter(img, null);
   }
  /* (non-Javadoc)
   * @see ch.sahits.game.graphic.image.impl.IOpenPatricianPainter#scaleY(java.awt.image.BufferedImage, int)
   */
  @Override
 
View Full Code Here

      AffineTransform at = new AffineTransform();
      at.scale(xScale, yScale);
     
      // instantiate and apply affine transformation filter
      BufferedImageOp bio = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);
      return bio.filter(img, null);
   }
}
View Full Code Here

      AffineTransform at = new AffineTransform();
      at.scale(xScale, yScale);
     
      // instantiate and apply affine transformation filter
      BufferedImageOp bio = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);
      return bio.filter(img, null);
  }



}
View Full Code Here

      AffineTransform at = new AffineTransform();
      at.scale(xScale, yScale);
     
      // instantiate and apply affine transformation filter
      BufferedImageOp bio = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);
      return bio.filter(img, null);
  }



}
View Full Code Here

      AffineTransform at = new AffineTransform();
      at.scale(xScale, yScale);
     
      // instantiate and apply affine transformation filter
      BufferedImageOp bio = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);
      return bio.filter(img, null);
   }
  /**
   * Scale an input image along the y-axis only. The scaled dimension may not exactly match the
   * desired, but it will be best match
   * @param img Image to be scaled
View Full Code Here

      AffineTransform at = new AffineTransform();
      at.scale(xScale, yScale);
     
      // instantiate and apply affine transformation filter
      BufferedImageOp bio = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);
      return bio.filter(img, null);
   }
}
View Full Code Here

                                  srcCM.isAlphaPremultiplied(), null);

        myBI = new BufferedImage(myCM,wr.createWritableTranslatedChild(0,0),
                                 myCM.isAlphaPremultiplied(), null);

        op.filter(srcBI, myBI);

        // if ((count % 40) == 0) {
        //     org.apache.batik.ImageDisplay.showImage("Src: " , srcBI);
        //     org.apache.batik.ImageDisplay.showImage("Dst: " , myBI);
        // }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.