Package 

Object RiveRenderImage.Companion

    • Method Detail

      • 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.