Repository: opencv
Issue: VideoCapture with ueye backend cannot set gain
Labels: category: videoio,community help requested

##### System information (version)

- OpenCV => 4.5.5
- Operating System / Platform => Ubuntu 22.04
- Compiler => gcc 11.2

##### Detailed description
`cv::VideoCapture` cannot set property `cv::CAP_PROP_GAIN` with the ueye backend. The setting does nothing.
OpenCV is built with ueye software suite 4.96.

##### Steps to reproduce

```.cpp
// C++ code example

int main(int argc, const char* argv[]) {
  cv::VideoCapture cap(0, cv::CAP_UEYE);

  cap.set(cv::CAP_PROP_GAIN, 30); // also tried with floating point values such as 1.5, 0.8, etc...
  std::cout << "master gain: " << cap.get(cv::CAP_PROP_GAIN) << std::endl;

  return 0;
}

// [output]
// master gain: 1
```
I think the issue is due to setting the gain using a gain factor.
https://github.com/opencv/opencv/blob/b0dc474160e389b9c9045da5db49d03ae17c6a6b/modules/videoio/src/cap_ueye.cpp#L214-L215

If I use `is_SetHardwareGain` the gain works fine. e.g.
```.cpp
...
cv::VideoCapture cap(0, cv::CAP_UEYE);
// ueye devices ID is 1-based
is_SetHardwareGain(1, 30,  IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER)

std::cout << "master gain: " << cap.get(cv::CAP_PROP_GAIN) << std::endl;
...

// [output]
// master gain: 2.4
```

##### Issue submission checklist

 - [x] I report the issue, it's not a question
   <!--
   OpenCV team works with forum.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with questions without a real issue statement will be
   closed.
   -->
 - [x] I checked the problem with documentation, FAQ, open issues,
       forum.opencv.org, Stack Overflow, etc and have not found any solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://forum.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [x] I updated to the latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only the latest release for each branch.
   The ticket is closed if the problem is not reproduced with the modern version.
   -->
 - [x] There is reproducer code and related data files: videos, images, onnx, etc
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as an archive to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->