if (!(targetContext instanceof AFPRenderingContext)) {
return false; //AFP-specific image handler
}
AFPRenderingContext context = (AFPRenderingContext)targetContext;
AFPPaintingState paintingState = context.getPaintingState();
if (!paintingState.canEmbedJpeg()) {
return false;
}
if (paintingState.getBitsPerPixel() < 8) {
return false; //This would stand in the way of dithering and cause exceptions
}