mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 13:53:37 +00:00
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
This commit is contained in:
61
drape/texture_types.hpp
Normal file
61
drape/texture_types.hpp
Normal file
@@ -0,0 +1,61 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user