palette.h

来自「虚幻的再开发程序包源代码」· C头文件 代码 · 共 38 行

H
38
字号
//
// Fast Heckbert quantiser for creating paletted textures from
// high/true colour input textures
//
// Alpha weighting is going to be a tricky thing - unlike the RGB weightings
// which are well defined, the importance of the alpha channel probably has to
// have the highest weighting of all. However, because it affects all the other
// components its correct weighting is almost certainly some product of the alpha
// value itself and the colours it encompasses, rather than a fixed value...
//
// Some code based on source from the Independent JPEG group
// Copyright (C) 1991-1998, Thomas G. Lane.
//
//
// A. Pomianowski
//

__declspec( dllexport ) int   HeckbertQuantize(void            *srcdata, 
                       unsigned char   *dstdata,
                       unsigned short  *paldata,
                       int             srcformat,
                       int             nentries,
                       int             width,
                       int             height,
                       int             has_colourkey,
                       unsigned long   keyval,
                       int             generate_mipmaps);


// Source data formats

#define  ARGB_8888 0
#define  XRGB_8888 1
#define  RGB_888   2
#define  RGB_565   3
#define  ARGB_1555 4
#define  ARGB_4444 5

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?