Skip to content

Naming all enumerations in videoio.hpp #6746

@PkLab

Description

@PkLab
  • OpenCV version: 3.x
  • Which part: videoio.hpp
  • Actual behaviour: All enumerations in videoio.hpp are unnamed

Expected behaviour

Starting from @mshabunin suggestion:

Naming all enumerations in videoio.hpp to make it possible to refer them from corresponding function documentation. See documentation for cv::imread for example.

Additional description

Because once a name is assigned it will be hard/impossible to change later, please find here some request for comment:

  1. Which naming convention should be used ?
  2. Are there enumerations that might/should be merged ?
  3. May be some enumerations should live in their own module like OPENNI_, PVAPI_, XI_, and so on
  4. May be enumerations should have better organization or stronger type like MEDIA_API, MEDIA_PROPERTIES (class and inheritance ?, C++11 typed enumeration ?,...)
  5. Should functions that use enumerations be declared with enumeration name as arg type instead of simple int e.g. VideoCapture::get(MEDIA_PROPERTIES propId) or VideoCapture::open( String filename, MEDIA_API apiPreference ) ?
  6. Meaning of enumerator value is mixed. It could be an ID, a flag, a mask of bits. Last cases, changing the enumerator value will break the code. Some kind of warning should exist here: e.g CAP_api is used with %10 to select the api, or OpenNI shortcuts or CAP_PVAPI_DECIMATION_2OUTOF8,...
  7. Shall we forget all about and try to derive enumeration name from common part of enumerators e.g. enum CAP_PROP {CAP_PROP_POS_MSEC=0, CAP_PROP_POS_FRAMES=1,...}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions