From 1dfa9714187e7bda5204ed4597aa7c662888c381 Mon Sep 17 00:00:00 2001 From: Ozan Durgut Date: Mon, 11 May 2026 21:41:58 +0200 Subject: [PATCH] wrapper: fix const-correctness for mutating image APIs Remove misleading trailing const qualifiers from C++ wrapper methods that modify the wrapped Image instance directly. Signed-off-by: Ozan Durgut --- wrapper/ImageWrapper.cpp | 10 +++++----- wrapper/ImageWrapper.hpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wrapper/ImageWrapper.cpp b/wrapper/ImageWrapper.cpp index 635bab3..4107b4c 100755 --- a/wrapper/ImageWrapper.cpp +++ b/wrapper/ImageWrapper.cpp @@ -285,7 +285,7 @@ int Image::extractHoughLines(const std::vector> &acc, /** * @brief Draws line segment between two points. */ -void Image::drawLine(int x0, int y0, int x1, int y1, uint8_t color) const noexcept +void Image::drawLine(int x0, int y0, int x1, int y1, uint8_t color) noexcept { ::drawLine(raw(), x0, y0, x1, y1, color); } @@ -293,7 +293,7 @@ void Image::drawLine(int x0, int y0, int x1, int y1, uint8_t color) const noexce /** * @brief Draws line represented in Hough space. */ -void Image::drawHoughLine(float rho, float theta, uint8_t color) const noexcept +void Image::drawHoughLine(float rho, float theta, uint8_t color) noexcept { ::drawLineOnImage(raw(), rho, theta, color); } @@ -648,7 +648,7 @@ void Image::_phase_(Image &out) const /** * @brief Applies logarithm transform in place. */ -void Image::_log_() const +void Image::_log_() { ::_log_(raw()); } @@ -656,7 +656,7 @@ void Image::_log_() const /** * @brief Adds scalar value in place. */ -void Image::_add_(float value) const +void Image::_add_(float value) { ::_add_(raw(), value); } @@ -688,7 +688,7 @@ void Image::ifft(Image &out) const /** * @brief Converts polar components to complex/cartesian form. */ -void Image::polarToCart(const Image &magnitude, Image &phase) const +void Image::polarToCart(const Image &magnitude, const Image &phase) { ::polarToCart(magnitude.raw(), phase.raw(), raw()); } diff --git a/wrapper/ImageWrapper.hpp b/wrapper/ImageWrapper.hpp index 5d1fabd..dd02a83 100755 --- a/wrapper/ImageWrapper.hpp +++ b/wrapper/ImageWrapper.hpp @@ -415,7 +415,7 @@ class Image * @param[in] color Line color value * @see ::drawLine For underlying C implementation */ - void drawLine(int x0, int y0, int x1, int y1, uint8_t color) const noexcept; + void drawLine(int x0, int y0, int x1, int y1, uint8_t color) noexcept; /** * @brief Draws an infinite line defined by Hough parameters. * @param[in] rho Distance from origin @@ -423,7 +423,7 @@ class Image * @param[in] color Line color value * @see ::drawLineOnImage For underlying C implementation */ - void drawHoughLine(float rho, float theta, uint8_t color) const noexcept; + void drawHoughLine(float rho, float theta, uint8_t color) noexcept; // Morphology /** @@ -674,14 +674,14 @@ class Image * @brief Applies natural logarithm in place. * @see ::_log_ For underlying C implementation */ - void _log_() const; + void _log_(); /** * @brief Adds scalar value to image in place. * @param[in] value Scalar offset to add to all pixels * @see ::_add_ For underlying C implementation */ - void _add_(float value) const; + void _add_(float value); /** * @brief Computes inverse Fourier transform. @@ -696,7 +696,7 @@ class Image * @param[in] phase Phase image in radians * @see ::polarToCart For underlying C implementation */ - void polarToCart(const Image &magnitude, Image &phase) const; + void polarToCart(const Image &magnitude, const Image &phase); /** * @brief Multiplies two images element-wise.