CREATOR

Functions

Link copied to clipboard
Link copied to clipboard
open override fun createFromParcel(parcel: Parcel): ImageRef?
Link copied to clipboard

Creates ImageRef from serialized string representation with upgrading serialized reference to a strong one

Link copied to clipboard
external fun fromBitmap(bitmap: Bitmap, options: BasicImageLoadOptions = BasicImageLoadOptions()): ImageRef

Creates ImageRef from a bitmap.

Link copied to clipboard
fun fromEncodedBuffer(encodedBuffer: ByteBuffer, options: BufferImageLoadOptions = BufferImageLoadOptions()): ImageRef
external fun fromEncodedBuffer(encodedBuffer: ByteArray, options: BufferImageLoadOptions = BufferImageLoadOptions()): ImageRef

Creates ImageRef from encoded buffer, e.g. from jpeg.

Link copied to clipboard
fun fromInputStream(inputStream: InputStream, options: BufferImageLoadOptions = BufferImageLoadOptions()): ImageRef

Creates ImageRef from the given input stream of encoded bytes

Link copied to clipboard
Link copied to clipboard
external fun fromNv21(nv21: ByteArray, width: Int, height: Int, options: RawImageLoadOptions = RawImageLoadOptions()): ImageRef

Creates ImageRef from nv21 bytes

Link copied to clipboard
external fun fromPath(path: String, options: PathImageLoadOptions = PathImageLoadOptions()): ImageRef

Creates ImageRef from the path to an image.

Link copied to clipboard
Link copied to clipboard
fun fromYUV420(yPlaneBuffer: ByteBuffer, yPlaneRowStride: Int, yPlanePixelStride: Int, uPlaneBuffer: ByteBuffer, uPlaneRowStride: Int, uPlanePixelStride: Int, vPlaneBuffer: ByteBuffer, vPlaneRowStride: Int, vPlanePixelStride: Int, width: Int, height: Int, options: RawImageLoadOptions = RawImageLoadOptions()): ImageRef

Creates ImageRef from yuv_420_888 image

Link copied to clipboard
open override fun newArray(size: Int): Array<ImageRef?>
Link copied to clipboard

By default, ImageRef supports decoding JPEG and PNG images. To add support for more image formats, e.g. HEIC, decoders for which are provided by Android Platform this function should be called once at the application startup.

Link copied to clipboard

Releases all alive images despite any existing references.

Link copied to clipboard
external fun releaseStrongReference(uniqueId: UUID): Boolean
Link copied to clipboard
external fun setHibernationCacheDirPath(cacheDirPath: String?): Result<Unit>

Sets directory in which hibernated images are stored. If null is passed, then hibernated images are stored in compressed format in memory. Can be set at most once, best when the application is initialized but in any case before any ImageRef is created.

Link copied to clipboard
external fun setHibernationJpegQuality(quality: Int)

Sets the quality of JPEG compression used to encode images when hibernating. The default is 80.

Link copied to clipboard
external fun setStorageCryptingProvider(storageCryptingProvider: CoreStreamProvider?): Result<Unit>

Sets storageCryptingProvider that is used when an image is read/written from/to disk. The provider is used both when images are hibernated and when they are saved/loaded from disk with saveImage/fromPath. Can be set at most once, best when the application is initialized but in any case before any ImageRef is created.

Link copied to clipboard