-
public class RiveRenderImage.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static RiveRenderImage.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final RiveRenderImagemake(ByteArray bytes, RendererType rendererType)Creates a RiveRenderImage by decoding the bytes. final RiveRenderImagefromEncoded(ByteArray encodedBytes, RendererType rendererType)Creates a RiveRenderImage by decoding the encodedBytes. final RiveRenderImagefromRGBABytes(ByteArray pixelBytes, Integer width, Integer height, RendererType rendererType, Boolean premultiplied)Creates a RiveRenderImage from RGBA8888 pixel bytes. final RiveRenderImagefromARGBInts(IntArray pixels, Integer width, Integer height, RendererType rendererType, Boolean premultiplied)Creates a RiveRenderImage from ARGB8888 packed pixel integers, matching Android Bitmap.getPixels. final RiveRenderImagefromBitmap(Bitmap bitmap, RendererType rendererType)Create a RiveRenderImage from a Bitmap. -
-
Method Detail
-
make
@Deprecated(message = This method name is misleading; use fromEncoded instead, replaceWith = @ReplaceWith(imports = {}, expression = fromEncoded(bytes, rendererType))) final RiveRenderImage make(ByteArray bytes, RendererType rendererType)
Creates a RiveRenderImage by decoding the bytes.
The caller is in charge of the ownership of this NativeObject. It must be freed by calling release.
- Parameters:
bytes- Encoded bytes for the image.rendererType- The renderer for this image.
-
fromEncoded
final RiveRenderImage fromEncoded(ByteArray encodedBytes, RendererType rendererType)
Creates a RiveRenderImage by decoding the encodedBytes.
The caller is in charge of the ownership of this NativeObject. It must be freed calling release.
- Parameters:
encodedBytes- Encoded bytes for the image.rendererType- The renderer for this image.
-
fromRGBABytes
final RiveRenderImage fromRGBABytes(ByteArray pixelBytes, Integer width, Integer height, RendererType rendererType, Boolean premultiplied)
Creates a RiveRenderImage from RGBA8888 pixel bytes.
The byte array must be exactly width * height * 4 bytes.
The caller is in charge of the ownership of this NativeObject. It must be freed by calling release.
- Parameters:
pixelBytes- RGBA8888 pixel bytes.width- The width of the image in pixels.height- The height of the image in pixels.rendererType- The renderer for this image.premultiplied- Whether your RGB pixels are already multiplied by alpha.
-
fromARGBInts
final RiveRenderImage fromARGBInts(IntArray pixels, Integer width, Integer height, RendererType rendererType, Boolean premultiplied)
Creates a RiveRenderImage from ARGB8888 packed pixel integers, matching Android Bitmap.getPixels.
The int array must be exactly width * height elements.
The caller is in charge of the ownership of this NativeObject. It must be freed by calling release.
- Parameters:
pixels- ARGB8888 packed pixel integers.width- The width of the image in pixels.height- The height of the image in pixels.rendererType- The renderer for this image.premultiplied- Whether your RGB pixels are already multiplied by alpha.
-
fromBitmap
final RiveRenderImage fromBitmap(Bitmap bitmap, RendererType rendererType)
Create a RiveRenderImage from a Bitmap. Ensures ARGB_8888 software bitmap, copying if not, and forwards to fromARGBInts.
The caller is in charge of the ownership of this NativeObject. It must be freed by calling release.
The bitmap supplied is given directly to the canvas when using the Canvas renderer, so ensure that it is not recycled while in use by Rive.
- Parameters:
bitmap- The source bitmap.rendererType- The renderer for this image.
-
-
-
-