Changeset 1295 for trunk/packages/vizservers/nanovis/nanovis.cpp
- Timestamp:
- Mar 6, 2009, 9:27:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/nanovis.cpp
r1282 r1295 1243 1243 stats.nFrames++; 1244 1244 stats.nBytes += (bytesPerRow * win_height); 1245 } 1246 1247 void 1248 NanoVis::sendDataToClient(const char *command, const char *data, size_t dlen) 1249 { 1250 /* 1251 char header[200]; 1252 1253 // Generate the PPM binary file header 1254 sprintf(header, "P6 %d %d %d\n", win_width, win_height, PPM_MAXVAL); 1255 1256 size_t header_length = strlen(header); 1257 size_t data_length = win_width * win_height * 3; 1258 1259 char command[200]; 1260 sprintf(command, "%s %lu\n", prefix, 1261 (unsigned long)header_length + data_length); 1262 */ 1263 1264 // size_t wordsPerRow = (win_width * 24 + 31) / 32; 1265 // size_t bytesPerRow = wordsPerRow * 4; 1266 // size_t rowLength = win_width * 3; 1267 size_t nRecs = 2; 1268 1269 struct iovec *iov; 1270 iov = (struct iovec *)malloc(sizeof(struct iovec) * nRecs); 1271 1272 // Write the nanovisviewer command, then the image header and data. 1273 // Command 1274 // FIXME: shouldn't have to cast this 1275 iov[0].iov_base = (char *)command; 1276 iov[0].iov_len = strlen(command); 1277 // Data 1278 // FIXME: shouldn't have to cast this 1279 iov[1].iov_base = (char *)data; 1280 iov[1].iov_len = dlen; 1281 writev(0, iov, nRecs); 1282 free(iov); 1283 // stats.nFrames++; 1284 // stats.nBytes += (bytesPerRow * win_height); 1245 1285 } 1246 1286
Note: See TracChangeset
for help on using the changeset viewer.