diff options
author | mbansal <mayank.bansal@sri.com> | 2011-09-19 11:11:27 -0400 |
---|---|---|
committer | Wei-Ta Chen <weita@google.com> | 2011-09-20 13:56:01 -0700 |
commit | b28b9c0fa991bc97e8aa11da83d27f71fdfef6da (patch) | |
tree | b52011c6155ccd8e34c0770ed41bd3e4d7378877 /src/com | |
parent | 494c4065b52bd58faa29307ccdb60dd425a843eb (diff) | |
download | LegacyCamera-b28b9c0fa991bc97e8aa11da83d27f71fdfef6da.zip LegacyCamera-b28b9c0fa991bc97e8aa11da83d27f71fdfef6da.tar.gz LegacyCamera-b28b9c0fa991bc97e8aa11da83d27f71fdfef6da.tar.bz2 |
Blending algorithm updates to support WIDE strip-based blending.
1) Added algorithm to select wider strips (and made it the default mode in the app).
2) Added algorithm to cross-fade blend between the wider strips.
Change-Id: I744e69edb16a20f0040ee82c3390548b78853087
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/panorama/Mosaic.java | 22 | ||||
-rw-r--r-- | src/com/android/camera/panorama/MosaicFrameProcessor.java | 5 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/com/android/camera/panorama/Mosaic.java b/src/com/android/camera/panorama/Mosaic.java index b586aad..9ad2c64 100644 --- a/src/com/android/camera/panorama/Mosaic.java +++ b/src/com/android/camera/panorama/Mosaic.java @@ -68,6 +68,21 @@ public class Mosaic { public static final int BLENDTYPE_HORIZONTAL =3; /** + * This strip type will use the default thin strips where the strips are + * spaced according to the image capture rate. + */ + public static final int STRIPTYPE_THIN = 0; + + /** + * This strip type will use wider strips for blending. The strip separation + * is controlled by a threshold on the native side. Since the strips are + * wider, there is an additional cross-fade blending step to make the seam + * boundaries smoother. Since this mode uses lesser image frames, it is + * computationally more efficient than the thin strip mode. + */ + public static final int STRIPTYPE_WIDE = 1; + + /** * Return flags returned by createMosaic() are one of the following. */ public static final int MOSAIC_RET_OK = 1; @@ -128,6 +143,13 @@ public class Mosaic { public native void setBlendingType(int type); /** + * Set the type of strips to use for blending. + * @param type the blending strip type to use {STRIPTYPE_THIN, + * STRIPTYPE_WIDE}. + */ + public native void setStripType(int type); + + /** * Tell the native layer to create the final mosaic after all the input frame * data have been collected. * The case of generating high-resolution mosaic may take dozens of seconds to finish. diff --git a/src/com/android/camera/panorama/MosaicFrameProcessor.java b/src/com/android/camera/panorama/MosaicFrameProcessor.java index dde4a22..54fc7b8 100644 --- a/src/com/android/camera/panorama/MosaicFrameProcessor.java +++ b/src/com/android/camera/panorama/MosaicFrameProcessor.java @@ -84,6 +84,7 @@ public class MosaicFrameProcessor { public void initialize() { setupMosaicer(mPreviewWidth, mPreviewHeight, mPreviewBufferSize); + setStripType(Mosaic.STRIPTYPE_WIDE); reset(); } @@ -92,6 +93,10 @@ public class MosaicFrameProcessor { mMosaicer.freeMosaicMemory(); } + public void setStripType(int type) { + mMosaicer.setStripType(type); + } + private void setupMosaicer(int previewWidth, int previewHeight, int bufSize) { Log.v(TAG, "setupMosaicer w, h=" + previewWidth + ',' + previewHeight + ',' + bufSize); mMosaicer.allocateMosaicMemory(previewWidth, previewHeight); |