11package com.darkrockstudios.app.securecamera.obfuscation
22
33import android.graphics.Bitmap
4+ import android.graphics.Canvas
45import android.graphics.PointF
56import android.graphics.Rect
67import android.media.FaceDetector
@@ -16,11 +17,11 @@ class AndroidFacialDetection : FacialDetection {
1617 val bitmapForDetection = if (bitmap.config != Bitmap .Config .RGB_565 ) {
1718 try {
1819 createBitmap(bitmap.width, bitmap.height, Bitmap .Config .RGB_565 ).also { targetBitmap ->
19- val canvas = android.graphics. Canvas (targetBitmap)
20+ val canvas = Canvas (targetBitmap)
2021 canvas.drawBitmap(bitmap, 0f , 0f , null )
2122 }
2223 } catch (e: Exception ) {
23- Timber .e(e, " Failed to convert bitmap to RGB_565" )
24+ Timber .Forest . e(e, " Failed to convert bitmap to RGB_565" )
2425 return @withContext emptyList<FacialDetection .FoundFace >()
2526 }
2627 } else {
@@ -36,7 +37,7 @@ class AndroidFacialDetection : FacialDetection {
3637
3738 // Find faces in the bitmap
3839 val facesFound = detector.findFaces(bitmapForDetection, faces)
39- Timber .d(" Found $facesFound faces using Android FaceDetector" )
40+ Timber .Forest . d(" Found $facesFound faces using Android FaceDetector" )
4041
4142 // Convert the detected faces to our FoundFace format
4243 val foundFaces = mutableListOf<FacialDetection .FoundFace >()
@@ -88,8 +89,8 @@ class AndroidFacialDetection : FacialDetection {
8889
8990 foundFaces
9091 } catch (e: Exception ) {
91- Timber .e(e, " Error detecting faces with Android FaceDetector" )
92+ Timber .Forest . e(e, " Error detecting faces with Android FaceDetector" )
9293 emptyList()
9394 }
9495 }
95- }
96+ }
0 commit comments