| 10065 | } |
| 10066 | |
| 10067 | inline std::vector<uint8_t> getLutData( |
| 10068 | const char * filepath) const override |
| 10069 | { |
| 10070 | std::vector<std::string> paths = { |
| 10071 | std::string(OCIO::GetTestFilesDir()), |
| 10072 | std::string("configs"), |
| 10073 | std::string("context_test1"), |
| 10074 | std::string(filepath), |
| 10075 | }; |
| 10076 | const std::string lutPath = pystring::os::path::normpath( |
| 10077 | pystring::os::path::join(paths) |
| 10078 | ); |
| 10079 | |
| 10080 | std::ifstream fstream( |
| 10081 | OCIO::Platform::filenameToUTF(lutPath).c_str(), |
| 10082 | std::ios_base::in | std::ios_base::binary | std::ios::ate |
| 10083 | ); |
| 10084 | if (fstream.fail()) |
| 10085 | { |
| 10086 | std::ostringstream os; |
| 10087 | os << "Error could not read LUT file : " << lutPath; |
| 10088 | throw OCIO::Exception (os.str().c_str()); |
| 10089 | } |
| 10090 | |
| 10091 | const auto eofPosition = static_cast<std::streamoff>(fstream.tellg()); |
| 10092 | std::vector<uint8_t> buffer; |
| 10093 | buffer.resize(eofPosition); |
| 10094 | fstream.seekg(0, std::ios::beg); |
| 10095 | fstream.read(reinterpret_cast<char*>(buffer.data()), eofPosition); |
| 10096 | |
| 10097 | return buffer; |
| 10098 | } |
| 10099 | |
| 10100 | inline std::string getFastLutFileHash(const char * filename) const override |
| 10101 | { |