feat: 提交0.4加速版二维码直传与自动配网优化

This commit is contained in:
zhy
2026-08-10 20:29:01 +08:00
parent 241e22abea
commit 0b7ffd2dab
17 changed files with 1462 additions and 111 deletions
@@ -60,6 +60,18 @@ data class LockRect(
return d > max(width, height) / 18
}
/** Intersection-over-union for consecutive finder-point measurements. */
fun overlap(other: LockRect?): Float {
if (other == null) return 0f
val l = max(left, other.left)
val t = max(top, other.top)
val r = min(right, other.right)
val b = min(bottom, other.bottom)
val intersection = max(0, r - l).toLong() * max(0, b - t).toLong()
val union = width.toLong() * height.toLong() + other.width.toLong() * other.height.toLong() - intersection
return if (union <= 0L) 0f else (intersection.toDouble() / union.toDouble()).toFloat()
}
companion object {
/**
* ZXing normally returns the finder-pattern centers. Their bounding box