TexConv/pixel_format.h

90 lines
1.5 KiB
C
Raw Permalink Normal View History

2019-11-28 01:44:50 +08:00
#pragma once
2019-11-26 17:27:48 +08:00
#include<hgl/type/DataType.h>
2022-06-23 18:33:52 +08:00
#include<hgl/graph/VKFormat.h>
2019-11-26 17:27:48 +08:00
using namespace hgl;
2022-06-23 18:33:52 +08:00
using namespace hgl::graph;
2019-11-26 17:27:48 +08:00
enum class ColorFormat
{
NONE=0,
2021-11-29 15:28:37 +08:00
RGBA4,
2019-11-26 17:27:48 +08:00
BGRA4,
RGB565,
A1RGB5,
2019-12-03 20:49:25 +08:00
R8,
RG8,
RGBA8,
2020-10-19 20:01:00 +08:00
RGBA8SN,
RGBA8U,
RGBA8I,
2021-11-29 15:28:37 +08:00
ABGR8,
2019-12-03 20:49:25 +08:00
A2BGR10,
R16,
2021-11-29 15:28:37 +08:00
R16U,
R16I,
2019-11-26 17:27:48 +08:00
R16F,
2019-12-03 20:49:25 +08:00
RG16,
2021-11-29 15:28:37 +08:00
RG16U,
RG16I,
2019-11-26 17:27:48 +08:00
RG16F,
2019-12-03 20:49:25 +08:00
RGBA16,
2020-10-19 20:01:00 +08:00
RGBA16SN,
RGBA16U,
RGBA16I,
2019-11-26 17:27:48 +08:00
RGBA16F,
R32U,
R32I,
R32F,
RG32U,
RG32I,
RG32F,
RGB32U,
RGB32I,
RGB32F,
RGBA32U,
RGBA32I,
RGBA32F,
2019-12-04 20:47:58 +08:00
B10GR11UF,
2019-11-26 17:27:48 +08:00
COMPRESS,
2020-08-08 22:53:08 +08:00
BC1RGB,
BC1RGBA,
BC2,
BC3,
BC4,
BC5,
BC6H,
BC6H_SF,
BC7,
2019-11-26 17:27:48 +08:00
END
};//enum class ColorFormat
struct ColorDataFormat
{
2022-06-23 18:33:52 +08:00
char color; //颜色成份 R/G/B/A/D等
VulkanBaseType type; //UNORM/SNORM等
2022-06-23 18:33:52 +08:00
uint8 bits; //位数
2019-11-26 17:27:48 +08:00
};//
struct PixelFormat
{
2022-06-23 18:33:52 +08:00
ColorFormat format;
char name[32];
2019-11-26 17:27:48 +08:00
2022-06-23 18:33:52 +08:00
uint8 channels; //颜色通道数
char color[4];
uint8 bits[4];
uint total_bits; //每象素总位数
VulkanBaseType type;
};//struct PixelFormat
2019-11-26 17:27:48 +08:00
2019-11-26 17:54:02 +08:00
const PixelFormat *GetPixelFormat(ColorFormat); ///<根据获取获取象素格式类型
const PixelFormat *GetPixelFormat(const os_char *name); ///<根据名称获取象素格式类型
2019-11-28 01:44:50 +08:00
void PrintFormatList();