From 2dd32db291e290842cf74e13d17e7a039a79a274 Mon Sep 17 00:00:00 2001 From: MRSa Date: Wed, 15 Sep 2021 21:37:05 +0900 Subject: [PATCH] =?utf8?q?WPZ=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC=E3=82=AB?= =?utf8?q?=E3=82=B9=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=80=81=E7=8F=BE?= =?utf8?q?=E7=89=A9=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A7=E5=AF=BE=E5=BF=9C?= =?utf8?q?=E3=81=99=E3=82=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../camera/vendor/pixpro/operation/FocusControl.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/vendor/pixpro/operation/FocusControl.kt b/app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/vendor/pixpro/operation/FocusControl.kt index 590e860..3774349 100644 --- a/app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/vendor/pixpro/operation/FocusControl.kt +++ b/app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/vendor/pixpro/operation/FocusControl.kt @@ -75,12 +75,14 @@ class FocusControl(private val commandPublisher: IPixproCommandPublisher, privat lockAutoFocus(PointF(0.5f, 0.5f)) } - private fun lockAutoFocus(point: PointF) { - val maxPointLimitWidth = 1000000.0f - val maxPointLimitHeight = 1000000.0f + private fun lockAutoFocus(point: PointF) + { + // 現物実測で合わせる... + val maxPointLimitWidth = 991684.0f // 942080.0f // 1000000.0f + val maxPointLimitHeight = 959912.0f // 942080.0f // 1000000.0f try { - val x = 0x00ffffff and (point.x * maxPointLimitWidth).roundToInt() + 1 - val y = 0x00ffffff and (point.y * maxPointLimitHeight).roundToInt() + 1 + val x = 0x00ffffff and (point.x * maxPointLimitWidth).roundToInt() + 4150 // 1 // 40960 + val y = 0x00ffffff and (point.y * maxPointLimitHeight).roundToInt() + 32528 // 1 // 40960 Log.v(TAG, "Lock AF: [$x,$y]") commandPublisher.enqueueCommand(PixproExecuteFocus(this, x, y)) } catch (e: Exception) { -- 2.11.0