new String[]{"512", Integer.toString((512 - splitOffset) / 2),
Integer.toString(
512 - splitOffset - (512 - splitOffset) / 2),
Integer.toString(splitOffset)}
};
Histogram histogram[] = new Histogram[4];
for (int i = 0; i < 4; i++) {
InputStream stream = TestUtilities.
doImageTranscodeTest(expectations,
OutputImageRules.GRAYSCALEPNG8, "lena.tiff",
new String[][]{
{"v.width", params[1][i]},
{"v.p", getProtectedArea(
Integer.parseInt(params[1][i]),
params[0][i])}},
true);
RenderedOp image = JAI.create("ImageRead", ImageIO.createImageInputStream(stream));
// Create the parameter block.
PlanarImage dst = null;
ParameterBlock pb = new ParameterBlock();
pb.addSource(image); // Specify the source image
pb.add(null); // No ROI
pb.add(1); // Sampling
pb.add(1); // periods
// Perform the histogram operation.
dst = JAI.create("histogram", pb, null);
// Retrieve the histogram data.
Histogram hist = (Histogram) dst.getProperty("histogram");
histogram[i] = hist;
}
for (int i = 0; i < 256; i++) {
assertEquals(histogram[0].getBinSize(0, i),
histogram[1].getBinSize(0, i) +