@@ -45,11 +45,11 @@ void ShepardsIDW::fillShepardsIDW(float* weights, int incR, int incB) {
4545 for (int x = 0 ; x < mMapScaleFactor ; x++) {
4646 float pos_x = ((float )x) / mMapScaleFactor ;
4747 float pos_y = ((float )y) / mMapScaleFactor ;
48- int curr_x = floor (pos_x);
49- int curr_y = floor (pos_y);
48+ int curr_x = static_cast < int >( floor (pos_x) );
49+ int curr_y = static_cast < int >( floor (pos_y) );
5050 int next_x = curr_x + incR;
5151 int next_y = curr_y + incB;
52- float e1_distance = euclideanDistance (pos_x, curr_x, pos_y, curr_y);
52+ float e1_distance = euclideanDistance (pos_x, ( float ) curr_x, pos_y, ( float ) curr_y);
5353 int index = y * mMapScaleFactor * 4 + x * 4 ;
5454 if (e1_distance == 0 ) {
5555 weights[index++] = 1 .f ;
@@ -59,13 +59,13 @@ void ShepardsIDW::fillShepardsIDW(float* weights, int incR, int incB) {
5959 } else {
6060 float e1_weight = 1 .f / e1_distance;
6161
62- float e2_distance = euclideanDistance (pos_x, curr_x, pos_y, next_y);
62+ float e2_distance = euclideanDistance (pos_x, ( float ) curr_x, pos_y, ( float ) next_y);
6363 float e2_weight = 1 .f / e2_distance;
6464
65- float e3_distance = euclideanDistance (pos_x, next_x, pos_y, curr_y);
65+ float e3_distance = euclideanDistance (pos_x, ( float ) next_x, pos_y, ( float ) curr_y);
6666 float e3_weight = 1 .f / e3_distance;
6767
68- float e4_distance = euclideanDistance (pos_x, next_x, pos_y, next_y);
68+ float e4_distance = euclideanDistance (pos_x, ( float ) next_x, pos_y, ( float ) next_y);
6969 float e4_weight = 1 .f / e4_distance;
7070
7171 float total_weight = e1_weight + e2_weight + e3_weight + e4_weight;
@@ -657,7 +657,7 @@ const std::array<float, 9> kYuvBt601ToBt709 = {
657657// U' = (0.0 * Y) + ( 1.010016 * U) + ( 0.061592 * V)
658658// V' = (0.0 * Y) + ( 0.086969 * U) + ( 1.029350 * V)
659659const std::array<float , 9 > kYuvBt601ToBt2100 = {
660- 1 .0f , -0 .128245f , -0.115879 , 0 .0f , 1 .010016f , 0 .061592f , 0 .0f , 0 .086969f , 1 .029350f };
660+ 1 .0f , -0 .128245f , -0 .115879f , 0 .0f , 1 .010016f , 0 .061592f , 0 .0f , 0 .086969f , 1 .029350f };
661661
662662// Yuv Bt2100 -> Yuv Bt709
663663// Y' = (1.0 * Y) + ( 0.018149 * U) + (-0.095132 * V)
@@ -785,7 +785,7 @@ uint8_t affineMapGain(float gainlog2, float mingainlog2, float maxgainlog2, floa
785785 float mappedVal = (gainlog2 - mingainlog2) / (maxgainlog2 - mingainlog2);
786786 if (gamma != 1 .0f ) mappedVal = pow (mappedVal, gamma);
787787 mappedVal *= 255 ;
788- return CLIP3 (mappedVal + 0 .5f , 0 , 255 );
788+ return static_cast < uint8_t >( CLIP3 (mappedVal + 0 .5f , 0 . 0f , 255 . 0f ) );
789789}
790790
791791Color applyGain (Color e, float gain, uhdr_gainmap_metadata_ext_t * metadata) {
@@ -1277,9 +1277,9 @@ bool isPixelFormatRgb(uhdr_img_fmt_t format) {
12771277}
12781278
12791279uint32_t colorToRgba1010102 (Color e_gamma) {
1280- uint32_t r = CLIP3 ((e_gamma.r * 1023 + 0 .5f ), 0 .0f , 1023 .0f );
1281- uint32_t g = CLIP3 ((e_gamma.g * 1023 + 0 .5f ), 0 .0f , 1023 .0f );
1282- uint32_t b = CLIP3 ((e_gamma.b * 1023 + 0 .5f ), 0 .0f , 1023 .0f );
1280+ uint32_t r = static_cast < uint32_t >( CLIP3 ((e_gamma.r * 1023 + 0 .5f ), 0 .0f , 1023 .0f ) );
1281+ uint32_t g = static_cast < uint32_t >( CLIP3 ((e_gamma.g * 1023 + 0 .5f ), 0 .0f , 1023 .0f ) );
1282+ uint32_t b = static_cast < uint32_t >( CLIP3 ((e_gamma.b * 1023 + 0 .5f ), 0 .0f , 1023 .0f ) );
12831283 return (r | (g << 10 ) | (b << 20 ) | (0x3 << 30 )); // Set alpha to 1.0
12841284}
12851285
0 commit comments