IConverter converter = ConverterFactory.createConverter(
mConverterType.getDescriptor(), mConverterType.getPictureType(),
size, size);
IVideoPicture picture = null;
// construct an image with black and white stripped columns
BufferedImage image1 = new BufferedImage(
size, size, mConverterType.getImageType());
for (int x = 0; x < size; ++x)
for (int y = 0; y < size; ++y)
{
int color = x % 2 == 0 ? black : white;
image1.setRGB(x, y, color);
}
// convert image1 to a picture and then back to image2
picture = converter.toPicture(image1, 0);
BufferedImage image2 = converter.toImage(
picture);
picture.delete();
// rotate image2 into image3
AffineTransform t = AffineTransform.getRotateInstance(
Math.PI/2, image2.getWidth() / 2, image2.getHeight() / 2);
AffineTransformOp ato = new AffineTransformOp(t,
AffineTransformOp.TYPE_BICUBIC);
BufferedImage image3 = new BufferedImage(
size, size, mConverterType.getImageType());
image3 = ato.filter(image2, image3);
// convert image3 to a picture and then back to an image (4)
picture = converter.toPicture(image3, 0);
BufferedImage image4 = converter.toImage(picture);
picture.delete();
// test that image4 now contains stripped rows (not columns)
for (int x = 0; x < size; ++x)
for (int y = 0; y < size; ++y)