Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
TextureLoadData.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5namespace EngineCore {
7 TextureLoadData(std::vector<unsigned char> imageData, int width, int height, int channels) :
8 imageData(std::move(imageData)),
12 {
13
14 }
15
16 int width;
17 int height;
19 std::vector<unsigned char> imageData;
20
21 bool operator==(const TextureLoadData& other) const {
22 return width == other.width &&
23 height == other.height &&
24 channels == other.channels &&
25 imageData == other.imageData;
26 }
27 };
28}
29
30namespace std {
31
32 template <>
33 struct hash<EngineCore::TextureLoadData> {
34 std::size_t operator()(const EngineCore::TextureLoadData& tex) const {
35 std::size_t seed = 0;
36
37 // Hash the integral members
38 seed ^= std::hash<int>()(tex.width) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
39 seed ^= std::hash<int>()(tex.height) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
40 seed ^= std::hash<int>()(tex.channels) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
41
42 // Hash the imageData vector
43 for (const auto& byte : tex.imageData) {
44 seed ^= std::hash<unsigned char>()(byte) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
45 }
46
47 return seed;
48 }
49 };
50
51} // namespace std
Log category system implementation.
STL namespace.
TextureLoadData(std::vector< unsigned char > imageData, int width, int height, int channels)
bool operator==(const TextureLoadData &other) const
std::vector< unsigned char > imageData
std::size_t operator()(const EngineCore::TextureLoadData &tex) const