ImageRef

class ImageRef(uniqueId: UUID, acquireStrongReference: Boolean) : Parcelable, AutoCloseable

Constructors

Link copied to clipboard
constructor(uniqueId: UUID, acquireStrongReference: Boolean)

Types

Link copied to clipboard

Properties

Link copied to clipboard

Unique id of the native resource the object points to.

Functions

Link copied to clipboard
fun clear()

Releases native resources stored by the ref. If two different ImageRef objects have the same uniqueId both of them become cleared.

Link copied to clipboard
external fun clone(): ImageRef?

Creates a deep copy of the image.

Link copied to clipboard
open override fun close()

Releases strong reference to the image

Link copied to clipboard
open override fun describeContents(): Int
Link copied to clipboard
external fun encodeImage(options: EncodeImageOptions = EncodeImageOptions()): ByteArray

Returns the stored image encoded with the given options.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
external fun hibernate()

Compresses ImageRef and stores it either on disk or in memory according to global settings.

Link copied to clipboard
external fun info(): ImageInfo?

Information about stored image.

Link copied to clipboard
external fun saveImage(path: String, options: SaveImageOptions = SaveImageOptions()): Boolean

Saves the stored image with the given options.

Link copied to clipboard

Converts ImageRef to serialized string representation with acquiring serialized reference to the native resource. You must eventually call deserialize, otherwise the reference will leak

Link copied to clipboard
external fun toBitmap(): Bitmap?

Returns stored image as a bitmap

Link copied to clipboard
fun toJson(imageSerializationMode: ImageSerializationMode): JSONObject

Converts the Image Ref to Json representation If serialization mode is REFERENCE effectively calls serialize If serialization mode is BUFFER stores the image inplace in base64 format

Link copied to clipboard
open override fun writeToParcel(parcel: Parcel, flags: Int)