Nameless Engine
Loading...
Searching...
No Matches
TextureImporter.h
1#pragma once
2
3// Standard.
4#include <optional>
5#include <filesystem>
6
7// Custom.
8#include "misc/Error.h"
9
10namespace ne {
11 enum class TextureImportFormat {
12 R, //< BC4 compression, only one 8 bit channel, can be used for heightmaps for example.
13 RG, //< BC5 compression, 8 bits for R and 8 bits for G channel, can be used for normal maps.
14 RGB, //< BC1 compression, bits per channel: 5 for R, 6 for G, 5 for B.
15 RGB_1BIT_A, //< BC1 compression, bits per channel: 5 for R, 6 for G, 5 for B and 0 or 1 bit for alpha.
16 RGB_8BIT_A, //< BC3 compression, bits per channel: 5 for R, 6 for G, 5 for B and 8 bit for alpha.
17 HDR, //< BC6H compression, used for HDR textures.
18 RGB_HIGH_QUALITY, //< BC7 compression, high quality of the compressed image but bigger file size and
19 // longer import.
20 RGBA_HIGH_QUALITY, //< BC7 compression, high quality of the compressed image but bigger file size and
21 // longer import.
22 };
23
29 public:
30 TextureImporter() = delete;
31
37 static constexpr const char* getImportedFileName() { return pImportedFileName; }
38
53 [[nodiscard]] static std::optional<Error> importTexture(
54 const std::filesystem::path& pathToTexture,
55 TextureImportFormat textureImportFormat,
56 const std::string& sPathToOutputDirRelativeRes,
57 const std::string& sOutputDirectoryName);
58
59 private:
61 static constexpr auto pImportedFileName = "t";
62 };
63}
Definition: TextureImporter.h:28
static std::optional< Error > importTexture(const std::filesystem::path &pathToTexture, TextureImportFormat textureImportFormat, const std::string &sPathToOutputDirRelativeRes, const std::string &sOutputDirectoryName)
Definition: TextureImporter.cpp:74
static constexpr const char * getImportedFileName()
Definition: TextureImporter.h:37
static constexpr auto pImportedFileName
Definition: TextureImporter.h:61