• R/O
  • HTTP
  • SSH
  • HTTPS

A01d: Commit

OPC(Olympus Air)用望遠鏡アプリ。


Commit MetaInfo

Révisionb88d0d73f9f01fbcd1232024060cdeaf5652d498 (tree)
l'heure2018-07-29 15:21:52
AuteurMRSa <mrsa@myad...>
CommiterMRSa

Message de Log

次バージョンリリース準備。ログ出力タグの間違い修正。不要なOLYCamera依存を削除。

Change Summary

Modification

--- a/app/build.gradle
+++ b/app/build.gradle
@@ -7,8 +7,8 @@ android {
77 applicationId "net.osdn.gokigen.a01d"
88 minSdkVersion 14
99 targetSdkVersion 27
10- versionCode 10200
11- versionName "1.2.0"
10+ versionCode 10201
11+ versionName "1.2.1"
1212 }
1313 buildTypes {
1414 release {
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/operation/takepicture/RicohGr2AutoFocusControl.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/operation/takepicture/RicohGr2AutoFocusControl.java
@@ -14,7 +14,7 @@ import org.json.JSONObject;
1414
1515 public class RicohGr2AutoFocusControl
1616 {
17- private static final String TAG = SonyAutoFocusControl.class.getSimpleName();
17+ private static final String TAG = RicohGr2AutoFocusControl.class.getSimpleName();
1818 private final IIndicatorControl indicator;
1919 private final IAutoFocusFrameDisplay frameDisplayer;
2020 private String lockAutoFocusUrl = "http://192.168.0.1/v1/lens/focus/lock";
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/wrapper/connection/RicohGr2CameraConnectSequence.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/wrapper/connection/RicohGr2CameraConnectSequence.java
@@ -41,6 +41,13 @@ class RicohGr2CameraConnectSequence implements Runnable
4141 {
4242 SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
4343
44+ // 接続時、レンズロックOFF
45+ {
46+ final String postData = "cmd=acclock off";
47+ String response0 = SimpleHttpClient.httpPost(grCommandUrl, postData, TIMEOUT_MS);
48+ Log.v(TAG, grCommandUrl + " " + response0);
49+ }
50+
4451 // 接続時、カメラの画面を消す
4552 if (preferences.getBoolean(IPreferencePropertyAccessor.GR2_LCD_SLEEP, false))
4653 {
--- a/app/src/main/java/net/osdn/gokigen/a01d/liveview/CameraLiveImageView.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/liveview/CameraLiveImageView.java
@@ -36,8 +36,6 @@ import java.util.Map;
3636 import java.util.Timer;
3737 import java.util.TimerTask;
3838
39-import jp.co.olympus.camerakit.OLYCamera;
40-
4139 /**
4240 * CameraLiveImageView :
4341 * (OLYMPUS の ImageCaptureSample そのまま)
@@ -251,7 +249,7 @@ public class CameraLiveImageView extends View implements IImageDataReceiver, IAu
251249 imageWidth = imageBitmap.getHeight();
252250 imageHeight = imageBitmap.getWidth();
253251 }
254- return (OLYCamera.convertPointOnLiveImageIntoViewfinder(pointOnImage, imageWidth, imageHeight, imageRotationDegrees));
252+ return (convertPointOnLiveImageIntoViewfinder(pointOnImage, imageWidth, imageHeight, imageRotationDegrees));
255253 }
256254
257255 /**
@@ -467,7 +465,7 @@ public class CameraLiveImageView extends View implements IImageDataReceiver, IAu
467465 //Log.v(TAG, "drawFocusFrame() :" + focusFrameStatus);
468466
469467 // Calculate the rectangle of focus.
470- RectF focusRectOnImage = OLYCamera.convertRectOnViewfinderIntoLiveImage(focusFrameRect, imageWidth, imageHeight, imageRotationDegrees);
468+ RectF focusRectOnImage = convertRectOnViewfinderIntoLiveImage(focusFrameRect, imageWidth, imageHeight, imageRotationDegrees);
471469 RectF focusRectOnView = convertRectFromImageArea(focusRectOnImage);
472470
473471 // Draw a rectangle to the canvas.
@@ -864,6 +862,65 @@ public class CameraLiveImageView extends View implements IImageDataReceiver, IAu
864862 }
865863
866864 /**
865+ *  ライブビュー座標系の点座標をビューファインダー座標系の点座標に変換
866+ *
867+ *
868+ */
869+ private PointF convertPointOnLiveImageIntoViewfinder(PointF point, float width, float height, int rotatedDegrees)
870+ {
871+ float viewFinderPointX = 0.5f;
872+ float viewFinderPointY = 0.5f;
873+ try
874+ {
875+ if (rotatedDegrees == 0 || rotatedDegrees == 180) {
876+ viewFinderPointX = point.x / width;
877+ viewFinderPointY = point.y / height;
878+ } else {
879+ viewFinderPointX = point.y / width;
880+ viewFinderPointY = point.x / height;
881+ }
882+ }
883+ catch (Exception e)
884+ {
885+ e.printStackTrace();
886+ }
887+ return (new PointF(viewFinderPointX, viewFinderPointY));
888+ }
889+
890+ /**
891+ *  ビューファインダー座標系の矩形座標をライブビュー座標系のの矩形座標に変換
892+ *
893+ *
894+ */
895+ private RectF convertRectOnViewfinderIntoLiveImage(RectF rect, float width, float height, int rotatedDegrees)
896+ {
897+ float top = 0.0f;
898+ float bottom = 1.0f;
899+ float left = 0.0f;
900+ float right = 1.0f;
901+ try
902+ {
903+ if (rotatedDegrees == 0 || rotatedDegrees == 180) {
904+ top = rect.top * height;
905+ bottom = rect.bottom * height;
906+ left = rect.left * width;
907+ right = rect.right * width;
908+ } else {
909+ left = rect.top * height;
910+ right = rect.bottom * height;
911+ top = rect.left * width;
912+ bottom = rect.right * width;
913+ }
914+ }
915+ catch (Exception e)
916+ {
917+ e.printStackTrace();
918+ }
919+ return (new RectF(left, top, right, bottom));
920+ }
921+
922+
923+ /**
867924 * Converts a rectangle on image area to a rectangle on view area.
868925 *
869926 * @param rect A rectangle on image area. (e.g. a live preview image)
Afficher sur ancien navigateur de dépôt.