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

Method ReadAllFileNoRLE

IO/Image/vtkHDRReader.cxx:552–578  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

550
551//------------------------------------------------------------------------------
552bool vtkHDRReader::ReadAllFileNoRLE(
553 vtkResourceStream* stream, float* outPtr, int decrPtr, int* outExt)
554{
555 std::vector<unsigned char> lineBuffer(this->GetWidth() * 4);
556
557 int nbLinesLeft = outExt[3] - outExt[2] + 1;
558 while (nbLinesLeft > 0)
559 {
560 std::size_t size = sizeof(unsigned char) * lineBuffer.size();
561 if (stream->Read(lineBuffer.data(), size) != size)
562 {
563 vtkErrorMacro("Unable to read as expected");
564 return false;
565 }
566
567 // Convert lineBuffer to RGB floats
568 this->FillOutPtrNoRLE(outExt, outPtr, lineBuffer);
569
570 // Do nothing if we read top to bottom (decrPtr = 0)
571 // Else go to the beginning of the previous line
572 outPtr -= decrPtr;
573
574 nbLinesLeft--;
575 }
576
577 return true;
578}
579
580//------------------------------------------------------------------------------
581bool vtkHDRReader::ReadLineRLE(vtkResourceStream* stream, unsigned char* lineBufferPtr)

Callers 1

HDRReaderUpdateSliceMethod · 0.95

Calls 5

GetWidthMethod · 0.95
FillOutPtrNoRLEMethod · 0.95
sizeMethod · 0.45
ReadMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected