summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/FilterShowActivity.java
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-17 01:19:33 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-17 01:19:33 -0800
commitf4cfa24e62dc4278c5b0f168339c98ceb28b41fa (patch)
tree9d07356686b0819e213abe5df30b8e2693242dba /src/com/android/gallery3d/filtershow/FilterShowActivity.java
parentda18922b986dd6759ec70180b41f0dff8140c06c (diff)
parentfff12515839ced96622d5a8c242858d04bffdc13 (diff)
downloadandroid_packages_apps_Gallery2-f4cfa24e62dc4278c5b0f168339c98ceb28b41fa.tar.gz
android_packages_apps_Gallery2-f4cfa24e62dc4278c5b0f168339c98ceb28b41fa.tar.bz2
android_packages_apps_Gallery2-f4cfa24e62dc4278c5b0f168339c98ceb28b41fa.zip
Merge "Galley: add DDM feature code"
Diffstat (limited to 'src/com/android/gallery3d/filtershow/FilterShowActivity.java')
-rwxr-xr-xsrc/com/android/gallery3d/filtershow/FilterShowActivity.java36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 8ada5af9b..f769b5ecd 100755
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -39,6 +39,7 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
+import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
@@ -105,6 +106,9 @@ import com.android.gallery3d.filtershow.editors.HazeBusterEditor;
import com.android.gallery3d.filtershow.editors.ImageOnlyEditor;
import com.android.gallery3d.filtershow.editors.SeeStraightEditor;
import com.android.gallery3d.filtershow.editors.TrueScannerEditor;
+import com.android.gallery3d.filtershow.filters.FilterDualCamBasicRepresentation;
+import com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation;
+import com.android.gallery3d.filtershow.filters.FilterDualCamSketchRepresentation;
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation;
import com.android.gallery3d.filtershow.filters.FilterRepresentation;
import com.android.gallery3d.filtershow.filters.FilterRotateRepresentation;
@@ -1156,6 +1160,23 @@ DialogInterface.OnDismissListener, PopupMenu.OnDismissListener{
return;
}
}
+ if (representation.getFilterType() == FilterRepresentation.TYPE_DUALCAM) {
+ DisplayMetrics dm = getResources().getDisplayMetrics();
+ float[] mTmpPoint = new float[2];
+ mTmpPoint[0] = dm.widthPixels/2;
+ mTmpPoint[1] = dm.heightPixels/2;
+ Matrix m = MasterImage.getImage().getScreenToImageMatrix(true);
+ m.mapPoints(mTmpPoint);
+ if (representation instanceof FilterDualCamBasicRepresentation) {
+ ((FilterDualCamBasicRepresentation)representation).setPoint((int)mTmpPoint[0],(int)mTmpPoint[1]);
+ }
+ if (representation instanceof FilterDualCamFusionRepresentation) {
+ ((FilterDualCamFusionRepresentation)representation).setPoint((int)mTmpPoint[0],(int)mTmpPoint[1]);
+ }
+ if (representation instanceof FilterDualCamSketchRepresentation) {
+ ((FilterDualCamSketchRepresentation)representation).setPoint((int)mTmpPoint[0],(int)mTmpPoint[1]);
+ }
+ }
useFilterRepresentation(representation);
loadEditorPanel(representation);
@@ -1290,23 +1311,20 @@ DialogInterface.OnDismissListener, PopupMenu.OnDismissListener{
mAuxImgData == null) {
// parse failed
MasterImage.getImage().setDepthMapLoadingStatus(DdmStatus.DDM_FAILED);
- Fragment currentPanel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
- if (currentPanel instanceof MainPanel) {
- MainPanel mainPanel = (MainPanel) currentPanel;
- mainPanel.updateDualCameraButton();
- }
} else {
+ MasterImage.getImage().setDepthMapLoadingStatus(DdmStatus.DDM_LOADING);
mLoadMpoTask = new LoadMpoDataTask();
mLoadMpoTask.execute(mPrimaryImgData, mAuxImgData);
}
+ Fragment currentPanel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
+ if (currentPanel instanceof MainPanel) {
+ MainPanel mainPanel = (MainPanel) currentPanel;
+ mainPanel.updateDualCameraButton();
+ }
}
}
private class LoadMpoDataTask extends AsyncTask<byte[], Void, Boolean> {
- @Override
- protected void onPreExecute() {
- MasterImage.getImage().setDepthMapLoadingStatus(DdmStatus.DDM_LOADING);
- }
@Override
protected Boolean doInBackground(byte[]... params) {