summaryrefslogtreecommitdiffstats
path: root/jni/mosaic_renderer_jni.h
diff options
context:
space:
mode:
authorSascha Haeberling <haeberling@google.com>2013-08-14 11:20:34 -0700
committerSascha Haeberling <haeberling@google.com>2013-08-14 11:20:34 -0700
commit8bddf8ce4f3dcbb56edb12cee7e93f3a9daa3f96 (patch)
tree3382b4b8b52be577c3d0525df0e7da8178673d1c /jni/mosaic_renderer_jni.h
parenta34e8c7d439d17355df51e5e536bdbbd1744cc74 (diff)
downloadandroid_packages_apps_Snap-8bddf8ce4f3dcbb56edb12cee7e93f3a9daa3f96.tar.gz
android_packages_apps_Snap-8bddf8ce4f3dcbb56edb12cee7e93f3a9daa3f96.tar.bz2
android_packages_apps_Snap-8bddf8ce4f3dcbb56edb12cee7e93f3a9daa3f96.zip
Copy over libjni_mosaic from Camera. We need to support the SRI pano
mode for Carlsbad. Change-Id: Id14e64d8248236e8170c12cfca2cbf2ca952e993
Diffstat (limited to 'jni/mosaic_renderer_jni.h')
-rw-r--r--jni/mosaic_renderer_jni.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/jni/mosaic_renderer_jni.h b/jni/mosaic_renderer_jni.h
new file mode 100644
index 000000000..7a1b8782b
--- /dev/null
+++ b/jni/mosaic_renderer_jni.h
@@ -0,0 +1,35 @@
+#pragma once
+#include <semaphore.h>
+
+// The Preview FBO dimensions are determined from the high-res
+// frame dimensions (gPreviewImageWidth, gPreviewImageHeight)
+// using the scale factors below.
+const int PREVIEW_FBO_WIDTH_SCALE = 2;
+const int PREVIEW_FBO_HEIGHT_SCALE = 2;
+
+// The factor below determines the (horizontal) speed at which the viewfinder
+// will pan across the UI during capture. A value of 0.0 will keep the viewfinder
+// static in the center of the screen and 1.0f will make it pan at the
+// same speed as the device.
+const float VIEWFINDER_PAN_FACTOR_HORZ = 0.0f;
+
+// What fraction of the screen viewport width has been allocated to show the
+// arrows on the direction of motion side.
+const float VIEWPORT_BORDER_FACTOR_HORZ = 0.1f;
+
+const int LR = 0; // Low-resolution mode
+const int HR = 1; // High-resolution mode
+const int NR = 2; // Number of resolution modes
+
+const int H2L_FACTOR = 4; // Can be 2
+
+extern "C" void AllocateTextureMemory(int widthHR, int heightHR,
+ int widthLR, int heightLR);
+extern "C" void FreeTextureMemory();
+extern "C" void UpdateWarpTransformation(float *trs);
+
+extern unsigned char* gPreviewImage[NR];
+extern int gPreviewImageWidth[NR];
+extern int gPreviewImageHeight[NR];
+
+extern sem_t gPreviewImage_semaphore;