OSDN Git Service

PIXPROの撮影ロジックを A01eよりフィードバック。
authorMRSa <mrsa@myad.jp>
Wed, 15 Sep 2021 13:56:30 +0000 (22:56 +0900)
committerMRSa <mrsa@myad.jp>
Wed, 15 Sep 2021 13:56:30 +0000 (22:56 +0900)
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakFocusingControl.java
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/IKodakMessages.java
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakChangeMode.kt [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakExecuteShutter.java
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakExecuteVideo.kt [new file with mode: 0644]
build.gradle

index de1c860..dbe7849 100644 (file)
@@ -1,6 +1,5 @@
 package net.osdn.gokigen.a01d.camera.kodak.operation;
 
-
 import android.graphics.PointF;
 import android.util.Log;
 import android.view.MotionEvent;
@@ -14,7 +13,6 @@ import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific.Koda
 
 import net.osdn.gokigen.a01d.liveview.IAutoFocusFrameDisplay;
 
-
 public class KodakFocusingControl implements IFocusingControl, IKodakCommandCallback
 {
     private final String TAG = this.toString();
@@ -102,12 +100,17 @@ public class KodakFocusingControl implements IFocusingControl, IKodakCommandCall
 
     private void lockAutoFocus(PointF point)
     {
-        float maxPointLimitWidth = 1000000.0f;
-        float maxPointLimitHeight = 1000000.0f;
+        // 数値は現物合わせ...
+        float maxPointLimitWidth = 991684.0f;  // 1000000.0f;
+        float maxPointLimitHeight = 959912.0f; // 1000000.0f;
         try
         {
-            int x = (0x00ffffff & (Math.round(point.x * maxPointLimitWidth) + 1));
-            int y = (0x00ffffff & (Math.round(point.y * maxPointLimitHeight) + 1));
+            //int x = (0x00ffffff & (Math.round(point.x * maxPointLimitWidth) + 1));
+            //int y = (0x00ffffff & (Math.round(point.y * maxPointLimitHeight) + 1));
+
+            // 数値は現物合わせ...
+            int x = (0x00ffffff & (Math.round(point.x * maxPointLimitWidth) +  4150));
+            int y = (0x00ffffff & (Math.round(point.y * maxPointLimitHeight)+ 32528));
             Log.v(TAG, "Lock AF: [" + x + ","+ y + "]");
             commandPublisher.enqueueCommand(new KodakExecuteFocus(this, x, y));
         }
index a395eff..16580c7 100644 (file)
@@ -5,16 +5,16 @@ public interface IKodakMessages
     int SEQ_DUMMY = 0;
     int SEQ_RECEIVE_ONLY = 1;
 
+    int SEQ_CHANGE_MODE = 9;
     int SEQ_SHUTTER = 10;
     int SEQ_FOCUS = 11;
     int SEQ_ZOOM = 12;
-
+    int SEQ_VIDEO = 13;
 
     int SEQ_FLASH_OFF = 20;
     int SEQ_FLASH_ON = 21;
     int SEQ_FLASH_AUTO = 22;
 
-
     int SEQ_CONNECT_01 = 101;
     int SEQ_CONNECT_02 = 102;
     int SEQ_CONNECT_03 = 103;
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakChangeMode.kt b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakChangeMode.kt
new file mode 100644 (file)
index 0000000..e5dd58b
--- /dev/null
@@ -0,0 +1,67 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CHANGE_MODE
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase
+
+class KodakChangeMode(private val callback: IKodakCommandCallback, modeValue0: Int, modeValue1: Int = 0x00) : KodakCommandBase()
+{
+    private val data0: Byte = modeValue0.toByte()
+    private val data1: Byte = modeValue1.toByte()
+
+    override fun getId() : Int
+    {
+        return (SEQ_CHANGE_MODE)
+    }
+
+    override fun commandBody(): ByteArray
+    {
+        return byteArrayOf(
+            0x2e.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x20.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0xed.toByte(), 0x03.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x01.toByte(), 0x00.toByte(), 0x00.toByte(), 0x80.toByte(),
+
+            0x12.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x01.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x01.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x20.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x12.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x69.toByte(), 0x08.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x69.toByte(), 0x08.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            data0, data1, 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0xff.toByte(), 0xff.toByte(), 0xff.toByte(), 0xff.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte()
+        )
+    }
+
+    override fun responseCallback(): IKodakCommandCallback
+    {
+        return callback
+    }
+}
\ No newline at end of file
index 9d74353..bfc2861 100644 (file)
@@ -27,6 +27,7 @@ public class KodakExecuteShutter extends KodakCommandBase
     {
         return (new byte[]
                 {
+/*
                         //  (byte) 0xf9, (byte) 0x03
                         (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x30 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xf9 , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
                         (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x02 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
@@ -39,7 +40,7 @@ public class KodakExecuteShutter extends KodakCommandBase
                         (byte) 0x01 , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
                         (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xbf , (byte) 0x4d , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x88 , (byte) 0x65 , (byte) 0xb6 ,
                         (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
-
+*/
                         // (byte) 0xef, (byte) 0x03
                         (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x08 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xef , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
                         (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakExecuteVideo.kt b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakExecuteVideo.kt
new file mode 100644 (file)
index 0000000..4204938
--- /dev/null
@@ -0,0 +1,66 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_VIDEO
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase
+
+class KodakExecuteVideo(private val callback: IKodakCommandCallback, isStop: Boolean = false, private val isDumpLog: Boolean = false) : KodakCommandBase()
+{
+    private val data0: Byte = if (isStop) 0x03.toByte() else 0x02.toByte()
+
+    override fun getId() : Int
+    {
+        return (SEQ_VIDEO)
+    }
+
+    override fun dumpLog(): Boolean
+    {
+        return (isDumpLog)
+    }
+
+    override fun commandBody(): ByteArray
+    {
+        return byteArrayOf(
+
+            //  (byte) 0xf9, (byte) 0x03
+            0x2e.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x08.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0xf0.toByte(), 0x03.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x01.toByte(), 0x00.toByte(), 0x00.toByte(), 0x80.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x01.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x01.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x08.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            data0, 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+
+            0xff.toByte(), 0xff.toByte(), 0xff.toByte(), 0xff.toByte(),
+            0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte(),
+        )
+    }
+
+    override fun responseCallback(): IKodakCommandCallback
+    {
+        return callback
+    }
+
+}
\ No newline at end of file
index b5e98c5..86e5f22 100644 (file)
@@ -7,7 +7,7 @@ buildscript {
         mavenCentral()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.0.1'
+        classpath 'com.android.tools.build:gradle:7.0.2'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
 
         // NOTE: Do not place your application dependencies here; they belong