| 217 | } |
| 218 | |
| 219 | BlueStdResult Tr2LightProfileRes::BakeLightProfile( const wchar_t* path, Tr2HostBitmapPtr& output ) |
| 220 | { |
| 221 | output = nullptr; |
| 222 | |
| 223 | if( !IsIesExtension( path ) ) |
| 224 | { |
| 225 | return BlueStdResult( BLUE_STD_RESULT_VALUE_ERROR, "This function expects an .ies path" ); |
| 226 | } |
| 227 | |
| 228 | IBlueStreamPtr stream; |
| 229 | auto success = BePaths->GetFileContentsWithYield( path, &stream ); |
| 230 | if( !BeIsSuccess( success ) ) |
| 231 | { |
| 232 | return BlueStdResult( BLUE_STD_RESULT_IO_ERROR, success.value.c_str() ); |
| 233 | } |
| 234 | |
| 235 | output.CreateInstance(); |
| 236 | |
| 237 | std::string contents; |
| 238 | contents.resize( stream->GetSize() ); |
| 239 | stream->Read( contents.data(), contents.size() ); |
| 240 | |
| 241 | if( !ParseIes( contents, *output ) ) |
| 242 | { |
| 243 | output = nullptr; |
| 244 | return BlueStdResult( BLUE_STD_RESULT_RUNTIME_ERROR, "Failed to parse IES file" ); |
| 245 | } |
| 246 | return BlueStdResult( BLUE_STD_RESULT_OK ); |
| 247 | } |
| 248 | |
| 249 | BlueStdResult Tr2LightProfileRes::GetThumbnail( uint32_t width, uint32_t height, Tr2HostBitmapPtr& bitmap ) const |
| 250 | { |
nothing calls this directly
no test coverage detected