mbansal | eeb94d4 | 2011-08-02 11:31:28 -0400 | [diff] [blame] | 1 | #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 |
mbansal | 1e762b1 | 2011-08-16 10:01:20 -0400 | [diff] [blame] | 7 | // frame dimensions (gPreviewImageWidth, gPreviewImageHeight) |
mbansal | eeb94d4 | 2011-08-02 11:31:28 -0400 | [diff] [blame] | 8 | // using the scale factors below. |
mbansal | a6f0b9e | 2011-08-19 10:18:54 -0400 | [diff] [blame] | 9 | const int PREVIEW_FBO_WIDTH_SCALE = 4; |
mbansal | eeb94d4 | 2011-08-02 11:31:28 -0400 | [diff] [blame] | 10 | const int PREVIEW_FBO_HEIGHT_SCALE = 2; |
| 11 | |
mbansal | 1e762b1 | 2011-08-16 10:01:20 -0400 | [diff] [blame] | 12 | // 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. |
mbansal | a6f0b9e | 2011-08-19 10:18:54 -0400 | [diff] [blame] | 16 | const 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. |
| 20 | const float VIEWPORT_BORDER_FACTOR_HORZ = 0.1f; |
mbansal | 1e762b1 | 2011-08-16 10:01:20 -0400 | [diff] [blame] | 21 | |
mbansal | 41a2e97 | 2011-08-08 20:23:02 -0400 | [diff] [blame] | 22 | const int LR = 0; // Low-resolution mode |
| 23 | const int HR = 1; // High-resolution mode |
| 24 | const int NR = 2; // Number of resolution modes |
| 25 | |
| 26 | extern "C" void AllocateTextureMemory(int widthHR, int heightHR, |
| 27 | int widthLR, int heightLR); |
mbansal | eeb94d4 | 2011-08-02 11:31:28 -0400 | [diff] [blame] | 28 | extern "C" void FreeTextureMemory(); |
| 29 | extern "C" void UpdateWarpTransformation(float *trs); |
| 30 | |
mbansal | 1e762b1 | 2011-08-16 10:01:20 -0400 | [diff] [blame] | 31 | extern unsigned char* gPreviewImage[NR]; |
| 32 | extern int gPreviewImageWidth[NR]; |
| 33 | extern int gPreviewImageHeight[NR]; |
mbansal | eeb94d4 | 2011-08-02 11:31:28 -0400 | [diff] [blame] | 34 | |
mbansal | 1e762b1 | 2011-08-16 10:01:20 -0400 | [diff] [blame] | 35 | extern sem_t gPreviewImage_semaphore; |