AnsweredAssumed Answered

About the math function pow() running incorrectly on JN5169

Question asked by Linklai kjd on Nov 14, 2019
Latest reply on Nov 15, 2019 by Sebastian Delrio

A bus error occurred when I ran this line of code. Why can't this pow() function run? What should I do?Run this code above the 1216 routine

void hwLight_GammaCorrectRGB(float *R, float *G, float *B)
{
if ( *R > 0.003 ) *R = (1.22 * ( pow(*R, ( 1/1.5 ) )) - 0.040);
else *R = 0; //1.8023 * var_R;
if ( *G > 0.003) *G = (1.22 * ( pow(*G, ( 1/1.5 ) )) - 0.040);
else *G = 0; //1.8023 * var_G;
if ( *B > 0.003 ) *B = (1.09 * ( pow(*B, ( 1/1.5 ) )) - 0.050);
else *B = 0; //1.8023 * var_B;
}

Outcomes