Skip to content

Commit 9529cf6

Browse files
committed
Fix ktlint issues
1 parent faada67 commit 9529cf6

File tree

2 files changed

+22
-22
lines changed
  • sample/src/main/java/com/commit451/coiltransformations/sample
  • transformations-face-detection/src/main/java/com/commit451/coiltransformations/facedetection

2 files changed

+22
-22
lines changed

sample/src/main/java/com/commit451/coiltransformations/sample/App.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import android.app.Application
66
import android.util.Log
77
import coil.Coil
88
import coil.ImageLoader
9-
import coil.ImageLoaderFactory
109
import coil.memory.MemoryCache
1110
import coil.util.DebugLogger
1211

transformations-face-detection/src/main/java/com/commit451/coiltransformations/facedetection/CenterOnFaceTransformation.kt

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import coil.transform.Transformation
99
import com.google.mlkit.vision.common.InputImage
1010
import com.google.mlkit.vision.face.FaceDetection
1111
import com.google.mlkit.vision.face.FaceDetectorOptions
12+
import kotlinx.coroutines.suspendCancellableCoroutine
1213
import java.io.ByteArrayOutputStream
1314
import java.util.*
1415
import kotlin.coroutines.resume
1516
import kotlin.coroutines.resumeWithException
16-
import kotlinx.coroutines.suspendCancellableCoroutine
1717

1818
/**
1919
* Finds the largest face in an image, and center crops around it.
@@ -53,10 +53,10 @@ class CenterOnFaceTransformation constructor(
5353

5454
// Initialize FaceDetectorOptions
5555
val highAccuracyOpts = FaceDetectorOptions.Builder()
56-
.setPerformanceMode(FaceDetectorOptions.PERFORMANCE_MODE_ACCURATE)
57-
.setLandmarkMode(FaceDetectorOptions.LANDMARK_MODE_ALL)
58-
.setClassificationMode(FaceDetectorOptions.CLASSIFICATION_MODE_ALL)
59-
.build()
56+
.setPerformanceMode(FaceDetectorOptions.PERFORMANCE_MODE_ACCURATE)
57+
.setLandmarkMode(FaceDetectorOptions.LANDMARK_MODE_ALL)
58+
.setClassificationMode(FaceDetectorOptions.CLASSIFICATION_MODE_ALL)
59+
.build()
6060

6161
// Get a face detector.
6262
val detector = FaceDetection.getClient(highAccuracyOpts)
@@ -99,11 +99,11 @@ class CenterOnFaceTransformation constructor(
9999
*/
100100
private fun frameBitmap(input: Bitmap, square: Rect): Bitmap {
101101
return Bitmap.createBitmap(
102-
input,
103-
square.left,
104-
square.top,
105-
square.width(),
106-
square.height()
102+
input,
103+
square.left,
104+
square.top,
105+
square.width(),
106+
square.height()
107107
)
108108
}
109109

@@ -127,19 +127,20 @@ class CenterOnFaceTransformation constructor(
127127
val centerY = boundingBox.exactCenterY()
128128

129129
val halfWidth = Collections.min(
130-
listOf(
131-
centerX,
132-
centerY,
133-
input.width.toFloat() - centerX,
134-
input.height.toFloat() - centerY
135-
)
130+
listOf(
131+
centerX,
132+
centerY,
133+
input.width.toFloat() - centerX,
134+
input.height.toFloat() - centerY
135+
)
136136
)
137137
val width = halfWidth * 2
138138
val left = (centerX - halfWidth).toInt()
139139
val top = (centerY - halfWidth).toInt()
140140
val right = left + width.toInt()
141141
val bottom = top + width.toInt()
142-
return Rect(left, top, right, bottom
142+
return Rect(
143+
left, top, right, bottom
143144
)
144145
}
145146

@@ -299,10 +300,10 @@ class CenterOnFaceTransformation constructor(
299300
}
300301

301302
return Rect(
302-
left,
303-
top,
304-
right,
305-
bottom
303+
left,
304+
top,
305+
right,
306+
bottom
306307
)
307308
}
308309
}

0 commit comments

Comments
 (0)