Package com.github.weisj.jsvg.util
Class BlittableImage
java.lang.Object
com.github.weisj.jsvg.util.BlittableImage
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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NotNull Rectangle2D
private final @NotNull RenderContext
private final @NotNull BufferedImage
private final @NotNull Rectangle2D
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
BlittableImage
(@NotNull BufferedImage image, @NotNull RenderContext context, @NotNull Rectangle2D boundsInDeviceSpace, @NotNull Rectangle2D userBoundsInRootSpace) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clearBackground
(@NotNull Color color) @NotNull RenderContext
context()
static @Nullable BlittableImage
create
(@NotNull BlittableImage.BufferSurfaceSupplier bufferSurfaceSupplier, @NotNull RenderContext context, @Nullable Rectangle2D clipBounds, @NotNull Rectangle2D bounds, @NotNull Rectangle2D objectBounds, @NotNull UnitType contentUnits) static @Nullable BlittableImage
create
(@NotNull BlittableImage.BufferSurfaceSupplier bufferSurfaceSupplier, @NotNull RenderContext context, @Nullable Rectangle2D clipBounds, @NotNull Rectangle2D bounds, @NotNull Rectangle2D objectBounds, @NotNull UnitType contentUnits, @NotNull RenderContext imageContext) @NotNull Graphics2D
void
void
@NotNull BufferedImage
image()
@NotNull Rectangle2D
void
prepareForBlitting
(@NotNull Output output) void
render
(@NotNull Output output, @NotNull BiConsumer<Output, RenderContext> painter) void
render
(@NotNull Output output, @NotNull Consumer<Graphics2D> painter) void
renderNode
(@NotNull Output parentOutput, @NotNull SVGNode node, @NotNull Instantiator instantiator) @NotNull Rectangle2D
-
Field Details
-
image
-
context
-
boundsInDeviceSpace
-
userBoundsInRootSpace
-
-
Constructor Details
-
BlittableImage
private BlittableImage(@NotNull @NotNull BufferedImage image, @NotNull @NotNull RenderContext context, @NotNull @NotNull Rectangle2D boundsInDeviceSpace, @NotNull @NotNull Rectangle2D userBoundsInRootSpace)
-
-
Method Details
-
create
@Nullable public static @Nullable BlittableImage create(@NotNull @NotNull BlittableImage.BufferSurfaceSupplier bufferSurfaceSupplier, @NotNull @NotNull RenderContext context, @Nullable @Nullable Rectangle2D clipBounds, @NotNull @NotNull Rectangle2D bounds, @NotNull @NotNull Rectangle2D objectBounds, @NotNull @NotNull UnitType contentUnits) -
create
@Nullable public static @Nullable BlittableImage create(@NotNull @NotNull BlittableImage.BufferSurfaceSupplier bufferSurfaceSupplier, @NotNull @NotNull RenderContext context, @Nullable @Nullable Rectangle2D clipBounds, @NotNull @NotNull Rectangle2D bounds, @NotNull @NotNull Rectangle2D objectBounds, @NotNull @NotNull UnitType contentUnits, @NotNull @NotNull RenderContext imageContext) -
context
-
imageBoundsInDeviceSpace
-
userBoundsInRootSpace
-
image
-
createGraphics
-
renderNode
public void renderNode(@NotNull @NotNull Output parentOutput, @NotNull @NotNull SVGNode node, @NotNull @NotNull Instantiator instantiator) -
clearBackground
-
render
-
render
public void render(@NotNull @NotNull Output output, @NotNull @NotNull BiConsumer<Output, RenderContext> painter) -
prepareForBlitting
-
blitTo
-
debug
-
debug
-