Class BlittableImage


  • public final class BlittableImage
    extends java.lang.Object
    Class that encapsulates rendering to an offscreen image. The image is aligned to the pixel boundary of the root image surface. Rendering to the image behaves and the blitting it behaves as if it was rendered directly to the root surface.
    • Field Detail

      • image

        @NotNull
        private final @NotNull java.awt.image.BufferedImage image
      • boundsInDeviceSpace

        @NotNull
        private final @NotNull java.awt.geom.Rectangle2D boundsInDeviceSpace
      • userBoundsInRootSpace

        @NotNull
        private final @NotNull java.awt.geom.Rectangle2D userBoundsInRootSpace
    • Constructor Detail

      • BlittableImage

        private BlittableImage​(@NotNull
                               @NotNull java.awt.image.BufferedImage image,
                               @NotNull
                               @NotNull RenderContext context,
                               @NotNull
                               @NotNull java.awt.geom.Rectangle2D boundsInDeviceSpace,
                               @NotNull
                               @NotNull java.awt.geom.Rectangle2D userBoundsInRootSpace)
    • Method Detail

      • create

        @Nullable
        public static @Nullable BlittableImage create​(@NotNull
                                                      @NotNull BlittableImage.BufferSurfaceSupplier bufferSurfaceSupplier,
                                                      @NotNull
                                                      @NotNull RenderContext context,
                                                      @Nullable
                                                      @Nullable java.awt.geom.Rectangle2D clipBounds,
                                                      @NotNull
                                                      @NotNull java.awt.geom.Rectangle2D bounds,
                                                      @NotNull
                                                      @NotNull java.awt.geom.Rectangle2D objectBounds,
                                                      @NotNull
                                                      @NotNull UnitType contentUnits)
      • create

        @Nullable
        public static @Nullable BlittableImage create​(@NotNull
                                                      @NotNull BlittableImage.BufferSurfaceSupplier bufferSurfaceSupplier,
                                                      @NotNull
                                                      @NotNull RenderContext context,
                                                      @Nullable
                                                      @Nullable java.awt.geom.Rectangle2D clipBounds,
                                                      @NotNull
                                                      @NotNull java.awt.geom.Rectangle2D bounds,
                                                      @NotNull
                                                      @NotNull java.awt.geom.Rectangle2D objectBounds,
                                                      @NotNull
                                                      @NotNull UnitType contentUnits,
                                                      @NotNull
                                                      @NotNull RenderContext imageContext)
      • imageBoundsInDeviceSpace

        @NotNull
        public @NotNull java.awt.geom.Rectangle2D imageBoundsInDeviceSpace()
      • userBoundsInRootSpace

        @NotNull
        public @NotNull java.awt.geom.Rectangle2D userBoundsInRootSpace()
      • image

        @NotNull
        public @NotNull java.awt.image.BufferedImage image()
      • createGraphics

        @NotNull
        public @NotNull java.awt.Graphics2D createGraphics()
      • renderNode

        public void renderNode​(@NotNull
                               @NotNull Output parentOutput,
                               @NotNull
                               @NotNull SVGNode node,
                               @NotNull
                               @NotNull Instantiator instantiator)
      • clearBackground

        public void clearBackground​(@NotNull
                                    @NotNull java.awt.Color color)
      • render

        public void render​(@NotNull
                           @NotNull Output output,
                           @NotNull
                           @NotNull java.util.function.Consumer<java.awt.Graphics2D> painter)
      • render

        public void render​(@NotNull
                           @NotNull Output output,
                           @NotNull
                           @NotNull java.util.function.BiConsumer<Output,​RenderContext> painter)
      • prepareForBlitting

        public void prepareForBlitting​(@NotNull
                                       @NotNull Output output)
      • blitTo

        public void blitTo​(@NotNull
                           @NotNull Output output)
      • debug

        public void debug​(@NotNull
                          @NotNull Output output)
      • debug

        public void debug​(@NotNull
                          @NotNull Output output,
                          boolean drawImage)