| 43 | } |
| 44 | |
| 45 | void 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 | |
| 60 | void ConvertCoCg_YToRGB( uint8_t* image, int width, int height ) |
| 61 | { |
no test coverage detected