Resources
Images, animated images, vector images and videos, the assets they are read from, the formats and decoders that read them, their memory cache, the file cache of JOID and the video natives. Learn: Images and media, Custom formats, Where JOID stores files.
Main types
Section titled “Main types”| Type | Kind | Summary |
|---|---|---|
AnimatedResourceDecoder | class | Plays an animated image, GIF, APNG, animated WebP or a format of yours, by uploading the frame of the current time. |
ApngResourceAnimationReader | class | Reads the frames of an animated PNG (APNG). |
ApngResourceFormat | class | The built-in format of PNG files, still or animated (APNG). |
Asset | class | Where the bytes of a resource, a font, a shader or a model come from, a file, the classpath, a URL or a stream, behind one stable id. |
AssetLocator | class | The registry of the asset locators, which turns any input into an Asset. |
AudioListenerPosition | interface | Gives the position of the listener that the sound of placed videos fades with. |
ClasspathAsset | class | An asset found in the classpath, such as a file packed in the jar of your application. |
FileAsset | class | An asset read from a file on disk. |
FileAssetLocator | class | The built-in locator that turns a File into a FileAsset. |
FileCache | class | The cache folder of JOID, split into named areas whose entries expire when they go unused. |
FileCacheArea | class | One folder of the cache, whose entries are written once by key, read many times, and deleted after a period without use. |
FileCacheWriter | interface | Writes the content of a cache entry into the file it is given. |
GifResourceAnimationReader | class | Reads the frames of a GIF. |
GifResourceFormat | class | The built-in format of GIF files, played as animated images. |
HeifResourceFormat | class | The built-in format that recognizes HEIF and AVIF images, which JOID cannot decode, to fail with a clear message. |
IAssetLocator | interface | Turns one kind of input into an Asset, so that every loader of JOID accepts it. |
IResourceAnimationReader | interface | Reads every frame of an animated image file into a ResourceAnimation. |
IResourceCache | interface | Where a ResourceBuilder keeps the data of its resources by id, so that two loads of the same input share it. |
IResourceDecoder | interface | Reads the data of one resource, decodes it on a background thread and sends it to the GPU on the render thread. |
IResourceFormat | interface | Recognizes one file format from its first bytes and creates the decoder that reads it. |
IResourcePlayback | interface | The playback controls of an animated image or a video, to play, pause, seek and loop it. |
MemoryResourceCache | class | The default resource cache, which keeps the data in memory while it is used and for a while after. |
RasterResourceDecoder | class | Decodes a still image, PNG, JPEG, BMP, still WebP and the other formats of the bundled image readers, into one texture. |
Resource | class | An image, an animated image, a vector image or a video, loaded in the background and drawn by a resource node or DrawResource. |
ResourceAnimation | class | The decoded frames of an animated image, with its size and its play count. |
ResourceAnimationCanvas | class | Builds the full images of an animation from frames that update only a part of the picture, as GIF, APNG and WebP store them. |
ResourceAnimationFrame | class | One full image of an animation and how long it shows. |
ResourceBuilder | class | Creates resources with shared default settings and a cache that makes two loads of the same input share their data. |
ResourceData | class | The shared state of one resource, its decoder, pixels, textures, size and errors, behind every Resource handle on the same input. |
ResourceFormat | class | The registry of the resource formats, which picks the decoder of a file from its first bytes. |
ResourceProperties | class | The drawing settings of a resource handle, its filtering, its mipmaps and its region. |
StreamAsset | class | An asset read once from an InputStream and kept in memory, so that it can be read again. |
StreamAssetLocator | class | The built-in locator that turns an InputStream into a StreamAsset. |
StringAssetLocator | class | The built-in locator that turns a String into a URL, classpath or file asset. |
SvgResourceFormat | class | The built-in format of SVG files, rendered as vector images at the size they are drawn. |
UrlAsset | class | An asset read from a URL, over the network or from a file:, jar: or other scheme. |
VectorResourceDecoder | class | Decodes an SVG document and renders it again at the size it is drawn at, so that it stays sharp. |
VideoAudioPlayer | class | Plays the sound of one video through the audio bridge, in step with its frames. |
VideoNatives | class | Installs the FFmpeg natives that videos need, from the classpath or downloaded once into the cache folder. |
VideoNativesException | class | The FFmpeg natives that videos need cannot be installed on this machine. |
VideoResourceDecoder | class | Plays a video file with FFmpeg, its frames into a texture and its sound through the audio bridge. |
VideoResourceFormat | class | The built-in format of MP4, Matroska (MKV, WebM) and AVI files, played as videos with FFmpeg. |
WebpResourceAnimationReader | class | Reads the frames of an animated WebP. |
WebpResourceFormat | class | The built-in format of WebP files, still or animated. |
Supporting types
Section titled “Supporting types”Nested types and listeners that the main types use.
| Type | Kind | Summary |
|---|---|---|
ResourceAnimationCanvas.Blend | enum | How a frame combines with the canvas under it. |
ResourceAnimationCanvas.Disposal | enum | What happens to the area of a frame before the next frame is drawn. |
