⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hdp.h

📁 [Game.Programming].Academic - Graphics Gems (6 books source code)
💻 H
字号:
/*** HDP.H : Encoding and Decoding of High Dynamic Range Pixels*//*** Encoding and Decoding Types*/typedef unsigned char byte;typedef float real; /* change to "double" if you work with double precision */typedef byte bytecolor[3];typedef real realcolor[3];/*** Encoding and Decoding Tables*/extern byte *EncodeLut;extern real *DecodeLut;extern real  LutScale;/*** Encoding and Decoding Functions*/extern int init_HDP_encode (real,real,int);extern int init_HDP_decode (real,real,real);extern void exit_HDP_encode (void);extern void exit_HDP_decode (void);/*** Encoding and Decoding Macros*/#define HDP_ENCODE(RealColor,ByteColor) ( \   ByteColor[0] = EncodeLut [(int) (RealColor[0] * LutScale + 0.5)], \   ByteColor[1] = EncodeLut [(int) (RealColor[1] * LutScale + 0.5)], \   ByteColor[2] = EncodeLut [(int) (RealColor[2] * LutScale + 0.5)])#define HDP_DECODE(ByteColor,RealColor) ( \   RealColor[0] = DecodeLut [ByteColor[0]], \   RealColor[1] = DecodeLut [ByteColor[1]], \   RealColor[2] = DecodeLut [ByteColor[2]])

⌨️ 快捷键说明

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