Changeset 2612 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 01/17/08 23:56:46 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2611 r2612 101 101 QtGlRendererBuffer::GetPixelError(int &pvsSize) 102 102 { 103 float pErrorPixels = -1.0f; 103 104 float pErrorPixels = -1.0f; 104 105 105 106 … … 135 136 Intersectable::NewMail(); 136 137 while (it.HasMoreEntries()) 137 {138 { 138 139 RenderIntersectable(it.Next()); 139 }140 } 140 141 141 142 … … 147 148 148 149 OcclusionQuery *query = mOcclusionQueries[0]; 149 150 150 151 151 query->BeginQuery(); 152 152 … … 157 157 query->EndQuery(); 158 158 glDisable(GL_STENCIL_TEST); 159 159 160 // reenable other state 160 161 // int wait=0; … … 162 163 // wait++; 163 164 // } 164 165 165 166 166 167 pixelCount = query->GetQueryResult(); … … 170 171 171 172 if (mSnapErrorFrames && pErrorPixels >= 0.01f) { 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 { 211 212 } 213 214 215 216 217 218 219 220 } 221 173 glReadBuffer(GL_BACK); 174 175 char filename[256]; 176 sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 177 QImage im = toImage(); 178 string str = mSnapPrefix + filename; 179 QString qstr(str.c_str()); 180 181 im.save(qstr, "PNG"); 182 if (1) { //0 && mFrame == 1543) { 183 int x,y; 184 int lastIndex = -1; 185 for (y=0; y < im.height(); y++) 186 for (x=0; x < im.width(); x++) { 187 QRgb p = im.pixel(x,y); 188 int index = qRed(p) + (qGreen(p)<<8) + (qBlue(p)<<16); 189 if (qGreen(p) != 255 && index!=0) { 190 if (index != lastIndex) { 191 // Debug<<"ei="<<index<<" "; 192 lastIndex = index; 193 } 194 } 195 } 196 } 197 198 199 mUseFalseColors = false; 200 glPushAttrib(GL_CURRENT_BIT); 201 glColor3f(0,1,0); 202 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 203 SetupCamera(); 204 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 205 206 // Render PVS 207 Intersectable::NewMail(); 208 209 ObjectPvsIterator it = pvs.GetIterator(); 210 for (; it.HasMoreEntries(); ) 211 { 212 RenderIntersectable(it.Next()); 213 } 214 215 im = toImage(); 216 sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels); 217 str = mSnapPrefix + filename; 218 qstr = str.c_str(); 219 im.save(qstr, "PNG"); 220 glPopAttrib(); 221 } 222 222 223 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 223 224 224 225 return pErrorPixels; 225 226 }
Note: See TracChangeset
for help on using the changeset viewer.