Completati primi test di calcoli qta da evadere
This commit is contained in:
@@ -38,20 +38,22 @@ internal class BarcodeAnalyzer(
|
||||
return
|
||||
}
|
||||
|
||||
val data = ByteArray(byteBuffer.remaining()).also { byteBuffer.get(it) }
|
||||
var data = ByteArray(byteBuffer.remaining()).also { byteBuffer.get(it) }
|
||||
|
||||
var width = image.width
|
||||
var height = image.height
|
||||
|
||||
val rotatedData = ByteArray(data.size)
|
||||
for (y in 0 until height) {
|
||||
for (x in 0 until width) rotatedData[x * height + height - y - 1] = data[x + y * width]
|
||||
}
|
||||
val tmp = width
|
||||
width = height
|
||||
height = tmp
|
||||
// val rotatedData = ByteArray(data.size)
|
||||
// for (y in 0 until height) {
|
||||
// for (x in 0 until width) rotatedData[x * height + height - y - 1] = data[x + y * width]
|
||||
// }
|
||||
//
|
||||
// data = rotatedData
|
||||
// val tmp = width
|
||||
// width = height
|
||||
// height = tmp
|
||||
|
||||
val source = PlanarYUVLuminanceSource(rotatedData, width, height, 0, 0, width, height, false).let {
|
||||
val source = PlanarYUVLuminanceSource(data, width, height, 0, 0, width, height, false).let {
|
||||
if (inverted) it.invert() else it
|
||||
}
|
||||
val bitmap = BinaryBitmap(HybridBinarizer(source))
|
||||
|
||||
Reference in New Issue
Block a user