func: void build_output_lut(struct curveType uint16_t **output_gamma_lut, size_t *output_gamma_lut_length) if ( trc -> type == PARAMETRIC_CURVE_TYPE )  if ( trc -> count == 0 )  if ( trc -> count == 1 )  float gamma = 1. / u8Fixed8Number_to_float ( trc -> data [ 0 ] ) ; * output_gamma_lut = build_pow_table ( gamma , 4096 ); static uint16_t *build_pow_table(float gamma, int length) int i ; uint16_t * output = malloc ( sizeof ( uint16_t ) * length ) ; if ( ! output )  return NULL ; for (i = 0; i < length; i++) uint16_fract_t result ; double x = ( ( double ) i ) / ( double ) ( length - 1 ) ; x = pow ( x , gamma ); result = floor ( x * 65535. + .5 ); output [ i ] = result; return output ; * output_gamma_lut_length = trc -> count; if ( * output_gamma_lut_length < 256 )  * output_gamma_lut_length = 256; * output_gamma_lut = invert_lut ( trc -> data , trc -> count , * output_gamma_lut_length ); static uint16_t *invert_lut(uint16_t *table, int length, int out_length) uint16_t * output = malloc ( sizeof ( uint16_t ) * out_length ) ; if ( ! output )  output [ i ] = lut_inverse_interp16 ( input , table , length ); return output ; 