Utils

object Utils

Utility class to provide helper methods.

Functions

Link copied to clipboard
fun convertToBitmap(data: ByteBuffer, width: Int, height: Int, rotationDegrees: Int): <ERROR CLASS>?

Convert NV21 format byte buffer to bitmap.

Link copied to clipboard
fun generateValidPreviewSizeList(camera: <ERROR CLASS>): List<CameraSizePair>

Generates a list of acceptable preview sizes. Preview sizes are not acceptable if there is not a corresponding picture size of the same aspect ratio. If there is a corresponding picture size of the same aspect ratio, the picture size is paired up with the preview size.

Link copied to clipboard
fun getBarcodeScanningClient(): <ERROR CLASS>
Link copied to clipboard
fun getCornerRoundedBitmap(srcBitmap: <ERROR CLASS>, cornerRadius: Int): <ERROR CLASS>
Link copied to clipboard
fun isPortraitMode(context: <ERROR CLASS>): Boolean

Properties

Link copied to clipboard
const val ASPECT_RATIO_TOLERANCE: Float = 0.01f

If the absolute difference between aspect ratios is less than this tolerance, they are considered to be the same aspect ratio.