} else if (MathUtil.equal(alpha, 0.0)) {
return background.evaluate(p, lambda);
} else {
Color bg = background.evaluate(p, lambda);
Color fg = cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
return fg.times(alpha).plus(bg.times(1.0 - alpha));
}
}
default:
throw new RuntimeException("Raster has unrecognized number of bands.");
}