Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
ExrLoader.h
Go to the documentation of this file.
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 {
29 ExrHeader() = default;
30
36 explicit ExrHeader(EXRHeader header);
37
38 std::string name;
39 int num_channels = 0;
41 std::vector<ExrChannelInfo> channels;
42
43 bool valid = false;
44 };
45
54 class ExrLoader {
55 public:
56 ExrLoader() = default;
57
58 ~ExrLoader() = default;
59
74 tinygltf::Image load(const std::filesystem::path &filename);
75
89 [[nodiscard]] ExrHeader loadHeader(std::filesystem::path path);
90 };
91}
ExrHeader loadHeader(std::filesystem::path path)
Load only the header information from an EXR file.
tinygltf::Image load(const std::filesystem::path &filename)
Load a complete EXR image file.
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:39
bool valid
Whether header was successfully loaded.
Definition ExrLoader.h:43
std::string name
Image name/identifier.
Definition ExrLoader.h:38
int compression_type
Compression type used.
Definition ExrLoader.h:40
ExrHeader(EXRHeader header)
Construct from native EXRHeader, performing deep copy.
std::vector< ExrChannelInfo > channels
Channel information for each channel.
Definition ExrLoader.h:41