ResourceBuilders.InlineImageResource

public final class ResourceBuilders.InlineImageResource


An image resource whose data is fully inlined, with no dependency on a system or app resource.

Summary

Public methods

static @NonNull ResourceBuilders.InlineImageResource.Builder

Returns a new Builder.

@NonNull Array<@NonNull byte>

Gets the byte array representing the image.

@ResourceBuilders.ImageFormat @NonNull int

Gets the format of the byte array data representing the image.

@Dimension(unit = "") @NonNull int

Gets the native height of the image, in pixels.

@Dimension(unit = "") @NonNull int

Gets the native width of the image, in pixels.

Public methods

builder

@NonNull
public static ResourceBuilders.InlineImageResource.Builder builder()

Returns a new Builder.

getData

@NonNull
public Array<@NonNull byte> getData()

Gets the byte array representing the image. Intended for testing purposes only.

getFormat

@ResourceBuilders.ImageFormat
@NonNull
public @ResourceBuilders.ImageFormat int getFormat()

Gets the format of the byte array data representing the image. May be left unspecified or set to IMAGE_FORMAT_UNDEFINED in which case the platform will attempt to extract this from the raw image data. If the platform does not support the format, the image will not be decoded or displayed. Intended for testing purposes only.

getHeightPx

@Dimension(unit = "")
@NonNull
public @Dimension(unit = "") int getHeightPx()

Gets the native height of the image, in pixels. Only required for formats (e.g. IMAGE_FORMAT_RGB_565) where the image data does not include size. Intended for testing purposes only.

getWidthPx

@Dimension(unit = "")
@NonNull
public @Dimension(unit = "") int getWidthPx()

Gets the native width of the image, in pixels. Only required for formats (e.g. IMAGE_FORMAT_RGB_565) where the image data does not include size. Intended for testing purposes only.