/** Creates a new image worker with the same hints but a different image. */ private ImageWorker fork(final RenderedImage image) { final ImageWorker worker = new ImageWorker(image); if (commonHints != null && !commonHints.isEmpty()) { RenderingHints hints = new RenderingHints(null); hints.add(worker.commonHints); worker.commonHints = hints; } return worker; }
/** * Creates a new instance using the specified hints. * * @param hints The hints, or {@code null} if none. */ public Operations(final RenderingHints hints) { if (hints != null && !hints.isEmpty()) { processor = CoverageProcessor.getInstance(new Hints(hints)); } else { processor = CoverageProcessor.getInstance(); } }
image = JAI.create("Mosaic", pb, hints); boolean setRoiProperty = false; if (hints != null && !hints.isEmpty() && hints.containsKey(FORCE_MOSAIC_ROI_PROPERTY)) { setRoiProperty = (boolean) hints.get(FORCE_MOSAIC_ROI_PROPERTY);
/** * Creates a new instance using the specified hints. * * @param hints The hints, or {@code null} if none. */ public Operations(final RenderingHints hints) { if (hints != null && !hints.isEmpty()) { processor = new BufferedProcessor(hints); } // Otherwise, will creates the processor only when first needed. }
public boolean isDefault() { return hints.isEmpty() && background.equals(DEFAULT_BACKGROUND) && color.equals(DEFAULT_COLOR) && composite.equals(DEFAULT_COMPOSITE) && font.equals(DEFAULT_FONT) && paint.equals(DEFAULT_PAINT) && stroke.equals(DEFAULT_STROKE) && transform.equals(DEFAULT_TRANSFORM) && xorMode.equals(DEFAULT_XOR_MODE) && clip == DEFAULT_CLIP; } }
/** * Creates a new image worker with the same hints but a different image. */ private ImageWorker fork(final RenderedImage image) { final ImageWorker worker = new ImageWorker(image); if (commonHints!=null && !commonHints.isEmpty()) { RenderingHints hints = new RenderingHints(null); hints.add(worker.commonHints); worker.commonHints = hints; } return worker; }
/** * Creates a new image worker with the same hints but a different image. */ private ImageWorker fork(final RenderedImage image) { final ImageWorker worker = new ImageWorker(image); if (commonHints!=null && !commonHints.isEmpty()) { RenderingHints hints = new RenderingHints(null); hints.add(worker.commonHints); worker.commonHints = hints; } return worker; }
/** * Creates a new instance using the specified hints. * * @param hints The hints, or {@code null} if none. */ public Operations(final RenderingHints hints) { if (hints != null && !hints.isEmpty()) { processor = CoverageProcessor.getInstance(new Hints(hints)); } // Otherwise, will creates the processor only when first needed. }
@Override protected void paintComponent(Graphics g) { int width = getWidth(), height = getHeight(); Graphics2D g2d = (Graphics2D) g.create(); if (alpha < 1.0f) { g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha)); } if (currentImage != null) { GraphicsConfiguration gc = getGraphicsConfiguration(); // If the GraphicsConfig changed, then change the hints being used if (gc.getClass() != graphicsConfigClass) { graphicsConfigClass = gc.getClass(); updateRenderingHints(graphicsConfigClass); } if (!renderingHints.isEmpty()) { g2d.setRenderingHints(renderingHints); } render(g2d, 0, 0, width, height); } else if (alpha >= 1.0f) { g2d.setColor(getBackground()); g2d.fillRect(0, 0, width, height); } g2d.dispose(); } @Override
clearCache(); if (hints.isEmpty()) { hints = null;