| 175 | } |
| 176 | |
| 177 | void vtkBMPWriter::MemoryWrite(int dim, vtkImageData* input, int wExt[6], vtkInformation* inInfo) |
| 178 | { |
| 179 | std::ostringstream* oss; |
| 180 | oss = new std::ostringstream(); |
| 181 | |
| 182 | this->WriteFileHeader(oss, input, wExt); |
| 183 | this->RecursiveWrite(dim, input, inInfo, oss); |
| 184 | |
| 185 | vtkUnsignedCharArray* r = vtkUnsignedCharArray::New(); |
| 186 | r->SetNumberOfComponents(1); |
| 187 | size_t alen = oss->str().length(); |
| 188 | r->SetNumberOfTuples(static_cast<vtkIdType>(alen)); |
| 189 | unsigned char* buff = r->GetPointer(0); |
| 190 | memcpy(buff, oss->str().data(), alen); |
| 191 | this->SetResult(r); |
| 192 | r->Delete(); |
| 193 | delete oss; |
| 194 | } |
| 195 | |
| 196 | //------------------------------------------------------------------------------ |
| 197 | void vtkBMPWriter::PrintSelf(ostream& os, vtkIndent indent) |
no test coverage detected