//! Création de la grille void CalibrationUtils::setGrid(int x, int y) { //Nombre de points de calibration sur chaque cercle de calibration - 1 GRID_X = x; //Nombre de cercle de calibration - 1 GRID_Y = y; //Nombre de points de calibration GRID_POINTS = GRID_X+1; for (int i=2; i<= GRID_Y+1; i++) GRID_POINTS += i*GRID_X; //printf("\nX : %d\nY : %d\n",x,y); //printf("GRID_POINTS : %d\n",GRID_POINTS); //Initialisation des listes de points, et des zones de calibration screenPoints = new calibrationPoint[GRID_POINTS]; cameraPoints = new calibrationPoint[GRID_POINTS]; triangles = new std::vector<triangle*>(); //Si les deux listes de points sont crées if(bscreenPoints && bcameraPoints) { //Initialisation des points à afficher initScreenPoints(); //Initialisation des points à lire initCameraPoints(_camWidth, _camHeight); //Initialisation des triangles initTriangles(); } }
void CalibrationUtils::setScreenScale(float s) { // legacy float offset = (1.0f - s)*0.5f; screenBB = rect2df(vector2df(offset,offset),vector2df(1.0f-offset,1.0f-offset)); initScreenPoints(); }
void CalibrationUtils::setGrid(int x, int y) { GRID_Y = y; GRID_X = x; GRID_POINTS = ((GRID_X+1) * (GRID_Y+1)); GRID_INDICES = (GRID_X * GRID_Y * 3 * 2); screenPoints = new vector2df[GRID_POINTS]; cameraPoints = new vector2df[GRID_POINTS]; triangles = new int[GRID_INDICES]; initTriangles(); if(bscreenPoints && bcameraPoints){ initScreenPoints(); initCameraPoints(_camWidth, _camHeight); } }
//! Taille de la zone d'affichage void CalibrationUtils::setScreenBBox(rect2df &box) { screenBB = box; initScreenPoints(); }
//Bounding Box Size void calibrationB::setScreenBBox(rect2df &box) { screenBB = box; initScreenPoints(); }