1eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansal#pragma once
2eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansal#include <semaphore.h>
3eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansal
447f3bff0df080af493ddae1857b82370b592e2f7Wei-Ta Chen// The Preview FBO dimensions are determined from the high-res
51e762b1f935c9d4a06af6dd56121590ca81d48b1mbansal// frame dimensions (gPreviewImageWidth, gPreviewImageHeight)
6eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansal// using the scale factors below.
747f3bff0df080af493ddae1857b82370b592e2f7Wei-Ta Chenconst int PREVIEW_FBO_WIDTH_SCALE = 2;
847f3bff0df080af493ddae1857b82370b592e2f7Wei-Ta Chenconst int PREVIEW_FBO_HEIGHT_SCALE = 1;
9eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansal
101e762b1f935c9d4a06af6dd56121590ca81d48b1mbansal// The factor below determines the (horizontal) speed at which the viewfinder
111e762b1f935c9d4a06af6dd56121590ca81d48b1mbansal// will pan across the UI during capture. A value of 0.0 will keep the viewfinder
121e762b1f935c9d4a06af6dd56121590ca81d48b1mbansal// static in the center of the screen and 1.0f will make it pan at the
131e762b1f935c9d4a06af6dd56121590ca81d48b1mbansal// same speed as the device.
14a6f0b9e759fa2d19d493bde7ffa8105ec2978b94mbansalconst float VIEWFINDER_PAN_FACTOR_HORZ = 0.3f;
15a6f0b9e759fa2d19d493bde7ffa8105ec2978b94mbansal
16a6f0b9e759fa2d19d493bde7ffa8105ec2978b94mbansal// What fraction of the screen viewport width has been allocated to show the
17a6f0b9e759fa2d19d493bde7ffa8105ec2978b94mbansal// arrows on the direction of motion side.
18a6f0b9e759fa2d19d493bde7ffa8105ec2978b94mbansalconst float VIEWPORT_BORDER_FACTOR_HORZ = 0.1f;
191e762b1f935c9d4a06af6dd56121590ca81d48b1mbansal
2041a2e9735136f372de95652d0828600282c8e967mbansalconst int LR = 0; // Low-resolution mode
2141a2e9735136f372de95652d0828600282c8e967mbansalconst int HR = 1; // High-resolution mode
2241a2e9735136f372de95652d0828600282c8e967mbansalconst int NR = 2; // Number of resolution modes
2341a2e9735136f372de95652d0828600282c8e967mbansal
2447f3bff0df080af493ddae1857b82370b592e2f7Wei-Ta Chenconst int H2L_FACTOR = 4; // Can be 2
2547f3bff0df080af493ddae1857b82370b592e2f7Wei-Ta Chen
2641a2e9735136f372de95652d0828600282c8e967mbansalextern "C" void AllocateTextureMemory(int widthHR, int heightHR,
2741a2e9735136f372de95652d0828600282c8e967mbansal        int widthLR, int heightLR);
28eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansalextern "C" void FreeTextureMemory();
29eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansalextern "C" void UpdateWarpTransformation(float *trs);
30eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansal
311e762b1f935c9d4a06af6dd56121590ca81d48b1mbansalextern unsigned char* gPreviewImage[NR];
321e762b1f935c9d4a06af6dd56121590ca81d48b1mbansalextern int gPreviewImageWidth[NR];
331e762b1f935c9d4a06af6dd56121590ca81d48b1mbansalextern int gPreviewImageHeight[NR];
34eeb94d4de94bfd4e01f3a716803f77a530f5b92cmbansal
351e762b1f935c9d4a06af6dd56121590ca81d48b1mbansalextern sem_t gPreviewImage_semaphore;
36