params.add(y);
params.add(angle);
params.add(interp);
params.add(new double[] { 0.0 });
RenderingHints hints= new RenderingHints(RenderingHints.KEY_INTERPOLATION,(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
hints.add(new RenderingHints(JAI.KEY_BORDER_EXTENDER,new BorderExtenderConstant(new double[] { 255.0 })));
hints.add(new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,Boolean.TRUE));
alpha = JAI.create("rotate", params, hints).getAsBufferedImage();
}
ParameterBlock params = new ParameterBlock();
params.addSource(image());
params.add(x);
params.add(y);
params.add(angle);
params.add(interp);
params.add(new double[] { 0.0 });
BorderExtender extender= new BorderExtenderConstant(new double[] { 0.0 });
RenderingHints hints= new RenderingHints(JAI.KEY_BORDER_EXTENDER, extender);
hints.add(new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.TRUE));
image(JAI.create("rotate", params, hints).getAsBufferedImage());
if (alpha != null)image(addAlpha(image(), alpha, 0, 0));
}