ResourceAnimationCanvas
final class ResourceAnimationCanvas
Package: dev.joid.lib.resource.animation · Module: core · Source: ResourceAnimationCanvas.java
Builds the full images of an animation from frames that update only a part of the picture, as GIF, APNG and WebP store them.
Description
Section titled “Description”Create one per file at the size of the animation, then compose each frame in order.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| ResourceAnimationCanvas(int width, int height) | Creates a transparent canvas of width × height pixels. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
int[] | compose(int[] frame, int x, int y, int frameWidth, int frameHeight, Blend blend, Disposal disposal) | Draws frame, of frameWidth × frameHeight pixels, at x, y with blend, returns the full image that results, then prepares the canvas for the next frame as disposal says. |
int | getWidth() | Returns the width of the canvas. |
int | getHeight() | Returns the height of the canvas. |
int[] | getPixels() | Returns the pixels of the canvas, as the next frame reads them. |
Creation details
Section titled “Creation details”ResourceAnimationCanvas
Section titled “ResourceAnimationCanvas”ResourceAnimationCanvas(int width, int height)
Creates a transparent canvas of width × height pixels.
Method details
Section titled “Method details”compose
Section titled “compose”int[] compose(int[] frame, int x, int y, int frameWidth, int frameHeight, Blend blend, Disposal disposal)
Draws frame, of frameWidth × frameHeight pixels, at x, y with blend, returns the full image that results, then prepares the canvas for the next frame as disposal says.
The part of the frame outside the canvas is ignored.
getWidth
Section titled “getWidth”int getWidth()
Returns the width of the canvas.
getHeight
Section titled “getHeight”int getHeight()
Returns the height of the canvas.
getPixels
Section titled “getPixels”int[] getPixels()
Returns the pixels of the canvas, as the next frame reads them.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
