CameraUtils

object CameraUtils

Functions

Link copied to clipboard
fun convertToBitmap(    data: ByteBuffer,     width: Int,     height: Int,     rotationDegrees: Int): Bitmap?

Convert NV21 format byte buffer to bitmap.

Link copied to clipboard
fun generateValidPreviewSizeList(camera: Camera): 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 getBarcodeReticleBox(overlay: GraphicOverlay): RectF
Link copied to clipboard
fun getProgressToMeetBarcodeSizeRequirement(overlay: GraphicOverlay, barcode: Barcode): Float
Link copied to clipboard
fun isPortraitMode(context: Context): Boolean

Check if the camera is in portrait mode.

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.