MCPcopy Create free account
hub / github.com/Kitware/VTK / MemoryWrite

Method MemoryWrite

IO/Image/vtkBMPWriter.cxx:177–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void 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//------------------------------------------------------------------------------
197void vtkBMPWriter::PrintSelf(ostream& os, vtkIndent indent)

Callers 1

RequestDataMethod · 0.80

Calls 9

WriteFileHeaderMethod · 0.95
DeleteMethod · 0.65
NewFunction · 0.50
SetNumberOfComponentsMethod · 0.45
lengthMethod · 0.45
strMethod · 0.45
SetNumberOfTuplesMethod · 0.45
GetPointerMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected