コード例 #1
0
  public void testRenderNotUsingOffered(BufferedImage offered, int width, int height, int type) {
    for (InterpolationType interpolation : InterpolationType.values()) {
      AffineTransformationStep transformer =
          new AffineTransformationStep(
              BasicImageTransformations.identityTransformation(), Color.GRAY, interpolation);

      TransformedImage inputImage = blankTransformedImage(Color.BLUE, width, height, type);

      TransformationStepInput input = new TransformationStepInput(null, width, height, inputImage);
      TransformedImage result = transformer.render(Cancellation.UNCANCELABLE_TOKEN, input, offered);
      assertNotSame(offered, result.getImage());

      ImageTestUtils.checkBlankImage(result.getImage(), Color.BLUE);

      PointTransformerChecks.checkEqualPointTransformers(
          AffineImagePointTransformer.IDENTITY, result.getPointTransformer());
    }
  }
コード例 #2
0
 private static BufferedImage blankImage(Color color, int width, int height, int type) {
   BufferedImage result = new BufferedImage(width, height, type);
   ImageTestUtils.fillImage(result, color);
   return result;
 }