val cameraConfiguration = CameraConfiguration(
pictureResolution = highestResolution(), // (optional) we want to have the highest possible photo resolution
previewResolution = highestResolution(), // (optional) we want to have the highest possible preview resolution
previewFpsRange = highestFps(), // (optional) we want to have the best frame rate
focusMode = firstAvailable( // (optional) use the first focus mode which is supported by device
continuousFocusPicture(),
autoFocus(), // if continuous focus is not available on device, auto focus will be used
fixed() // if even auto focus is not available - fixed focus mode will be used
),
flashMode = firstAvailable( // (optional) similar to how it is done for focus mode, this time for flash
autoRedEye(),
autoFlash(),
torch(),
off()
),
antiBandingMode = firstAvailable( // (optional) similar to how it is done for focus mode & flash, now for anti banding
auto(),
hz50(),
hz60(),
none()
),
jpegQuality = manualJpegQuality(30), // (optional) select a jpeg quality of 90 (out of 0-100) values
sensorSensitivity = lowestSensorSensitivity() // (optional) we want to have the lowest sensor sensitivity (ISO)
)
fotoapparat = Fotoapparat(
context = this,
view = camera_view, // view which will draw the camera preview
scaleType = ScaleType.CenterCrop, // (optional) we want the preview to fill the view
lensPosition = back(), // (optional) we want back camera
cameraConfiguration = cameraConfiguration,
cameraErrorCallback = { error -> logger.error("###", error.localizedMessage) } // (optional) log fatal errors
)
}
Used following code to configure fotoapparat.
private fun configureFotoApparat() {