namespace
texNamespaces
- namespace detail
Classes
- struct BestFormatFor
- class CompressionDevice
- Recommended way to use is to make it static.
- class CrunchTexture
- struct Dimension
- class FailureSourceCategory
- struct GuessBestFormatArgs
- struct Settings
- class Texture
- struct TextureErrCategory
Enums
-
enum class FailureSource: std::
uint8_t { BadUserInput = 1, SystemError = 2 } -
enum class TextureErr: std::
uint8_t { Success = 0, Unknown = 1, BadInput, MemoryAllocation, WriteFailure, ReadFailure } -
enum class TextureType: std::
uint8_t { Diffuse, Normal, Cube, Specular, Glow, Parallax, ModelSpaceNormal, Backlight, Skin, EnvironmentMask }
Typedefs
- using Result = tl::expected<Texture, Error>
- using ResultCrunch = tl::expected<CrunchTexture, Error>
- using ResultError = tl::expected<void, Error>
Functions
- NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Dimension, w, h) namespace util
- NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(BestFormatFor, uncompressed, uncompressed_without_alpha, compressed, compressed_without_alpha)
- NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GuessBestFormatArgs, opaque_alpha, allow_compressed, force_alpha)
- NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Settings, game, compress, resize, mipmaps, use_format_whitelist, allowed_formats, output_format, landscape_textures) struct OptimizationSteps
-
NLOHMANN_JSON_SERIALIZE_ENUM(TextureType,
{{TextureType::
Diffuse, "diffuse"}, {TextureType:: Normal, "normal"}, {TextureType:: Cube, "cube"}, {TextureType:: Specular, "specular"}, {TextureType:: Glow, "glow"}, {TextureType:: Parallax, "parallax"}, {TextureType:: ModelSpaceNormal, "model_space_normal"}, {TextureType:: Backlight, "backlight"}, {TextureType:: Skin, "skin"}, {TextureType:: EnvironmentMask, "environment_mask"}}) - auto compute_optimization_steps(const Texture& file, const Settings& sets) → OptimizationSteps noexcept
- auto compute_optimization_steps(const CrunchTexture& file, const Settings& sets) → OptimizationSteps noexcept
- auto convert(CrunchTexture&& file, DXGI_FORMAT format) → ResultCrunch
- auto convert(Texture&& file, DXGI_FORMAT format, CompressionDevice& dev) → Result
- auto decompress(Texture&& file) → Result
-
auto error_from_hresult(int64_t hr,
std::
error_code default_err = TextureErr:: Unknown, std:: source_location loc = std:: source_location:: current()) → Error -
auto from_string(std::
u8string_view str) → DXGI_FORMAT - auto generate_mipmaps(CrunchTexture&& file) → ResultCrunch
- auto generate_mipmaps(Texture&& file) → Result
- auto guess_best_format(DXGI_FORMAT current_format, BestFormatFor formats, const GuessBestFormatArgs& guess_params) → DXGI_FORMAT noexcept
-
auto guess_texture_type(std::
u8string_view path) → std:: optional<TextureType> noexcept - Based on https:/
/ forums.nexusmods.com/ index.php?/ topic/ 476227-skyrim-nif-files-with-underscores/ . - auto load(Path path) → tl::expected<Texture, Error> noexcept
-
auto load(Path relative_path,
std::
span<std:: byte> data) → tl::expected<Texture, Error> noexcept - auto load_crunch(Path path) → tl::expected<CrunchTexture, Error> noexcept
-
auto load_crunch(Path relative_path,
std::
span<const std:: byte> data) → tl::expected<CrunchTexture, Error> noexcept -
auto make_error_code(TextureErr e) → std::
error_code -
auto make_error_condition(FailureSource e) → std::
error_condition - auto make_transparent_alpha(Texture&& file) → Result
- auto optimal_mip_count(Dimension dim) → size_t constexpr noexcept
- auto optimize(Texture&& file, OptimizationSteps sets, CompressionDevice& dev) → Result noexcept
- auto optimize(CrunchTexture&& file, OptimizationSteps sets, CompressionDevice& dev) → ResultCrunch noexcept
- auto resize(CrunchTexture&& file, Dimension dim) → ResultCrunch
- auto resize(Texture&& file, Dimension dim) → Result
- auto save(const CrunchTexture& tex, const Path& path) → ResultError noexcept
-
auto save(const CrunchTexture& tex) → tl::expected<std::
vector<std:: byte>, Error> noexcept - auto save(const Texture& tex, const Path& path) → ResultError noexcept
-
auto save(const Texture& tex) → tl::expected<std::
vector<std:: byte>, Error> noexcept -
auto to_string(DXGI_FORMAT format) → std::
u8string_view
Variables
- auto canonize_path constexpr
- const FailureSourceCategory k_failure_source_category
- const TextureErrCategory k_texture_err_category
Enum documentation
enum class btu:: tex:: FailureSource: std:: uint8_t
#include <btu/tex/error_code.hpp>
enum class btu:: tex:: TextureErr: std:: uint8_t
#include <btu/tex/error_code.hpp>
enum class btu:: tex:: TextureType: std:: uint8_t
#include <btu/tex/formats.hpp>
Typedef documentation
using btu:: tex:: Result = tl::expected<Texture, Error>
#include <btu/tex/detail/common.hpp>
using btu:: tex:: ResultCrunch = tl::expected<CrunchTexture, Error>
#include <btu/tex/detail/common.hpp>
using btu:: tex:: ResultError = tl::expected<void, Error>
#include <btu/tex/detail/common.hpp>
Function documentation
btu:: tex:: NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Dimension,
w,
h) namespace util
#include <btu/tex/dimension.hpp>
btu:: tex:: NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(BestFormatFor,
uncompressed,
uncompressed_without_alpha,
compressed,
compressed_without_alpha)
#include <btu/tex/formats.hpp>
btu:: tex:: NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GuessBestFormatArgs,
opaque_alpha,
allow_compressed,
force_alpha)
#include <btu/tex/formats.hpp>
btu:: tex:: NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Settings,
game,
compress,
resize,
mipmaps,
use_format_whitelist,
allowed_formats,
output_format,
landscape_textures) struct OptimizationSteps
#include <btu/tex/optimize.hpp>
btu:: tex:: NLOHMANN_JSON_SERIALIZE_ENUM(TextureType,
{{TextureType:: Diffuse, "diffuse"}, {TextureType:: Normal, "normal"}, {TextureType:: Cube, "cube"}, {TextureType:: Specular, "specular"}, {TextureType:: Glow, "glow"}, {TextureType:: Parallax, "parallax"}, {TextureType:: ModelSpaceNormal, "model_space_normal"}, {TextureType:: Backlight, "backlight"}, {TextureType:: Skin, "skin"}, {TextureType:: EnvironmentMask, "environment_mask"}})
#include <btu/tex/formats.hpp>
OptimizationSteps btu:: tex:: compute_optimization_steps(const Texture& file,
const Settings& sets) noexcept
#include <btu/tex/optimize.hpp>
OptimizationSteps btu:: tex:: compute_optimization_steps(const CrunchTexture& file,
const Settings& sets) noexcept
#include <btu/tex/optimize.hpp>
ResultCrunch btu:: tex:: convert(CrunchTexture&& file,
DXGI_FORMAT format)
#include <btu/tex/crunch_functions.hpp>
Result btu:: tex:: convert(Texture&& file,
DXGI_FORMAT format,
CompressionDevice& dev)
#include <btu/tex/functions.hpp>
Result btu:: tex:: decompress(Texture&& file)
#include <btu/tex/functions.hpp>
Error btu:: tex:: error_from_hresult(int64_t hr,
std:: error_code default_err = TextureErr:: Unknown,
std:: source_location loc = std:: source_location:: current())
#include <btu/tex/error_code.hpp>
DXGI_FORMAT btu:: tex:: from_string(std:: u8string_view str)
#include <btu/tex/detail/formats_string.hpp>
ResultCrunch btu:: tex:: generate_mipmaps(CrunchTexture&& file)
#include <btu/tex/crunch_functions.hpp>
Result btu:: tex:: generate_mipmaps(Texture&& file)
#include <btu/tex/functions.hpp>
DXGI_FORMAT btu:: tex:: guess_best_format(DXGI_FORMAT current_format,
BestFormatFor formats,
const GuessBestFormatArgs& guess_params) noexcept
#include <btu/tex/formats.hpp>
std:: optional<TextureType> btu:: tex:: guess_texture_type(std:: u8string_view path) noexcept
#include <btu/tex/formats.hpp>
Based on https:/