Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
ExrLoader.h
1#pragma once
2#include <tiny_gltf.h>
3#include "tinyexr.h"
4#include <vector>
5#include <filesystem>
6#include <string>
7
13 std::string name;
17 unsigned char p_linear;
18 };
19
28 struct ExrHeader {
32 ExrHeader() = default;
33
39 explicit ExrHeader(EXRHeader header);
40
41 std::string name;
42 int num_channels = 0;
44 std::vector<ExrChannelInfo> channels;
45
46 bool valid = false;
47 };
48
57 class ExrLoader {
58 public:
62 ExrLoader() = default;
63
67 ~ExrLoader() = default;
68
83 tinygltf::Image load(const std::filesystem::path &filename);
84
98 [[nodiscard]] ExrHeader loadHeader(std::filesystem::path path);
99 };
100}
ExrHeader loadHeader(std::filesystem::path path)
Load only the header information from an EXR file.
~ExrLoader()=default
Destroys the EXR loader.
tinygltf::Image load(const std::filesystem::path &filename)
Load a complete EXR image file.
ExrLoader()=default
Creates an EXR loader with no persistent state.
Represents channel information from an EXR file header.
Definition ExrLoader.h:12
int y_sampling
Sampling rate in Y direction.
Definition ExrLoader.h:16
std::string name
Channel name (e.g., "R", "G", "B", "A")
Definition ExrLoader.h:13
int x_sampling
Sampling rate in X direction.
Definition ExrLoader.h:15
unsigned char p_linear
Whether channel is perceptually linear.
Definition ExrLoader.h:17
int pixel_type
Pixel type (TINYEXR_PIXELTYPE_HALF, FLOAT, etc.)
Definition ExrLoader.h:14
Wrapper for EXR file header information with owned data.
Definition ExrLoader.h:28
int num_channels
Number of color channels.
Definition ExrLoader.h:42
bool valid
Whether header was successfully loaded.
Definition ExrLoader.h:46
std::string name
Image name/identifier.
Definition ExrLoader.h:41
int compression_type
Compression type used.
Definition ExrLoader.h:43
ExrHeader(EXRHeader header)
Construct from native EXRHeader, performing deep copy.
ExrHeader()=default
Creates an invalid, empty EXR header record.
std::vector< ExrChannelInfo > channels
Channel information for each channel.
Definition ExrLoader.h:44