| 30 | } |
| 31 | |
| 32 | void vtkBMPWriter::WriteFileHeader(ostream* file, vtkImageData*, int wExt[6]) |
| 33 | { |
| 34 | long temp; |
| 35 | int width, height, dataWidth; |
| 36 | int row; |
| 37 | |
| 38 | // Find the length of the rows to write. |
| 39 | width = (wExt[1] - wExt[0] + 1); |
| 40 | height = (wExt[3] - wExt[2] + 1); |
| 41 | |
| 42 | dataWidth = ((width * 3 + 3) / 4) * 4; |
| 43 | |
| 44 | // spit out the BMP header |
| 45 | file->put((char)66); |
| 46 | file->put((char)77); |
| 47 | temp = (long)(dataWidth * height) + 54L; |
| 48 | file->put((char)(temp % 256)); |
| 49 | file->put((char)((temp % 65536L) / 256)); |
| 50 | file->put((char)(temp / 65536L)); |
| 51 | for (row = 0; row < 5; row++) |
| 52 | { |
| 53 | file->put((char)0); |
| 54 | } |
| 55 | file->put((char)54); |
| 56 | file->put((char)0); |
| 57 | file->put((char)0); |
| 58 | file->put((char)0); |
| 59 | |
| 60 | // info header |
| 61 | file->put((char)40); |
| 62 | file->put((char)0); |
| 63 | file->put((char)0); |
| 64 | file->put((char)0); |
| 65 | |
| 66 | file->put((char)(width % 256)); |
| 67 | file->put((char)(width / 256)); |
| 68 | file->put((char)0); |
| 69 | file->put((char)0); |
| 70 | |
| 71 | file->put((char)(height % 256)); |
| 72 | file->put((char)(height / 256)); |
| 73 | file->put((char)0); |
| 74 | file->put((char)0); |
| 75 | |
| 76 | file->put((char)1); |
| 77 | file->put((char)0); |
| 78 | file->put((char)24); |
| 79 | for (row = 0; row < 25; row++) |
| 80 | { |
| 81 | file->put((char)0); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | void vtkBMPWriter::WriteFile(ostream* file, vtkImageData* data, int extent[6], int wExtent[6]) |
| 86 | { |
no test coverage detected