MCPcopy Create free account
hub / github.com/crownengine/crown / decodeBlockPtc14RgbAddB

Function decodeBlockPtc14RgbAddB

3rdparty/bimg/src/image.cpp:3102–3116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3100 }
3101
3102 static void decodeBlockPtc14RgbAddB(uint32_t _block, uint32_t* _r, uint32_t* _g, uint32_t* _b, uint8_t _factor)
3103 {
3104 if (0 != (_block & (1<<31) ) )
3105 {
3106 *_r += bitRangeConvert( (_block >> 26) & 0x1f, 5, 8) * _factor;
3107 *_g += bitRangeConvert( (_block >> 21) & 0x1f, 5, 8) * _factor;
3108 *_b += bitRangeConvert( (_block >> 16) & 0x1f, 5, 8) * _factor;
3109 }
3110 else
3111 {
3112 *_r += bitRangeConvert( (_block >> 24) & 0xf, 4, 8) * _factor;
3113 *_g += bitRangeConvert( (_block >> 20) & 0xf, 4, 8) * _factor;
3114 *_b += bitRangeConvert( (_block >> 16) & 0xf, 4, 8) * _factor;
3115 }
3116 }
3117
3118 static void decodeBlockPtc14(uint8_t _dst[16*4], const uint8_t* _src, uint32_t _x, uint32_t _y, uint32_t _width, uint32_t _height)
3119 {

Callers 1

decodeBlockPtc14Function · 0.85

Calls 1

bitRangeConvertFunction · 0.85

Tested by

no test coverage detected