-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Naming all enumerations in videoio.hpp #6746
Copy link
Copy link
Closed
Labels
Description
- 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:
- Which naming convention should be used ?
- Are there enumerations that might/should be merged ?
- May be some enumerations should live in their own module like OPENNI_, PVAPI_, XI_, and so on
- May be enumerations should have better organization or stronger type like
MEDIA_API,MEDIA_PROPERTIES(class and inheritance ?, C++11 typed enumeration ?,...) - Should functions that use enumerations be declared with enumeration name as arg type instead of simple int e.g.
VideoCapture::get(MEDIA_PROPERTIES propId)orVideoCapture::open( String filename, MEDIA_API apiPreference )? - 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_apiis used with %10 to select the api, or OpenNI shortcuts orCAP_PVAPI_DECIMATION_2OUTOF8,... - 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,...}
Reactions are currently unavailable