From 23b819efb8d96106005789cda294ef7fafca6f69 Mon Sep 17 00:00:00 2001 From: Laurent Berger <3591626+LaurentBerger@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:24:07 +0200 Subject: [PATCH] Merge pull request #23555 from LaurentBerger:doc_format don't ignore documentation for cv::format in doxygen #23555 Issue https://github.com/opencv/opencv/issues/23553 See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work issue - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake --- .../core/include/opencv2/core/operations.hpp | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index 43a9eb8603..ab7d429782 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -61,10 +61,10 @@ # define CV_FORMAT_PRINTF(A, B) #endif -//! @cond IGNORED - namespace cv { +//! @cond IGNORED + ////////////////////////////// Matx methods depending on core API ///////////////////////////// @@ -424,26 +424,6 @@ template static inline _Tp randu() return (_Tp)theRNG(); } -///////////////////////////////// Formatted string generation ///////////////////////////////// - -/** @brief Returns a text string formatted using the printf-like expression. - -The function acts like sprintf but forms and returns an STL string. It can be used to form an error -message in the Exception constructor. -@param fmt printf-compatible formatting specifiers. - -**Note**: -|Type|Specifier| -|-|-| -|`const char*`|`%s`| -|`char`|`%c`| -|`float` / `double`|`%f`,`%g`| -|`int`, `long`, `long long`|`%d`, `%ld`, ``%lld`| -|`unsigned`, `unsigned long`, `unsigned long long`|`%u`, `%lu`, `%llu`| -|`uint64` -> `uintmax_t`, `int64` -> `intmax_t`|`%ju`, `%jd`| -|`size_t`|`%zu`| - */ -CV_EXPORTS String format( const char* fmt, ... ) CV_FORMAT_PRINTF(1, 2); ///////////////////////////////// Formatted output of cv::Mat ///////////////////////////////// @@ -496,6 +476,28 @@ int print(const Matx<_Tp, m, n>& matx, FILE* stream = stdout) //! @endcond +///////////////////////////////// Formatted string generation ///////////////////////////////// + +/** @brief Returns a text string formatted using the printf-like expression. + +The function acts like sprintf but forms and returns an STL string. It can be used to form an error +message in the Exception constructor. +@param fmt printf-compatible formatting specifiers. + +**Note**: +|Type|Specifier| +|-|-| +|`const char*`|`%s`| +|`char`|`%c`| +|`float` / `double`|`%f`,`%g`| +|`int`, `long`, `long long`|`%d`, `%ld`, ``%lld`| +|`unsigned`, `unsigned long`, `unsigned long long`|`%u`, `%lu`, `%llu`| +|`uint64` -> `uintmax_t`, `int64` -> `intmax_t`|`%ju`, `%jd`| +|`size_t`|`%zu`| +@ingroup core_utils + */ +CV_EXPORTS String format(const char* fmt, ...) CV_FORMAT_PRINTF(1, 2); + /****************************************************************************************\ * Auxiliary algorithms * \****************************************************************************************/