Toast Engine
Toggle main menu visibility
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
16
namespace
assets {
17
25
struct
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]]
49
auto
decodeHdr(std::span<const uint8_t> bytes) -> HdrImage;
50
51
}
assets::HdrImage
A decoded floating-point image, always four channels.
Definition
hdr_image.hpp:25
assets::HdrImage::pixels
std::vector< float > pixels
Row-major, width * height * 4 floats, linear radiance rather than display values.
Definition
hdr_image.hpp:29
engine
src
toast
assets
hdr_image.hpp
Generated by
1.17.0