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#include "material/TextureFilteringPreference.h"
10
11namespace ne {
12 enum class TextureImportFormat {
13 R, //< BC4 compression, only one 8 bit channel, can be used for heightmaps for example.
14 RG, //< BC5 compression, 8 bits for R and 8 bits for G channel, can be used for normal maps.
15 RGB, //< BC1 compression, bits per channel: 5 for R, 6 for G, 5 for B.
16 RGB_1BIT_A, //< BC1 compression, bits per channel: 5 for R, 6 for G, 5 for B and 0 or 1 bit for alpha.
17 RGB_8BIT_A, //< BC3 compression, bits per channel: 5 for R, 6 for G, 5 for B and 8 bit for alpha.
18 HDR, //< BC6H compression, used for HDR textures.
19 RGB_HIGH_QUALITY, //< BC7 compression, high quality of the compressed image but bigger file size and
20 // longer import.
21 RGBA_HIGH_QUALITY, //< BC7 compression, high quality of the compressed image but bigger file size and
22 // longer import.
23 };
24
30 public:
31 TextureImporter() = delete;
32
38 static constexpr std::string_view getImportedFileName() { return sImportedFileName; }
39
46 static constexpr std::string_view getImportedTextureSettingsFileName() {
48 }
49
66 [[nodiscard]] static std::optional<Error> importTexture(
67 const std::filesystem::path& pathToTexture,
68 TextureImportFormat textureImportFormat,
69 const std::string& sPathToOutputDirRelativeRes,
70 const std::string& sOutputDirectoryName,
71 TextureFilteringPreference filteringPreference =
72 TextureFilteringPreference::FROM_RENDER_SETTINGS);
73
74 private:
76 static constexpr std::string_view sImportedFileName = "t";
77
79 static constexpr std::string_view sImportedTextureSettingsFileName = "settings";
80 };
81}
Definition: TextureImporter.h:29
static std::optional< Error > importTexture(const std::filesystem::path &pathToTexture, TextureImportFormat textureImportFormat, const std::string &sPathToOutputDirRelativeRes, const std::string &sOutputDirectoryName, TextureFilteringPreference filteringPreference=TextureFilteringPreference::FROM_RENDER_SETTINGS)
Definition: TextureImporter.cpp:75
static constexpr std::string_view sImportedTextureSettingsFileName
Definition: TextureImporter.h:79
static constexpr std::string_view getImportedTextureSettingsFileName()
Definition: TextureImporter.h:46
static constexpr std::string_view getImportedFileName()
Definition: TextureImporter.h:38
static constexpr std::string_view sImportedFileName
Definition: TextureImporter.h:76