------------------------------------------------------------------------------
| 550 | |
| 551 | //------------------------------------------------------------------------------ |
| 552 | bool 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 | //------------------------------------------------------------------------------ |
| 581 | bool vtkHDRReader::ReadLineRLE(vtkResourceStream* stream, unsigned char* lineBufferPtr) |
no test coverage detected