- Timestamp:
- 08/09/11 16:09:33 (13 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/BasicGlCamera.cc
r11804 r11861 89 89 l++; 90 90 } 91 buildPatchesIndices();92 91 93 92 for (int i=0;i<1440;i++) 94 93 updateNeighbors(i); 95 94 95 buildPatchesIndices(); 96 96 97 ss[0] = 0; ss[1] = 0.25f; ss[2] = 0.5f; ss[3] = 0.75f; ss[4] = 1.0f; 97 rr[0] = 0.15; rr[1] = 98 rr[0] = 0.15; rr[1] = 0; rr[2] = 0; rr[3] = 1.0f; rr[4] = 0.85f; 98 99 gg[0] = 0.15; gg[1] = 0; gg[2] = 1; gg[3] = 0; gg[4] = 0.85f; 99 bb[0] = 0.15; bb[1] = 1; bb[2] = 100 bb[0] = 0.15; bb[1] = 1; bb[2] = 0; bb[3] = 0; bb[4] = 0.85f; 100 101 101 102 fPixelStride = 1; … … 103 104 fData.resize(1440); 104 105 for (int i=0;i<ACTUAL_NUM_PIXELS;i++) 105 fData[i] = (double)i /1.44;//(double)(i)/(double)(ACTUAL_NUM_PIXELS);106 fData[i] = (double)i;///1.44;//(double)(i)/(double)(ACTUAL_NUM_PIXELS); 106 107 } 107 108 BasicGlCamera::~BasicGlCamera() … … 172 173 for (int i=0;i<ACTUAL_NUM_PIXELS;i++) 173 174 { 174 175 175 color = float(fData[i*fPixelStride+fcSlice]);// + ]eventData[nRoi*i + whichSlice]+(VALUES_SPAN/2))/(float)(VALUES_SPAN-1); 176 176 int index = 0; … … 209 209 void BasicGlCamera::drawPatches() 210 210 { 211 // cout << "*************************DRAWING PATCHES**************************" << endl; 212 // for (int i=0;i<NTMARK;i++) 213 // { 214 // cout << ".....................patch " << i << endl; 215 // for (unsigned int j=0;patchesIndices[i].size();j++) 216 // { 217 // cout << patchesIndices[i][j].first << " and " << patchesIndices[i][j].second << endl; 218 // } 219 // } 211 220 glLineWidth(2.0f); 212 221 float backupRadius = hexRadius; … … 426 435 numVertices = 0; 427 436 GLfloat cVertex[2]; 428 for (int i=0;i< ACTUAL_NUM_PIXELS;i++)437 for (int i=0;i<NPIX;i++) 429 438 { 430 439 for (int j=0;j<6;j++) … … 452 461 } 453 462 } 454 for (int i=0;i< ACTUAL_NUM_PIXELS;i++)463 for (int i=0;i<NPIX;i++) 455 464 { 456 465 for (int j=0;j<6;j++) … … 476 485 vector<edge>::iterator it; 477 486 bool erased = false; 487 // patchesIndices.resize(NTMARK); 478 488 for (int i=0;i<NTMARK;i++)//for all patches 479 489 { … … 510 520 } 511 521 } 512 } 513 522 // for (int i=0;i<NTMARK;i++) 523 // { 524 // cout << ".....................patch " << i << " size: " << patchesIndices[i].size() << endl; 525 // for (unsigned int j=0;j<patchesIndices[i].size();j++) 526 // { 527 // if (patchesIndices[i][j].first < 0 || patchesIndices[i][j].first > 3013) 528 // cout << patchesIndices[i][j].first << " and " << patchesIndices[i][j].second << " and " << j << endl; 529 // } 530 // } 531 } 532 -
trunk/FACT++/gui/BasicGlCamera.h
r11779 r11861 64 64 float bb[5];// = {0.15, 1.00, 0.00, 0.00, 0.85}; 65 65 // bool recalcColorPlease; 66 GLfloat pixelsColor[ACTUAL_NUM_PIXELS][3]; 66 GLfloat pixelsColor[NPIX][3]; 67 GLfloat verticesList[NPIX*6][2]; 68 vector<edge> patchesIndices[160]; 69 int verticesIndices[NPIX][6]; 67 70 private: 68 71 void updateNeighbors(int currentPixel); … … 80 83 PixelsNeighbors neighbors[MAX_NUM_PIXELS]; 81 84 82 GLfloat verticesList[ACTUAL_NUM_PIXELS*6][2];83 85 84 int hardwareMapping[ 1440];85 int softwareMapping[ 1440];86 int hardwareMapping[NPIX]; 87 int softwareMapping[NPIX]; 86 88 int patches[160][9]; 87 vector<edge> patchesIndices[160];88 int verticesIndices[ACTUAL_NUM_PIXELS][6];89 89 int numVertices; 90 90 -
trunk/FACT++/gui/QCameraWidget.cc
r11799 r11861 133 133 double dmin = fData[0]; 134 134 double dmax = fData[0]; 135 if (fMin < 0 && fMax < 0) 135 136 for (int i=0;i<1440;i++) 136 137 { … … 144 145 for (int i=0;i<ACTUAL_NUM_PIXELS;i++) 145 146 { 147 if (fData[i] < dmin) 148 { 149 pixelsColor[i][0] = pixelsColor[i][1] = pixelsColor[i][2] = 0; 150 continue; 151 } 152 if (fData[i] > dmax) 153 { 154 pixelsColor[i][0] = pixelsColor[i][1] = pixelsColor[i][2] = 1; 155 continue; 156 } 146 157 color = float((fData[i]-dmin)/(dmax-dmin)); 147 158 if (!fEnable[i]) 148 159 color = 0; 149 160 int index = 0; 150 while (ss[index] < color )161 while (ss[index] < color && index < 4) 151 162 index++; 152 163 index--; 153 164 if (index < 0) index = 0; 154 if (index > 3) index = 3;165 // if (index > 3) index = 3; 155 166 float weight0 = (color-ss[index]) / (ss[index+1]-ss[index]); 156 167 if (weight0 > 1.0f) weight0 = 1.0f;
Note:
See TracChangeset
for help on using the changeset viewer.