TexConv/pixel_format.h

99 lines
1.5 KiB
C
Raw 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>
using namespace hgl;
enum class ColorFormat
{
NONE=0,
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,
2019-12-03 20:49:25 +08:00
A2BGR10,
R16,
2019-11-26 17:27:48 +08:00
R16F,
2019-12-03 20:49:25 +08:00
RG16,
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
enum class ColorDataType
{
NONE=0,
UNORM,
SNORM,
2019-12-02 22:10:49 +08:00
USCALE,
SSCALE,
2019-12-03 20:49:25 +08:00
UINT,
SINT,
2019-11-26 17:27:48 +08:00
UFLOAT,
SFLOAT,
2019-12-03 20:49:25 +08:00
SRGB,
2019-11-26 17:27:48 +08:00
END
};//enum class ColorDataType
struct ColorDataFormat
{
char color; //颜色成份 R/G/B/A/D等
ColorDataType type; //UNORM/SNORM等
uint8 bits; //位数
};//
struct PixelFormat
{
2019-11-26 17:54:02 +08:00
ColorFormat format;
char name[32];
2019-11-26 17:27:48 +08:00
2019-12-02 22:10:49 +08:00
uint8 channels; //颜色通道数
2019-11-26 17:27:48 +08:00
char color[4];
uint8 bits[4];
2020-10-25 21:22:18 +08:00
uint total_bits; //每象素总位数
2019-11-26 17:27:48 +08:00
ColorDataType 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();