func: qcms_profile* qcms_profile_sRGB(void) uint16_t * table ; table = build_sRGB_gamma_table ( 1024 ); static uint16_t *build_sRGB_gamma_table(int num_entries) int i ; double gamma = 2.4 ; double a = 1. / 1.055 ; double b = 0.055 / 1.055 ; double c = 1. / 12.92 ; double d = 0.04045 ; uint16_t * table = malloc ( sizeof ( uint16_t ) * num_entries ) ; if ( ! table )  return NULL ; for (i=0; i<num_entries; i++) double x = ( double ) i / ( num_entries - 1 ) ; double y , output ; if ( x >= d )  double e = ( a * x + b ) ; if ( e > 0 )  y = pow ( e , gamma ); y = 0; y = c * x; output = y * 65535. + .5; if ( output > 65535. )  output = 65535; if ( output < 0 )  output = 0; table [ i ] = ( uint16_t ) floor ( output ); return table ; if ( ! table )  free ( table ); 