-
- All Implemented Interfaces:
-
app.rive.AssetOps
public class ImageAsset.Companion implements AssetOps<ImageHandle, ImageAsset>
-
-
Method Summary
Modifier and Type Method Description final Result<ImageAsset>fromBytes(CommandQueue commandQueue, ByteArray bytes)Create and decode an image asset from the given byte array on the provided command queue. ImageHandledecode(CommandQueue queue, ByteArray bytes)Decode the asset from the given byte array on the provided command queue. Unitdelete(CommandQueue queue, ImageHandle handle)Delete the asset from the provided command queue. Unitregister(CommandQueue queue, String key, ImageHandle handle)Register the asset with the provided command queue under the given key. Unitunregister(CommandQueue queue, String key)Unregister the asset from the provided command queue for the given key. ImageAssetconstruct(ImageHandle handle, CommandQueue queue)Construct the asset instance from the given handle, key, and command queue. StringgetTag()The tag used for logging purposes. StringgetLabel()A label for the asset type, used in logging. -
-
Method Detail
-
fromBytes
final Result<ImageAsset> fromBytes(CommandQueue commandQueue, ByteArray bytes)
Create and decode an image asset from the given byte array on the provided command queue.
The image can only be used on the same CommandQueue it was created on.
Must be registered with ImageAsset.register to be used for referenced images.
- Parameters:
commandQueue- The command queue that owns the image.bytes- The byte array containing the image data to decode.
-
decode
ImageHandle decode(CommandQueue queue, ByteArray bytes)
Decode the asset from the given byte array on the provided command queue.
-
delete
Unit delete(CommandQueue queue, ImageHandle handle)
Delete the asset from the provided command queue.
-
register
Unit register(CommandQueue queue, String key, ImageHandle handle)
Register the asset with the provided command queue under the given key.
-
unregister
Unit unregister(CommandQueue queue, String key)
Unregister the asset from the provided command queue for the given key.
-
construct
ImageAsset construct(ImageHandle handle, CommandQueue queue)
Construct the asset instance from the given handle, key, and command queue.
-
-
-
-