Files
comaps/drape/texture_types.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

62 lines
1.1 KiB
C++

#pragma once
#include "base/assert.hpp"
#include <cstdint>
namespace dp
{
enum class TextureFormat : uint8_t
{
RGBA8,
Alpha,
RedGreen,
DepthStencil,
Depth,
Unspecified
};
inline std::string DebugPrint(TextureFormat tf)
{
switch (tf)
{
case TextureFormat::RGBA8: return "RGBA8";
case TextureFormat::Alpha: return "Alpha";
case TextureFormat::RedGreen: return "RedGreen";
case TextureFormat::DepthStencil: return "DepthStencil";
case TextureFormat::Depth: return "Depth";
case TextureFormat::Unspecified: return "Unspecified";
}
UNREACHABLE();
return {};
}
enum class TextureFilter : uint8_t
{
Nearest,
Linear
};
enum class TextureWrapping : uint8_t
{
ClampToEdge,
Repeat
};
inline uint8_t GetBytesPerPixel(TextureFormat format)
{
uint8_t result = 0;
switch (format)
{
case TextureFormat::RGBA8: result = 4; break;
case TextureFormat::Alpha: result = 1; break;
case TextureFormat::RedGreen: result = 2; break;
case TextureFormat::DepthStencil: result = 4; break;
case TextureFormat::Depth: result = 4; break;
default: ASSERT(false, ()); break;
}
return result;
}
} // namespace dp