int quality = this.controller.getQuality();
int imageWidth = this.controller.getWidth();
int imageHeight = this.controller.getHeight();
if (quality >= 2) {
// Use photo renderer
PhotoRenderer photoRenderer = new PhotoRenderer(home,
quality == 2
? PhotoRenderer.Quality.LOW
: PhotoRenderer.Quality.HIGH);
if (!Thread.currentThread().isInterrupted()) {
image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
this.photoComponent.setImage(image);
EventQueue.invokeLater(new Runnable() {
public void run() {
photoCardLayout.show(photoPanel, PHOTO_CARD);
}
});
photoRenderer.render(image, home.getCamera(), this.photoComponent);
}
} else {
// Compute 3D view offscreen image
HomeComponent3D homeComponent3D = new HomeComponent3D(home, this.preferences, quality == 1);
image = homeComponent3D.getOffScreenImage(imageWidth, imageHeight);