Toast Engine
Loading...
Searching...
No Matches
hdr_image.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
11#include <cstdint>
12#include <span>
13#include <string_view>
14#include <vector>
15
16namespace assets {
17
25struct HdrImage {
26 uint32_t width = 0;
27 uint32_t height = 0;
29 std::vector<float> pixels;
30
31 [[nodiscard]]
32 auto valid() const noexcept -> bool {
33 return width > 0 && height > 0 && pixels.size() == static_cast<size_t>(width) * height * 4;
34 }
35};
36
48[[nodiscard]]
49auto decodeHdr(std::span<const uint8_t> bytes) -> HdrImage;
50
51}
A decoded floating-point image, always four channels.
Definition hdr_image.hpp:25
std::vector< float > pixels
Row-major, width * height * 4 floats, linear radiance rather than display values.
Definition hdr_image.hpp:29