Я изучаю CameraX API, а CameraXBasic - это образец кода для офиса.
CameraFragment.kt в проекте CameraXBasic отображает предварительный просмотр реальной камеры.
Теперь я надеюсь показать превью в негативном режиме. Как я могу использовать CameraX API? Есть ли образец кода?
CameraFragment.kt
private lateinit var viewFinder: TextureView
private fun bindCameraUseCases() {
// Get screen metrics used to setup camera for full screen resolution
val metrics = DisplayMetrics().also { viewFinder.display.getRealMetrics(it) }
val screenAspectRatio = Rational(metrics.widthPixels, metrics.heightPixels)
Log.d(TAG, "Screen metrics: ${metrics.widthPixels} x ${metrics.heightPixels}")
// Set up the view finder use case to display camera preview
val viewFinderConfig = PreviewConfig.Builder().apply {
setLensFacing(lensFacing)
// We request aspect ratio but no resolution to let CameraX optimize our use cases
setTargetAspectRatio(screenAspectRatio)
// Set initial target rotation, we will have to call this again if rotation changes
// during the lifecycle of this use case
setTargetRotation(viewFinder.display.rotation)
}.build()
// Use the auto-fit preview builder to automatically handle size and orientation changes
preview = AutoFitPreviewBuilder.build(viewFinderConfig, viewFinder)
....
CameraX.bindToLifecycle(
viewLifecycleOwner, preview, imageCapture, imageAnalyzer)
}
negative mode
? - person Froyo   schedule 03.12.2019RenderScript
. 1. Как использовать RenderScript с камеройX gist.github.com/LiewJunTung/b9b7fbe8444037f2. отрицательный эффект developer.android.com/reference/android/media/ эффект / - person Froyo   schedule 03.12.2019