Message ID | 20240613083533.855791-2-stefan.klug@ideasonboard.com |
---|---|
State | Accepted |
Commit | 9b84d75cb101d129e00ff9696ccd329eb8a4c461 |
Headers | show |
Series |
|
Related | show |
Quoting Stefan Klug (2024-06-13 09:33:18) > Use a anonymous namespace instead of the static keyword to limity symbol > visibility. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > src/ipa/rkisp1/algorithms/cproc.cpp | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/src/ipa/rkisp1/algorithms/cproc.cpp b/src/ipa/rkisp1/algorithms/cproc.cpp > index 18c7b719d3c7..955298093fda 100644 > --- a/src/ipa/rkisp1/algorithms/cproc.cpp > +++ b/src/ipa/rkisp1/algorithms/cproc.cpp > @@ -33,25 +33,29 @@ namespace ipa::rkisp1::algorithms { > > LOG_DEFINE_CATEGORY(RkISP1CProc) > > +namespace { > + > constexpr float kDefaultBrightness = 0.0f; > constexpr float kDefaultContrast = 1.0f; > constexpr float kDefaultSaturation = 1.0f; > > -static int convertBrightness(const float v) > +int convertBrightness(const float v) > { > return std::clamp<int>(std::lround(v * 128), -128, 127); > } > > -static int convertContrast(const float v) > +int convertContrast(const float v) > { > return std::clamp<int>(std::lround(v * 128), 0, 255); > } > > -static int convertSaturation(const float v) > +int convertSaturation(const float v) > { > return std::clamp<int>(std::lround(v * 128), 0, 255); > } > > +} /* namespace */ > + > /** > * \copydoc libcamera::ipa::Algorithm::init > */ > -- > 2.43.0 >
Hi Stefan, Thank you for the patch. On Thu, Jun 13, 2024 at 10:33:18AM +0200, Stefan Klug wrote: > Use a anonymous namespace instead of the static keyword to limity symbol > visibility. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/ipa/rkisp1/algorithms/cproc.cpp | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/src/ipa/rkisp1/algorithms/cproc.cpp b/src/ipa/rkisp1/algorithms/cproc.cpp > index 18c7b719d3c7..955298093fda 100644 > --- a/src/ipa/rkisp1/algorithms/cproc.cpp > +++ b/src/ipa/rkisp1/algorithms/cproc.cpp > @@ -33,25 +33,29 @@ namespace ipa::rkisp1::algorithms { > > LOG_DEFINE_CATEGORY(RkISP1CProc) > > +namespace { > + > constexpr float kDefaultBrightness = 0.0f; > constexpr float kDefaultContrast = 1.0f; > constexpr float kDefaultSaturation = 1.0f; > > -static int convertBrightness(const float v) > +int convertBrightness(const float v) > { > return std::clamp<int>(std::lround(v * 128), -128, 127); > } > > -static int convertContrast(const float v) > +int convertContrast(const float v) > { > return std::clamp<int>(std::lround(v * 128), 0, 255); > } > > -static int convertSaturation(const float v) > +int convertSaturation(const float v) > { > return std::clamp<int>(std::lround(v * 128), 0, 255); > } > > +} /* namespace */ > + > /** > * \copydoc libcamera::ipa::Algorithm::init > */
diff --git a/src/ipa/rkisp1/algorithms/cproc.cpp b/src/ipa/rkisp1/algorithms/cproc.cpp index 18c7b719d3c7..955298093fda 100644 --- a/src/ipa/rkisp1/algorithms/cproc.cpp +++ b/src/ipa/rkisp1/algorithms/cproc.cpp @@ -33,25 +33,29 @@ namespace ipa::rkisp1::algorithms { LOG_DEFINE_CATEGORY(RkISP1CProc) +namespace { + constexpr float kDefaultBrightness = 0.0f; constexpr float kDefaultContrast = 1.0f; constexpr float kDefaultSaturation = 1.0f; -static int convertBrightness(const float v) +int convertBrightness(const float v) { return std::clamp<int>(std::lround(v * 128), -128, 127); } -static int convertContrast(const float v) +int convertContrast(const float v) { return std::clamp<int>(std::lround(v * 128), 0, 255); } -static int convertSaturation(const float v) +int convertSaturation(const float v) { return std::clamp<int>(std::lround(v * 128), 0, 255); } +} /* namespace */ + /** * \copydoc libcamera::ipa::Algorithm::init */
Use a anonymous namespace instead of the static keyword to limity symbol visibility. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- src/ipa/rkisp1/algorithms/cproc.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)