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

Method ExecuteDataWithInformation

IO/Image/vtkPNGReader.cxx:604–631  ·  view source on GitHub ↗

------------------------------------------------------------------------------ This function reads a data from a file. The datas extent/axes are assumed to be the same as the file extent/order.

Source from the content-addressed store, hash-verified

602// This function reads a data from a file. The datas extent/axes
603// are assumed to be the same as the file extent/order.
604void vtkPNGReader::ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo)
605{
606 vtkImageData* data = this->AllocateOutputData(output, outInfo);
607
608 if (!this->GetStream() && !this->GetMemoryBuffer() && this->InternalFileName == nullptr)
609 {
610 vtkErrorMacro(<< "Either a Stream, FileName, FilePrefix or MemoryBuffer must be specified.");
611 this->SetErrorCode(vtkErrorCode::NoFileNameError);
612 return;
613 }
614
615 data->GetPointData()->GetScalars()->SetName("PNGImage");
616
617 this->ComputeDataIncrements();
618
619 // Call the correct templated function for the output
620 void* outPtr;
621
622 // Call the correct templated function for the input
623 outPtr = data->GetScalarPointer();
624 switch (data->GetScalarType())
625 {
626 vtkTemplateMacro(this->vtkPNGReaderUpdate(data, (VTK_TT*)(outPtr)));
627 default:
628 vtkErrorMacro(<< "UpdateFromFile: Unknown data type");
629 this->SetErrorCode(vtkErrorCode::UnrecognizedFileTypeError);
630 }
631}
632
633//------------------------------------------------------------------------------
634int vtkPNGReader::CanReadFile(const char* fname)

Callers

nothing calls this directly

Calls 10

vtkPNGReaderUpdateMethod · 0.95
GetMemoryBufferMethod · 0.80
GetScalarPointerMethod · 0.80
AllocateOutputDataMethod · 0.45
GetStreamMethod · 0.45
SetNameMethod · 0.45
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45
ComputeDataIncrementsMethod · 0.45
GetScalarTypeMethod · 0.45

Tested by

no test coverage detected