*
* @param expected The image containing the expected pixel values.
* @param actual The image containing the actual pixel values.
*/
protected static void assertRasterEquals(final RenderedImage expected, final RenderedImage actual) {
final RectIter e = RectIterFactory.create(expected, null);
final RectIter a = RectIterFactory.create(actual, null);
if (!e.finishedLines()) do {
assertFalse(a.finishedLines());
if (!e.finishedPixels()) do {
assertFalse(a.finishedPixels());
if (!e.finishedBands()) do {
assertFalse(a.finishedBands());
final float pe = e.getSampleFloat();
final float pa = a.getSampleFloat();
assertEquals(pe, pa, EPS);
a.nextBand();
} while (!e.nextBandDone());
assertTrue(a.finishedBands());
a.nextPixel();
a.startBands();
e.startBands();
} while (!e.nextPixelDone());
assertTrue(a.finishedPixels());
a.nextLine();
a.startPixels();
e.startPixels();
} while (!e.nextLineDone());
assertTrue(a.finishedLines());
}