Skip to content

use standard C++ types in API #24994

@vpisarev

Description

@vpisarev

Describe the feature and motivation

For OpenCV 5, where we have a good chance to repair certain things, even if it slightly breaks API, it would be nice to replace some "home-brewed" names with somewhat more standard:

  • uchar => uint8_t
  • schar => int8_t
  • short => int16_t
  • ushort => uint16_t
  • unsigned => uint32_t (where it makes sense)
  • int64 => int64_t
  • uint64 => uint64_t
  • cv::String => std::string (some functions may take std::string_view for slightly better efficiency)
  • cv::Ptr => std::shared_ptr

'int' is a special story - it's used very often in API and probably we should keep it as-is in API (except when int means int32_t, not just "integer with sufficiently large value range")

the old definitions may be put into a dedicated header that may be included by default in OpenCV 5 and not included by default in OpenCV 6+

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupCode cleanup (e.g, drop legacy C-API, legacy unmaintained code)feature

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions