mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-08 09:18:39 +01:00
Upgrade CameraX to 1.1.0 and fork removal.
This commit is contained in:
committed by
Greyson Parrelli
parent
e3e9f90094
commit
a52b64281c
@@ -1,6 +1,7 @@
|
||||
package org.signal.qr
|
||||
|
||||
import android.graphics.ImageFormat
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.camera.core.ImageProxy
|
||||
import com.google.zxing.LuminanceSource
|
||||
import java.nio.ByteBuffer
|
||||
@@ -13,6 +14,7 @@ import java.nio.ByteBuffer
|
||||
* An image width can be reported as 1080 but the row stride may be 1088. Thus when representing a row-major
|
||||
* 2D array as a 1D array, the math can go sideways if width is used instead of row stride.
|
||||
*/
|
||||
@RequiresApi(21)
|
||||
class ImageProxyLuminanceSource(image: ImageProxy) : LuminanceSource(image.width, image.height) {
|
||||
|
||||
val yData: ByteArray
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.signal.qr
|
||||
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.camera.core.ImageProxy
|
||||
import com.google.zxing.BinaryBitmap
|
||||
import com.google.zxing.ChecksumException
|
||||
@@ -23,6 +24,7 @@ class QrProcessor {
|
||||
private var previousHeight = 0
|
||||
private var previousWidth = 0
|
||||
|
||||
@RequiresApi(21)
|
||||
fun getScannedData(proxy: ImageProxy): String? {
|
||||
return getScannedData(ImageProxyLuminanceSource(proxy))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user