1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

Merge pull request #26937 from MaximSmolskiy:support-bool-type-for-filestorage-base64

Support bool type for FileStorage Base64 #26937

### Pull Request Readiness Checklist

OpenCV extra: https://github.com/opencv/opencv_extra/pull/1238

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
- [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
This commit is contained in:
Maxim Smolskiy
2025-03-07 08:35:44 +03:00
committed by GitHub
parent db40139f16
commit 77eb6ed52d
5 changed files with 31 additions and 3 deletions
@@ -202,6 +202,7 @@ int base64::icvCalcStructSize(const char *dt, int initial_size) {
switch ( *type )
{
case 'u': { elem_max_size = std::max( elem_max_size, sizeof(uchar ) ); break; }
case 'b': { elem_max_size = std::max( elem_max_size, sizeof(uchar ) ); break; }
case 'c': { elem_max_size = std::max( elem_max_size, sizeof(schar ) ); break; }
case 'w': { elem_max_size = std::max( elem_max_size, sizeof(ushort) ); break; }
case 's': { elem_max_size = std::max( elem_max_size, sizeof(short ) ); break; }
@@ -333,6 +334,10 @@ size_t base64::RawDataToBinaryConvertor::make_to_binary_funcs(const std::string
size = sizeof(uchar);
pack.func = to_binary<uchar>;
break;
case 'b':
size = sizeof(uchar);
pack.func = to_binary<bool>;
break;
case 'w':
case 's':
size = sizeof(ushort);