MCPcopy Create free account
hub / github.com/IENT/YUView / loadTgaFromFile

Method loadTgaFromFile

YUViewLib/src/decoder/decoderTarga.cpp:609–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607} // namespace
608
609std::optional<dec::Targa::Image> dec::Targa::loadTgaFromFile(std::string filename)
610{
611 std::ifstream tgaFile(filename, std::ios::binary);
612
613 auto header = readHeader(tgaFile);
614 if (!header)
615 return {};
616
617 try
618 {
619 auto image = readImage(tgaFile, *header);
620 postProcessImage(image, *header);
621 return image;
622 }
623 catch (const std::exception &e)
624 {
625 std::cerr << e.what() << '\n';
626 }
627
628 return {};
629}

Callers

nothing calls this directly

Calls 3

readHeaderFunction · 0.85
readImageFunction · 0.85
postProcessImageFunction · 0.85

Tested by

no test coverage detected