ImageProcessor

Class for applying chains of image processing operations.

Constructors

Link copied to clipboard
constructor(bitmap: Bitmap)
constructor(nv21: ByteArray, width: Int, height: Int, orientation: ImageRotation = ImageRotation.NONE)
constructor(jpeg: ByteArray)
constructor(imagePath: String)
constructor(imageRef: ImageRef)
constructor()

Functions

Link copied to clipboard

Applies filter to the image.

Link copied to clipboard
fun crop(polygon: List<PointF>): ImageProcessor
fun crop(imageRef: ImageRef, polygon: List<PointF>): ImageProcessor

Crops the image to the given polygon.

Link copied to clipboard
open override fun dispose()

Calling this method will clear native buffer for ImageProcessor. It will be recreated if it will be called again

Link copied to clipboard
fun encodedProcessedImage(encodeImageOptions: EncodeImageOptions = EncodeImageOptions.default()): ByteArray?

Returns encoded processed image as ByteArray.

Link copied to clipboard

Returns processed image.

Link copied to clipboard
fun resize(maxSize: Int): ImageProcessor
fun resize(imageRef: ImageRef, maxSize: Int): ImageProcessor

Resizes image to the given size.

Link copied to clipboard
fun rotate(imageRef: ImageRef, rotation: ImageRotation): ImageProcessor

Rotates the given image.

fun rotate(degrees: Int): ImageProcessor
fun rotate(imageRef: ImageRef, degrees: Int): ImageProcessor

Rotates the given image clockwise.

Link copied to clipboard
fun saveProcessedImage(path: String, saveImageOptions: SaveImageOptions = SaveImageOptions.default()): Boolean

Saves processed image to the given path.