QVideo 4.7.1__tar.gz → 4.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. {qvideo-4.7.1 → qvideo-4.8.0}/PKG-INFO +15 -4
  2. {qvideo-4.7.1 → qvideo-4.8.0}/QVideo.egg-info/PKG-INFO +15 -4
  3. {qvideo-4.7.1 → qvideo-4.8.0}/QVideo.egg-info/SOURCES.txt +6 -2
  4. {qvideo-4.7.1 → qvideo-4.8.0}/QVideo.egg-info/requires.txt +8 -1
  5. {qvideo-4.7.1 → qvideo-4.8.0}/README.md +8 -2
  6. {qvideo-4.7.1 → qvideo-4.8.0}/__init__.py +1 -1
  7. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Flir/_camera.py +2 -1
  8. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Genicam/_camera.py +67 -52
  9. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Picamera/__init__.py +2 -1
  10. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Picamera/_camera.py +38 -55
  11. {qvideo-4.7.1 → qvideo-4.8.0}/demos/ROIdemo.py +29 -19
  12. {qvideo-4.7.1 → qvideo-4.8.0}/demos/__init__.py +1 -1
  13. qvideo-4.8.0/dvr/QDVRWidget.py +702 -0
  14. {qvideo-4.7.1 → qvideo-4.8.0}/dvr/QHDF5Reader.py +16 -2
  15. {qvideo-4.7.1 → qvideo-4.8.0}/dvr/QHDF5Writer.py +44 -2
  16. {qvideo-4.7.1 → qvideo-4.8.0}/dvr/QOpenCVWriter.py +20 -12
  17. qvideo-4.8.0/dvr/QPyAVReader.py +131 -0
  18. qvideo-4.8.0/dvr/QPyAVWriter.py +149 -0
  19. {qvideo-4.7.1 → qvideo-4.8.0}/dvr/__init__.py +12 -1
  20. qvideo-4.8.0/dvr/icons/record.svg +337 -0
  21. {qvideo-4.7.1 → qvideo-4.8.0}/filters/artistic.py +3 -1
  22. {qvideo-4.7.1 → qvideo-4.8.0}/filters/darkframe.py +1 -0
  23. {qvideo-4.7.1 → qvideo-4.8.0}/filters/dejitter.py +1 -1
  24. {qvideo-4.7.1 → qvideo-4.8.0}/filters/dog.py +4 -4
  25. {qvideo-4.7.1 → qvideo-4.8.0}/filters/edge.py +2 -3
  26. {qvideo-4.7.1 → qvideo-4.8.0}/filters/exposure.py +7 -6
  27. {qvideo-4.7.1 → qvideo-4.8.0}/filters/flatfield.py +1 -0
  28. {qvideo-4.7.1 → qvideo-4.8.0}/filters/foreground.py +1 -1
  29. {qvideo-4.7.1 → qvideo-4.8.0}/filters/gamma.py +2 -3
  30. {qvideo-4.7.1 → qvideo-4.8.0}/filters/invert.py +2 -3
  31. {qvideo-4.7.1 → qvideo-4.8.0}/filters/laplacian.py +7 -6
  32. {qvideo-4.7.1 → qvideo-4.8.0}/filters/median.py +3 -2
  33. {qvideo-4.7.1 → qvideo-4.8.0}/filters/momean.py +2 -1
  34. {qvideo-4.7.1 → qvideo-4.8.0}/filters/momedian.py +2 -1
  35. {qvideo-4.7.1 → qvideo-4.8.0}/filters/rgb.py +4 -4
  36. {qvideo-4.7.1 → qvideo-4.8.0}/filters/roi.py +2 -3
  37. {qvideo-4.7.1 → qvideo-4.8.0}/filters/smoothing.py +3 -4
  38. {qvideo-4.7.1 → qvideo-4.8.0}/filters/sobel.py +6 -5
  39. {qvideo-4.7.1 → qvideo-4.8.0}/filters/threshold.py +14 -9
  40. {qvideo-4.7.1 → qvideo-4.8.0}/filters/unsharp.py +2 -3
  41. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QFilterPipeline.py +4 -0
  42. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QFilterRackWidget.py +35 -63
  43. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QFrameRelay.py +1 -0
  44. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QSnapshot.py +3 -3
  45. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QVideoFilter.py +38 -2
  46. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QVideoScreen.py +8 -6
  47. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QVideoSource.py +25 -1
  48. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QVideoWriter.py +8 -0
  49. {qvideo-4.7.1 → qvideo-4.8.0}/lib/_camera.py +24 -10
  50. {qvideo-4.7.1 → qvideo-4.8.0}/lib/_jupyter.py +2 -1
  51. {qvideo-4.7.1 → qvideo-4.8.0}/lib/_launch.py +2 -1
  52. {qvideo-4.7.1 → qvideo-4.8.0}/lib/chooser.py +2 -1
  53. {qvideo-4.7.1 → qvideo-4.8.0}/lib/clickable.py +1 -1
  54. {qvideo-4.7.1 → qvideo-4.8.0}/overlays/trackpy.py +12 -3
  55. {qvideo-4.7.1 → qvideo-4.8.0}/overlays/yolo.py +15 -5
  56. {qvideo-4.7.1 → qvideo-4.8.0}/pyproject.toml +8 -5
  57. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_camera.py +26 -0
  58. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_darkframe.py +7 -5
  59. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_filter_export.py +41 -1
  60. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_flatfield.py +7 -5
  61. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qcamera.py +6 -5
  62. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qdvrwidget.py +464 -117
  63. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qfilterrackwidget.py +17 -0
  64. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qgenicamcamera.py +38 -6
  65. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qhdf5reader.py +12 -0
  66. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qhdf5writer.py +86 -2
  67. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qimxcamera.py +6 -5
  68. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qnoisecamera.py +4 -3
  69. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qopencvcamera.py +4 -3
  70. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qopencvwriter.py +81 -9
  71. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qpicamera.py +39 -3
  72. qvideo-4.8.0/tests/test_qpyavreader.py +150 -0
  73. qvideo-4.8.0/tests/test_qpyavwriter.py +167 -0
  74. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qvideoreader.py +4 -3
  75. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qvideoscreen.py +15 -2
  76. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qvideosource.py +53 -9
  77. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qvideowriter.py +7 -6
  78. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_roidemo.py +39 -13
  79. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_samplehold.py +2 -1
  80. qvideo-4.8.0/tests/test_teardown.py +69 -0
  81. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_trackpy_overlay.py +29 -11
  82. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_yolo_overlay.py +32 -14
  83. qvideo-4.7.1/dvr/QDVRWidget.py +0 -569
  84. qvideo-4.7.1/dvr/icons_rc.py +0 -1087
  85. qvideo-4.7.1/tests/test_icons_rc.py +0 -24
  86. {qvideo-4.7.1 → qvideo-4.8.0}/LICENSE.md +0 -0
  87. {qvideo-4.7.1 → qvideo-4.8.0}/QCamcorder.py +0 -0
  88. {qvideo-4.7.1 → qvideo-4.8.0}/QVideo.egg-info/dependency_links.txt +0 -0
  89. {qvideo-4.7.1 → qvideo-4.8.0}/QVideo.egg-info/top_level.txt +0 -0
  90. {qvideo-4.7.1 → qvideo-4.8.0}/__main__.py +0 -0
  91. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Basler/__init__.py +0 -0
  92. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Basler/_camera.py +0 -0
  93. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Basler/_tree.py +0 -0
  94. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Flir/QListFlirCameras.py +0 -0
  95. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Flir/__init__.py +0 -0
  96. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Flir/_tree.py +0 -0
  97. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Genicam/__init__.py +0 -0
  98. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Genicam/_tree.py +0 -0
  99. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/IDS/__init__.py +0 -0
  100. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/IDS/_camera.py +0 -0
  101. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/IDS/_tree.py +0 -0
  102. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/MV/__init__.py +0 -0
  103. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/MV/_camera.py +0 -0
  104. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/MV/_tree.py +0 -0
  105. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Noise/__init__.py +0 -0
  106. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Noise/_camera.py +0 -0
  107. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Noise/_tree.py +0 -0
  108. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/OpenCV/QListCVCameras.py +0 -0
  109. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/OpenCV/__init__.py +0 -0
  110. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/OpenCV/_camera.py +0 -0
  111. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/OpenCV/_devices.py +0 -0
  112. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/OpenCV/_tree.py +0 -0
  113. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Picamera/_imx500.py +0 -0
  114. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Picamera/_tree.py +0 -0
  115. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Vimbax/__init__.py +0 -0
  116. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Vimbax/_camera.py +0 -0
  117. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/Vimbax/_tree.py +0 -0
  118. {qvideo-4.7.1 → qvideo-4.8.0}/cameras/__init__.py +0 -0
  119. {qvideo-4.7.1 → qvideo-4.8.0}/demos/circulardemo.py +0 -0
  120. {qvideo-4.7.1 → qvideo-4.8.0}/demos/combineddemo.py +0 -0
  121. {qvideo-4.7.1 → qvideo-4.8.0}/demos/compositedemo.py +0 -0
  122. {qvideo-4.7.1 → qvideo-4.8.0}/demos/demo.py +0 -0
  123. {qvideo-4.7.1 → qvideo-4.8.0}/demos/filterdemo.py +0 -0
  124. {qvideo-4.7.1 → qvideo-4.8.0}/demos/filterrackdemo.py +0 -0
  125. {qvideo-4.7.1 → qvideo-4.8.0}/demos/histogramdemo.py +0 -0
  126. {qvideo-4.7.1 → qvideo-4.8.0}/demos/trackpydemo.py +0 -0
  127. {qvideo-4.7.1 → qvideo-4.8.0}/demos/uniformitydemo.py +0 -0
  128. {qvideo-4.7.1 → qvideo-4.8.0}/demos/yolodemo.py +0 -0
  129. {qvideo-4.7.1 → qvideo-4.8.0}/dvr/QCircularBuffer.py +0 -0
  130. {qvideo-4.7.1 → qvideo-4.8.0}/dvr/QCircularDVRWidget.py +0 -0
  131. {qvideo-4.7.1 → qvideo-4.8.0}/dvr/QOpenCVReader.py +0 -0
  132. {qvideo-4.7.1 → qvideo-4.8.0}/filters/_MedianBase.py +0 -0
  133. {qvideo-4.7.1 → qvideo-4.8.0}/filters/__init__.py +0 -0
  134. {qvideo-4.7.1 → qvideo-4.8.0}/filters/blob.py +0 -0
  135. {qvideo-4.7.1 → qvideo-4.8.0}/filters/circletransform.py +0 -0
  136. {qvideo-4.7.1 → qvideo-4.8.0}/filters/normalize.py +0 -0
  137. {qvideo-4.7.1 → qvideo-4.8.0}/filters/samplehold.py +0 -0
  138. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QCamera.py +0 -0
  139. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QCameraTree.py +0 -0
  140. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QFilterRack.py +0 -0
  141. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QHistogramWidget.py +0 -0
  142. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QListCameras.py +0 -0
  143. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QUniformityWidget.py +0 -0
  144. {qvideo-4.7.1 → qvideo-4.8.0}/lib/QVideoReader.py +0 -0
  145. {qvideo-4.7.1 → qvideo-4.8.0}/lib/__init__.py +0 -0
  146. {qvideo-4.7.1 → qvideo-4.8.0}/lib/_qabc.py +0 -0
  147. {qvideo-4.7.1 → qvideo-4.8.0}/lib/errors.py +0 -0
  148. {qvideo-4.7.1 → qvideo-4.8.0}/lib/gentl.py +0 -0
  149. {qvideo-4.7.1 → qvideo-4.8.0}/lib/imageops.py +0 -0
  150. {qvideo-4.7.1 → qvideo-4.8.0}/lib/videotypes.py +0 -0
  151. {qvideo-4.7.1 → qvideo-4.8.0}/overlays/__init__.py +0 -0
  152. {qvideo-4.7.1 → qvideo-4.8.0}/setup.cfg +0 -0
  153. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_artistic.py +0 -0
  154. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_blob.py +0 -0
  155. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_chooser.py +0 -0
  156. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_circletransform.py +0 -0
  157. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_circularbuffer.py +0 -0
  158. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_circulardemo.py +0 -0
  159. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_circulardvrwidget.py +0 -0
  160. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_clickable.py +0 -0
  161. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_combineddemo.py +0 -0
  162. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_compositedemo.py +0 -0
  163. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_dejitter.py +0 -0
  164. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_demo.py +0 -0
  165. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_demo_recipes.py +0 -0
  166. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_docs_quickstart.py +0 -0
  167. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_dog.py +0 -0
  168. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_edge.py +0 -0
  169. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_exposure.py +0 -0
  170. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_filterdemo.py +0 -0
  171. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_filterrackdemo.py +0 -0
  172. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_filters_gray.py +0 -0
  173. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_foreground.py +0 -0
  174. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_gamma.py +0 -0
  175. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_gentl.py +0 -0
  176. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_histogramdemo.py +0 -0
  177. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_histogramwidget.py +0 -0
  178. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_imageops.py +0 -0
  179. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_invert.py +0 -0
  180. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_jupyter.py +0 -0
  181. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_laplacian.py +0 -0
  182. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_launch.py +0 -0
  183. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_mainwindow.py +0 -0
  184. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_median.py +0 -0
  185. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_momean.py +0 -0
  186. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_momedian.py +0 -0
  187. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_normalize.py +0 -0
  188. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_overlays_package.py +0 -0
  189. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qabc.py +0 -0
  190. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qbaslercamera.py +0 -0
  191. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qcamcorder.py +0 -0
  192. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qcameratree.py +0 -0
  193. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qfilterpipeline.py +0 -0
  194. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qfilterrack.py +0 -0
  195. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qflircamera.py +0 -0
  196. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qframerelay.py +0 -0
  197. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qgenicamtree.py +0 -0
  198. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qidscamera.py +0 -0
  199. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qlistcameras.py +0 -0
  200. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qlistcvcameras.py +0 -0
  201. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qlistflircameras.py +0 -0
  202. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qmvcamera.py +0 -0
  203. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qnoisetree.py +0 -0
  204. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qopencvdevices.py +0 -0
  205. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qopencvreader.py +0 -0
  206. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qopencvtree.py +0 -0
  207. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qpicameratree.py +0 -0
  208. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qsnapshot.py +0 -0
  209. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qt_binding.py +0 -0
  210. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_qvimbaxcamera.py +0 -0
  211. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_resolutions.py +0 -0
  212. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_rgb.py +0 -0
  213. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_roi.py +0 -0
  214. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_smoothing.py +0 -0
  215. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_sobel.py +0 -0
  216. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_threshold.py +0 -0
  217. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_trackpydemo.py +0 -0
  218. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_uniformitydemo.py +0 -0
  219. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_uniformitywidget.py +0 -0
  220. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_unsharp.py +0 -0
  221. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_vendor_trees.py +0 -0
  222. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_videofilter.py +0 -0
  223. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_videotypes.py +0 -0
  224. {qvideo-4.7.1 → qvideo-4.8.0}/tests/test_yolodemo.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QVideo
3
- Version: 4.7.1
3
+ Version: 4.8.0
4
4
  Summary: PyQt-based framework for integrating video cameras into research applications
5
5
  Author-email: "David G. Grier" <david.grier@nyu.edu>
6
6
  License: GPL-3.0-or-later
@@ -36,8 +36,13 @@ Provides-Extra: pyside6
36
36
  Requires-Dist: PySide6>=6.7; extra == "pyside6"
37
37
  Provides-Extra: jupyter
38
38
  Requires-Dist: ipywidgets; extra == "jupyter"
39
+ Provides-Extra: opencv
40
+ Requires-Dist: cv2-enumerate-cameras; extra == "opencv"
39
41
  Provides-Extra: dvr
40
42
  Requires-Dist: h5py; extra == "dvr"
43
+ Requires-Dist: hdf5plugin; extra == "dvr"
44
+ Provides-Extra: av
45
+ Requires-Dist: av; extra == "av"
41
46
  Provides-Extra: circletransform
42
47
  Requires-Dist: scipy; extra == "circletransform"
43
48
  Provides-Extra: trackpy
@@ -54,7 +59,7 @@ Requires-Dist: genicam; extra == "genicam"
54
59
  Provides-Extra: picamera
55
60
  Requires-Dist: picamera2; extra == "picamera"
56
61
  Provides-Extra: test
57
- Requires-Dist: QVideo[circletransform,dvr,jupyter,trackpy]; extra == "test"
62
+ Requires-Dist: QVideo[av,circletransform,dvr,jupyter,trackpy]; extra == "test"
58
63
  Requires-Dist: pytest; extra == "test"
59
64
  Requires-Dist: pytest-cov; extra == "test"
60
65
  Provides-Extra: dev-pyqt5
@@ -135,8 +140,10 @@ pip install "QVideo[pyqt5]" # PyQt5
135
140
  pip install QVideo # use a binding that is already installed
136
141
  ```
137
142
 
138
- PySide6 is experimental (`pip install "QVideo[pyside6]"`): it runs in
139
- continuous integration, but not all of QVideo's tests have been adapted to it.
143
+ PySide6 is experimental (`pip install "QVideo[pyside6]"`): the whole test
144
+ suite passes under it in continuous integration, but the interpreter
145
+ occasionally crashes while pyqtgraph builds a plot, so it is not yet
146
+ recommended.
140
147
 
141
148
  ### Raspberry Pi
142
149
 
@@ -159,6 +166,9 @@ Replace `python3-pyqt6` with `python3-pyqt5` if you prefer PyQt5.
159
166
  |---------|-------|-------|
160
167
  | GenICam cameras (Vimba, etc.) | `pip install QVideo[genicam]` | Requires a vendor-supplied `.cti` producer file |
161
168
  | Raspberry Pi camera | `pip install QVideo[picamera]` | Requires `picamera2` |
169
+ | Camera names for USB cameras | `pip install QVideo[opencv]` | Uses `cv2-enumerate-cameras`; without it the cameras are listed as "Camera 0" and so on |
170
+ | HDF5 recording (compressed without loss) | `pip install QVideo[dvr]` | Requires `h5py` and `hdf5plugin` |
171
+ | Faster lossless AVI/MKV, 16-bit gray | `pip install QVideo[av]` | Uses PyAV instead of OpenCV when installed |
162
172
 
163
173
  ## Quick start
164
174
 
@@ -203,6 +213,7 @@ Verified on real hardware (the unit tests mock all hardware):
203
213
  |---------|-------|--------|-----------------|---------|
204
214
  | OpenCV | 14 – 26 | 24.04 | tested | not tested |
205
215
  | FLIR (GenICam) | 14 – 26 | 24.04 | — | not tested |
216
+ | Raspberry Pi camera | — | — | tested (Pi 5) | — |
206
217
 
207
218
  On macOS 26.7.1 (Tahoe), the OpenCV backend was tested with OpenCV
208
219
  5.0.0_11 and the FLIR backend with Spinnaker SDK 4.4.0.246. Other combinations are expected to work but have not been
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QVideo
3
- Version: 4.7.1
3
+ Version: 4.8.0
4
4
  Summary: PyQt-based framework for integrating video cameras into research applications
5
5
  Author-email: "David G. Grier" <david.grier@nyu.edu>
6
6
  License: GPL-3.0-or-later
@@ -36,8 +36,13 @@ Provides-Extra: pyside6
36
36
  Requires-Dist: PySide6>=6.7; extra == "pyside6"
37
37
  Provides-Extra: jupyter
38
38
  Requires-Dist: ipywidgets; extra == "jupyter"
39
+ Provides-Extra: opencv
40
+ Requires-Dist: cv2-enumerate-cameras; extra == "opencv"
39
41
  Provides-Extra: dvr
40
42
  Requires-Dist: h5py; extra == "dvr"
43
+ Requires-Dist: hdf5plugin; extra == "dvr"
44
+ Provides-Extra: av
45
+ Requires-Dist: av; extra == "av"
41
46
  Provides-Extra: circletransform
42
47
  Requires-Dist: scipy; extra == "circletransform"
43
48
  Provides-Extra: trackpy
@@ -54,7 +59,7 @@ Requires-Dist: genicam; extra == "genicam"
54
59
  Provides-Extra: picamera
55
60
  Requires-Dist: picamera2; extra == "picamera"
56
61
  Provides-Extra: test
57
- Requires-Dist: QVideo[circletransform,dvr,jupyter,trackpy]; extra == "test"
62
+ Requires-Dist: QVideo[av,circletransform,dvr,jupyter,trackpy]; extra == "test"
58
63
  Requires-Dist: pytest; extra == "test"
59
64
  Requires-Dist: pytest-cov; extra == "test"
60
65
  Provides-Extra: dev-pyqt5
@@ -135,8 +140,10 @@ pip install "QVideo[pyqt5]" # PyQt5
135
140
  pip install QVideo # use a binding that is already installed
136
141
  ```
137
142
 
138
- PySide6 is experimental (`pip install "QVideo[pyside6]"`): it runs in
139
- continuous integration, but not all of QVideo's tests have been adapted to it.
143
+ PySide6 is experimental (`pip install "QVideo[pyside6]"`): the whole test
144
+ suite passes under it in continuous integration, but the interpreter
145
+ occasionally crashes while pyqtgraph builds a plot, so it is not yet
146
+ recommended.
140
147
 
141
148
  ### Raspberry Pi
142
149
 
@@ -159,6 +166,9 @@ Replace `python3-pyqt6` with `python3-pyqt5` if you prefer PyQt5.
159
166
  |---------|-------|-------|
160
167
  | GenICam cameras (Vimba, etc.) | `pip install QVideo[genicam]` | Requires a vendor-supplied `.cti` producer file |
161
168
  | Raspberry Pi camera | `pip install QVideo[picamera]` | Requires `picamera2` |
169
+ | Camera names for USB cameras | `pip install QVideo[opencv]` | Uses `cv2-enumerate-cameras`; without it the cameras are listed as "Camera 0" and so on |
170
+ | HDF5 recording (compressed without loss) | `pip install QVideo[dvr]` | Requires `h5py` and `hdf5plugin` |
171
+ | Faster lossless AVI/MKV, 16-bit gray | `pip install QVideo[av]` | Uses PyAV instead of OpenCV when installed |
162
172
 
163
173
  ## Quick start
164
174
 
@@ -203,6 +213,7 @@ Verified on real hardware (the unit tests mock all hardware):
203
213
  |---------|-------|--------|-----------------|---------|
204
214
  | OpenCV | 14 – 26 | 24.04 | tested | not tested |
205
215
  | FLIR (GenICam) | 14 – 26 | 24.04 | — | not tested |
216
+ | Raspberry Pi camera | — | — | tested (Pi 5) | — |
206
217
 
207
218
  On macOS 26.7.1 (Tahoe), the OpenCV backend was tested with OpenCV
208
219
  5.0.0_11 and the FLIR backend with Spinnaker SDK 4.4.0.246. Other combinations are expected to work but have not been
@@ -63,8 +63,10 @@ dvr/QHDF5Reader.py
63
63
  dvr/QHDF5Writer.py
64
64
  dvr/QOpenCVReader.py
65
65
  dvr/QOpenCVWriter.py
66
+ dvr/QPyAVReader.py
67
+ dvr/QPyAVWriter.py
66
68
  dvr/__init__.py
67
- dvr/icons_rc.py
69
+ dvr/icons/record.svg
68
70
  filters/_MedianBase.py
69
71
  filters/__init__.py
70
72
  filters/artistic.py
@@ -149,7 +151,6 @@ tests/test_gamma.py
149
151
  tests/test_gentl.py
150
152
  tests/test_histogramdemo.py
151
153
  tests/test_histogramwidget.py
152
- tests/test_icons_rc.py
153
154
  tests/test_imageops.py
154
155
  tests/test_invert.py
155
156
  tests/test_jupyter.py
@@ -191,6 +192,8 @@ tests/test_qopencvtree.py
191
192
  tests/test_qopencvwriter.py
192
193
  tests/test_qpicamera.py
193
194
  tests/test_qpicameratree.py
195
+ tests/test_qpyavreader.py
196
+ tests/test_qpyavwriter.py
194
197
  tests/test_qsnapshot.py
195
198
  tests/test_qt_binding.py
196
199
  tests/test_qvideoreader.py
@@ -205,6 +208,7 @@ tests/test_roidemo.py
205
208
  tests/test_samplehold.py
206
209
  tests/test_smoothing.py
207
210
  tests/test_sobel.py
211
+ tests/test_teardown.py
208
212
  tests/test_threshold.py
209
213
  tests/test_trackpy_overlay.py
210
214
  tests/test_trackpydemo.py
@@ -4,6 +4,9 @@ qtpy
4
4
  pyqtgraph
5
5
  psutil
6
6
 
7
+ [av]
8
+ av
9
+
7
10
  [circletransform]
8
11
  scipy
9
12
 
@@ -33,6 +36,7 @@ PyQt5
33
36
 
34
37
  [dvr]
35
38
  h5py
39
+ hdf5plugin
36
40
 
37
41
  [genicam]
38
42
  harvesters
@@ -41,6 +45,9 @@ genicam
41
45
  [jupyter]
42
46
  ipywidgets
43
47
 
48
+ [opencv]
49
+ cv2-enumerate-cameras
50
+
44
51
  [overlays]
45
52
  QVideo[trackpy,yolo]
46
53
 
@@ -58,7 +65,7 @@ PyQt6
58
65
  PySide6>=6.7
59
66
 
60
67
  [test]
61
- QVideo[circletransform,dvr,jupyter,trackpy]
68
+ QVideo[av,circletransform,dvr,jupyter,trackpy]
62
69
  pytest
63
70
  pytest-cov
64
71
 
@@ -55,8 +55,10 @@ pip install "QVideo[pyqt5]" # PyQt5
55
55
  pip install QVideo # use a binding that is already installed
56
56
  ```
57
57
 
58
- PySide6 is experimental (`pip install "QVideo[pyside6]"`): it runs in
59
- continuous integration, but not all of QVideo's tests have been adapted to it.
58
+ PySide6 is experimental (`pip install "QVideo[pyside6]"`): the whole test
59
+ suite passes under it in continuous integration, but the interpreter
60
+ occasionally crashes while pyqtgraph builds a plot, so it is not yet
61
+ recommended.
60
62
 
61
63
  ### Raspberry Pi
62
64
 
@@ -79,6 +81,9 @@ Replace `python3-pyqt6` with `python3-pyqt5` if you prefer PyQt5.
79
81
  |---------|-------|-------|
80
82
  | GenICam cameras (Vimba, etc.) | `pip install QVideo[genicam]` | Requires a vendor-supplied `.cti` producer file |
81
83
  | Raspberry Pi camera | `pip install QVideo[picamera]` | Requires `picamera2` |
84
+ | Camera names for USB cameras | `pip install QVideo[opencv]` | Uses `cv2-enumerate-cameras`; without it the cameras are listed as "Camera 0" and so on |
85
+ | HDF5 recording (compressed without loss) | `pip install QVideo[dvr]` | Requires `h5py` and `hdf5plugin` |
86
+ | Faster lossless AVI/MKV, 16-bit gray | `pip install QVideo[av]` | Uses PyAV instead of OpenCV when installed |
82
87
 
83
88
  ## Quick start
84
89
 
@@ -123,6 +128,7 @@ Verified on real hardware (the unit tests mock all hardware):
123
128
  |---------|-------|--------|-----------------|---------|
124
129
  | OpenCV | 14 – 26 | 24.04 | tested | not tested |
125
130
  | FLIR (GenICam) | 14 – 26 | 24.04 | — | not tested |
131
+ | Raspberry Pi camera | — | — | tested (Pi 5) | — |
126
132
 
127
133
  On macOS 26.7.1 (Tahoe), the OpenCV backend was tested with OpenCV
128
134
  5.0.0_11 and the FLIR backend with Spinnaker SDK 4.4.0.246. Other combinations are expected to work but have not been
@@ -10,7 +10,7 @@ from QVideo.lib._camera import Camera
10
10
 
11
11
  try:
12
12
  __version__ = version('QVideo')
13
- except PackageNotFoundError: # package not installed (e.g. bare source checkout)
13
+ except PackageNotFoundError: # not installed (e.g. bare source checkout)
14
14
  __version__ = 'unknown'
15
15
 
16
16
  __all__ = ['Camera', '__version__']
@@ -34,7 +34,8 @@ class QFlirCamera(QGenicamCamera):
34
34
  _producer_filenames = ('Spinnaker_GenTL.cti',)
35
35
  _producerHint = ('Install the Spinnaker SDK and set GENICAM_GENTL64_PATH '
36
36
  'to the directory containing Spinnaker_GenTL.cti '
37
- '(on Linux, typically /opt/spinnaker/lib/spinnaker-gentl).')
37
+ '(on Linux, typically '
38
+ '/opt/spinnaker/lib/spinnaker-gentl).')
38
39
 
39
40
 
40
41
  class QFlirSource(QGenicamSource):
@@ -1,4 +1,6 @@
1
+ '''GenICam cameras and sources, driven through Harvesters.'''
1
2
  from collections.abc import Callable
3
+ from contextlib import suppress
2
4
  from typing import TYPE_CHECKING
3
5
  from QVideo.lib import QCamera, QVideoSource
4
6
  from QVideo.lib import gentl
@@ -70,7 +72,13 @@ class QGenicamCamera(QCamera):
70
72
  producer: str | Path | None = None
71
73
  _producer_filenames: tuple[str, ...] = ()
72
74
  _producerHint: str = ''
73
- _ALIASES = frozenset(('width', 'height', 'fps'))
75
+ #: SFNC nodes behind the lowercase names that every camera shares, in
76
+ #: order of preference.
77
+ _ALIAS_NODES = {'width': ('Width',),
78
+ 'height': ('Height',),
79
+ 'fps': ('AcquisitionFrameRate',
80
+ 'AcquisitionFrameRateAbs')}
81
+ _ALIASES = frozenset(_ALIAS_NODES)
74
82
 
75
83
  #: Nodes that report the frame rate that the camera delivers, in order
76
84
  #: of preference: the standard name, then names of older firmware.
@@ -95,7 +103,18 @@ class QGenicamCamera(QCamera):
95
103
  bool
96
104
  ``True`` if a valid camera device was opened successfully.
97
105
  '''
98
- producer = self._locateProducer()
106
+ self._openDevice(self._locateProducer())
107
+ self._connectNodeMap()
108
+ root = self.node()
109
+ self._protected = self._startAcquisition(root)
110
+ self._register_features(root)
111
+ with suppress(Exception):
112
+ self._modelName = str(self._nodeMap.DeviceModelName.value)
113
+ self._registerAliases()
114
+ return True
115
+
116
+ def _openDevice(self, producer: str) -> None:
117
+ '''Load the GenTL *producer* and open the camera that it finds.'''
99
118
  self._harvester = Harvester()
100
119
  self._device = None
101
120
  try:
@@ -117,33 +136,40 @@ class QGenicamCamera(QCamera):
117
136
  f'): {ex}\n'
118
137
  'Check that the camera is connected and powered, and that '
119
138
  'you have permission to access it.') from ex
139
+
140
+ def _connectNodeMap(self) -> None:
141
+ '''Take the node map from the device, loading it by hand if
142
+ harvesters did not connect it.'''
120
143
  self._nodeMap = self._device.remote_device.node_map
121
- if not self._isConnected(self._nodeMap):
122
- logger.warning('harvesters node map unconnected; '
123
- 'loading manually from device port')
124
- self._nodeMap = self._load_node_map(self._device)
125
- if self._nodeMap is None:
126
- self._cleanup()
127
- raise QDeviceError(
128
- f'{type(self).__name__}: cannot read the GenICam '
129
- 'node map from the camera')
130
- root = self.node()
131
- ma = self._scan_modes(root)
144
+ if self._isConnected(self._nodeMap):
145
+ return
146
+ logger.debug('harvesters node map unconnected; '
147
+ 'loading manually from device port')
148
+ self._nodeMap = self._load_node_map(self._device)
149
+ if self._nodeMap is None:
150
+ self._cleanup()
151
+ raise QDeviceError(
152
+ f'{type(self).__name__}: cannot read the GenICam '
153
+ 'node map from the camera')
154
+
155
+ def _startAcquisition(self, root: IValue) -> set[str]:
156
+ '''Start acquisition and return the features that it makes read-only.
157
+
158
+ These are the features whose access mode differs before and after
159
+ the start, so that writing them requires stopping acquisition.
160
+ '''
161
+ before = self._scan_modes(root)
132
162
  self._device.start()
133
- mb = self._scan_modes(root)
134
- self._protected = {k for k, v in ma.items()
135
- if k in mb and mb[k] != v}
136
- self._register_features(root)
137
- try:
138
- self._modelName = str(self._nodeMap.DeviceModelName.value)
139
- except Exception:
140
- pass
141
- for src, dst in (('Width', 'width'), ('Height', 'height'),
142
- ('AcquisitionFrameRate', 'fps'),
143
- ('AcquisitionFrameRateAbs', 'fps')):
144
- if src in self._properties and dst not in self._properties:
145
- self._properties[dst] = self._properties[src]
146
- return True
163
+ after = self._scan_modes(root)
164
+ return {name for name, mode in before.items()
165
+ if name in after and after[name] != mode}
166
+
167
+ def _registerAliases(self) -> None:
168
+ '''Register the lowercase names for the standard nodes that exist.'''
169
+ for alias, nodes in self._ALIAS_NODES.items():
170
+ for node in nodes:
171
+ if node in self._properties and alias not in self._properties:
172
+ self._properties[alias] = self._properties[node]
147
173
 
148
174
  @classmethod
149
175
  def _locateProducer(cls) -> str:
@@ -182,20 +208,14 @@ class QGenicamCamera(QCamera):
182
208
  original exception.
183
209
  '''
184
210
  if self._device is not None:
185
- try:
211
+ with suppress(Exception):
186
212
  self._device.stop()
187
- except Exception:
188
- pass
189
- try:
213
+ with suppress(Exception):
190
214
  self._device.destroy()
191
- except Exception:
192
- pass
193
215
  self._device = None
194
216
  if self._harvester is not None:
195
- try:
217
+ with suppress(Exception):
196
218
  self._harvester.reset()
197
- except Exception:
198
- pass
199
219
  self._nodeMap = None
200
220
 
201
221
  def _deinitialize(self) -> None:
@@ -543,22 +563,17 @@ class QGenicamCamera(QCamera):
543
563
  '''
544
564
  node = self.node(name)
545
565
  with self._mutex:
546
- access = node.node.get_access_mode()
547
- state = {'access': access, 'kind': 'other'}
548
- if isinstance(node, IInteger):
549
- state.update(kind='int', min=node.min, max=node.max,
550
- inc=node.inc)
551
- elif isinstance(node, IFloat):
552
- state.update(kind='float', min=node.min, max=node.max,
553
- inc=node.inc if node.has_inc() else None)
554
- elif isinstance(node, IEnumeration):
555
- state.update(kind='enum',
556
- entries=[v.symbolic for v in node.entries])
557
- if access in (EAccessMode.RO, EAccessMode.RW):
558
- if isinstance(node, IEnumeration):
559
- state['value'] = node.to_string()
560
- elif isinstance(node, IProperty):
561
- state['value'] = node.value
566
+ state = {'access': node.node.get_access_mode(), 'kind': 'other'}
567
+ ptype, meta = self._feature_spec(node)
568
+ if 'limits' in meta:
569
+ state.update(kind='enum', entries=meta['limits'])
570
+ elif ptype in (int, float):
571
+ state.update(kind=ptype.__name__, min=meta['minimum'],
572
+ max=meta['maximum'], inc=meta.get('step'))
573
+ if isinstance(node, IProperty):
574
+ value = self._make_getter(node)()
575
+ if value is not None:
576
+ state['value'] = value
562
577
  return state
563
578
 
564
579
 
@@ -31,4 +31,5 @@ from ._imx500 import QIMXCamera, QIMXSource
31
31
  from ._tree import QPicameraTree
32
32
 
33
33
 
34
- __all__ = 'QPicamera QPicameraSource QIMXCamera QIMXSource QPicameraTree'.split()
34
+ __all__ = ('QPicamera QPicameraSource QIMXCamera QIMXSource '
35
+ 'QPicameraTree').split()
@@ -1,3 +1,4 @@
1
+ from contextlib import suppress
1
2
  from typing import TYPE_CHECKING
2
3
  from QVideo.lib import QCamera, QVideoSource
3
4
  import logging
@@ -124,7 +125,7 @@ class QPicamera(QCamera):
124
125
  return Picamera2(camera_num=self._cameraID)
125
126
 
126
127
  def _onRequest(self, metadata: dict) -> None:
127
- '''Hook called with each frame\'s metadata before the request is released.
128
+ '''Hook called with a frame's metadata before its request ends.
128
129
 
129
130
  Subclasses can override this to extract additional per-frame data
130
131
  (e.g. IMX500 inference outputs) while the request buffer is still
@@ -165,23 +166,16 @@ class QPicamera(QCamera):
165
166
  # _controlValues from fresh metadata, so we save them here and
166
167
  # re-apply them afterwards.
167
168
  prior_controls = dict(self._controlValues)
168
- fmt = 'YUV420' if self._gray else 'BGR888'
169
- cfg_kwargs = {
170
- 'main': {'size': (self._width, self._height), 'format': fmt}}
171
- t = self._makeTransform()
172
- if t is not None:
173
- cfg_kwargs['transform'] = t
174
- config = self._device.create_preview_configuration(**cfg_kwargs)
175
- self._device.configure(config)
176
- self._device.start()
177
- self._deviceOpen = True
178
169
  try:
170
+ self._configure((self._width, self._height))
171
+ self._device.start()
172
+ self._deviceOpen = True
179
173
  self._device.capture_array()
180
174
  except Exception as ex:
181
- logger.warning(f'Camera did not deliver a frame: {ex}')
182
- self._deviceOpen = False
183
- self._device.stop()
184
- self._device.close()
175
+ logger.warning(f'Could not start Raspberry Pi camera '
176
+ f'{self._cameraID}: {ex}')
177
+ with suppress(Exception):
178
+ self._deinitialize()
185
179
  return False
186
180
  register = self.registerProperty
187
181
  register('width', getter=self._getWidth,
@@ -208,6 +202,13 @@ class QPicamera(QCamera):
208
202
  self._controlValues.update(pending)
209
203
  return True
210
204
 
205
+ @staticmethod
206
+ def _limits(lo: float | None, hi: float | None) -> dict[str, float]:
207
+ '''The ``minimum`` and ``maximum`` that a camera reports, if any.'''
208
+ return {key: value
209
+ for key, value in (('minimum', lo), ('maximum', hi))
210
+ if value is not None}
211
+
211
212
  def _probeControls(self, metadata: dict[str, object]) -> None:
212
213
  '''Register picamera2 controls supported by this camera.
213
214
 
@@ -227,12 +228,7 @@ class QPicamera(QCamera):
227
228
  lo, hi, default = self._device.camera_controls[name]
228
229
  current = metadata.get(name, default)
229
230
  self._controlValues[name] = ptype(current)
230
- meta = {}
231
- if ptype is not bool:
232
- if lo is not None:
233
- meta['minimum'] = lo
234
- if hi is not None:
235
- meta['maximum'] = hi
231
+ meta = {} if ptype is bool else self._limits(lo, hi)
236
232
  self.registerProperty(
237
233
  name,
238
234
  getter=lambda n=name, t=ptype: t(self._controlValues[n]),
@@ -317,11 +313,7 @@ class QPicamera(QCamera):
317
313
  current = (1.0, 1.0)
318
314
  self._controlValues['ColourGains'] = (
319
315
  float(current[0]), float(current[1]))
320
- meta = {}
321
- if lo is not None:
322
- meta['minimum'] = lo
323
- if hi is not None:
324
- meta['maximum'] = hi
316
+ meta = self._limits(lo, hi)
325
317
  self.registerProperty(
326
318
  'ColourGainR',
327
319
  getter=lambda: self._controlValues['ColourGains'][0],
@@ -421,38 +413,29 @@ class QPicamera(QCamera):
421
413
  '''
422
414
  self._height = int(value)
423
415
 
424
- def _reconfigure(self,
425
- width: int | None = None,
426
- height: int | None = None) -> None:
427
- '''Reconfigure the camera stream at a new resolution.
428
-
429
- Stops acquisition, applies the new resolution, restarts, and
430
- reapplies any controls that were set before reconfiguring.
431
-
432
- Parameters
433
- ----------
434
- width : int or None
435
- New frame width in pixels. ``None`` keeps the current width.
436
- height : int or None
437
- New frame height in pixels. ``None`` keeps the current height.
416
+ def _configure(self, size: tuple[int, int]) -> None:
417
+ '''Configure the stream with *size*, the pixel format and the flips.'''
418
+ fmt = 'YUV420' if self._gray else 'BGR888'
419
+ kwargs = {'main': {'size': size, 'format': fmt}}
420
+ transform = self._makeTransform()
421
+ if transform is not None:
422
+ kwargs['transform'] = transform
423
+ self._device.configure(
424
+ self._device.create_preview_configuration(**kwargs))
425
+
426
+ def _reconfigure(self) -> None:
427
+ '''Restart the stream at its current size with the current format
428
+ and flips, and reapply the cached controls.
429
+
430
+ The size that :meth:`_setWidth` and :meth:`_setHeight` store takes
431
+ effect at the next :meth:`_initialize`, not here.
438
432
  '''
439
- w, h = self._device.camera_config['main']['size']
440
- if width is not None:
441
- w = int(width)
442
- if height is not None:
443
- h = int(height)
444
433
  self._device.stop()
445
- fmt = 'YUV420' if self._gray else 'BGR888'
446
- cfg_kwargs = {'main': {'size': (w, h), 'format': fmt}}
447
- t = self._makeTransform()
448
- if t is not None:
449
- cfg_kwargs['transform'] = t
450
- config = self._device.create_preview_configuration(**cfg_kwargs)
451
- self._device.configure(config)
434
+ self._configure(self._device.camera_config['main']['size'])
452
435
  self._device.start()
453
- # Re-apply cached controls. Note: _reconfigure does not rebuild
454
- # _properties, so if the new configuration changes available controls
455
- # or their ranges the stale registrations will persist silently.
436
+ # _reconfigure does not rebuild _properties, so if the new
437
+ # configuration changes the available controls or their ranges the
438
+ # stale registrations persist silently.
456
439
  if self._controlValues:
457
440
  self._device.set_controls(self._controlValues)
458
441