libs/base/src/eu/base/colors.cc

 

warning: struct 'MaxSaturationCoefficients' can be moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 57 : 8

   57 | struct MaxSaturationCoefficients
      |        ^

warning: function 'compute_max_saturation' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 72 : 7

   72 | float compute_max_saturation(float a, float b)
      |       ^
      | static 

warning: struct 'Lc' can be moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 164 : 8

  164 | struct Lc
      |        ^

warning: function 'find_cusp' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 173 : 4

  173 | Lc find_cusp(float a, float b)
      |    ^
      | static 

warning: function 'find_gamut_intersection' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 191 : 7

  191 | float find_gamut_intersection(float a, float b, float big_l1, float big_c1, float big_l0)
      |       ^
      | static 

warning: function 'clamp' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 274 : 7

  274 | float clamp(float x, float min, float max)
      |       ^
      | static 

warning: function 'sgn' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 290 : 7

  290 | float sgn(float x)
      |       ^
      | static 
 

warning: use designated initializer list to initialize 'const OkLab'

[modernize-use-designated-initializers]

libs/base/src/eu/base/colors.cc 403 : 27

  403 |         return linear_from_oklab({big_l_clipped, big_c_clipped * a_prim, big_c_clipped * b_prim});
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                   .l=            .a=                     .b=

aggregate type is defined here

libs/base/src/eu/base/colors.h 66 : 1

   66 | struct OkLab
      | ^

warning: struct 'St' can be moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 496 : 8

  496 | struct St
      |        ^

warning: function 'toe' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 503 : 7

  503 | float toe(float x)
      |       ^
      | static 

warning: function 'toe_inv' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 512 : 7

  512 | float toe_inv(float x)
      |       ^
      | static 

warning: function 'st_from_cusp' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 520 : 4

  520 | St st_from_cusp(const Lc& cusp)
      |    ^
      | static 

warning: use designated initializer list to initialize 'const OkLab'

[modernize-use-designated-initializers]

libs/base/src/eu/base/colors.cc 566 : 37

  566 |         const auto rgb = linear_from_oklab({big_l, big_c * a_prim, big_c * b_prim});
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                             .l=    .a=             .b=

aggregate type is defined here

libs/base/src/eu/base/colors.h 66 : 1

   66 | struct OkLab
      | ^
 

warning: do not use nested 'std:: max' calls, use an initializer list instead

[modernize-min-max-use-initializer-list]

libs/base/src/eu/base/colors.cc 599 : 39

  599 |         const auto scale_big_l = cbrtf(1.f / std::max(std::max(rgb_scale.r, rgb_scale.g), std::max(rgb_scale.b, 0.f)));
      |                                              ^        ~~~~~~~~~                        ~  ~~~~~~~~~                ~
      |                                                       {                                                            }

warning: function 'get_st_mid' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 619 : 4

  619 | St get_st_mid(float a_prim, float b_prim)
      |    ^
      | static 

warning: struct 'Cs' can be moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 642 : 8

  642 | struct Cs
      |        ^

warning: function 'get_cs' can be made static or moved into an anonymous namespace to enforce internal linkage

[misc-use-internal-linkage]

libs/base/src/eu/base/colors.cc 649 : 4

  649 | Cs get_cs(float big_l, float a_prim, float b_prim)
      |    ^
      | static 
 

warning: redundant parentheses around expression

[readability-redundant-parentheses]

libs/base/src/eu/base/colors.cc 731 : 28

  731 |                         const auto k_2 = (1.f - (k_1) / (c_max - c_mid));
      |                                                 ^   ~

warning: redundant parentheses around expression

[readability-redundant-parentheses]

libs/base/src/eu/base/colors.cc 775 : 27

  775 |                 const auto k_2 = (1.f - (k_1) / (big_c_max - big_c_mid));
      |                                         ^   ~