MCPcopy Create free account
hub / github.com/carbonengine/trinity / ConvertRGBToCoCg_Y

Function ConvertRGBToCoCg_Y

trinity/Tr2DxtCompressor.cpp:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void ConvertRGBToCoCg_Y( uint8_t* image, int width, int height )
46{
47 for( int i = 0; i < width * height; i++ )
48 {
49 int r = image[i * 4 + 0];
50 int g = image[i * 4 + 1];
51 int b = image[i * 4 + 2];
52 int a = image[i * 4 + 3];
53 image[i * 4 + 0] = CLAMP_BYTE( RGB_TO_YCOCG_CO( r, g, b ) + 128 );
54 image[i * 4 + 1] = CLAMP_BYTE( RGB_TO_YCOCG_CG( r, g, b ) + 128 );
55 image[i * 4 + 2] = a;
56 image[i * 4 + 3] = CLAMP_BYTE( RGB_TO_YCOCG_Y( r, g, b ) );
57 }
58}
59
60void ConvertCoCg_YToRGB( uint8_t* image, int width, int height )
61{

Callers 1

Tr2DxtCompressSurfaceFunction · 0.85

Calls 1

CLAMP_BYTEFunction · 0.85

Tested by

no test coverage detected