blob: cd405f9ae43b8708e66a5ca16c5e83aa423ce009 [file] [log] [blame]
mbansaleeb94d42011-08-02 11:31:28 -04001#pragma once
2#include <GLES2/gl2.h>
3#include <GLES2/gl2ext.h>
4#include <semaphore.h>
5
6// The Preview FBO dimensions are determined from the low-res
mbansal1e762b12011-08-16 10:01:20 -04007// frame dimensions (gPreviewImageWidth, gPreviewImageHeight)
mbansaleeb94d42011-08-02 11:31:28 -04008// using the scale factors below.
mbansala6f0b9e2011-08-19 10:18:54 -04009const int PREVIEW_FBO_WIDTH_SCALE = 4;
mbansaleeb94d42011-08-02 11:31:28 -040010const int PREVIEW_FBO_HEIGHT_SCALE = 2;
11
mbansal1e762b12011-08-16 10:01:20 -040012// The factor below determines the (horizontal) speed at which the viewfinder
13// will pan across the UI during capture. A value of 0.0 will keep the viewfinder
14// static in the center of the screen and 1.0f will make it pan at the
15// same speed as the device.
mbansala6f0b9e2011-08-19 10:18:54 -040016const float VIEWFINDER_PAN_FACTOR_HORZ = 0.3f;
17
18// What fraction of the screen viewport width has been allocated to show the
19// arrows on the direction of motion side.
20const float VIEWPORT_BORDER_FACTOR_HORZ = 0.1f;
mbansal1e762b12011-08-16 10:01:20 -040021
mbansal41a2e972011-08-08 20:23:02 -040022const int LR = 0; // Low-resolution mode
23const int HR = 1; // High-resolution mode
24const int NR = 2; // Number of resolution modes
25
26extern "C" void AllocateTextureMemory(int widthHR, int heightHR,
27 int widthLR, int heightLR);
mbansaleeb94d42011-08-02 11:31:28 -040028extern "C" void FreeTextureMemory();
29extern "C" void UpdateWarpTransformation(float *trs);
30
mbansal1e762b12011-08-16 10:01:20 -040031extern unsigned char* gPreviewImage[NR];
32extern int gPreviewImageWidth[NR];
33extern int gPreviewImageHeight[NR];
mbansaleeb94d42011-08-02 11:31:28 -040034
mbansal1e762b12011-08-16 10:01:20 -040035extern sem_t gPreviewImage_semaphore;