diff options
| author | morefigs <morefigs@gmail.com> | 2019-01-30 11:39:52 +1100 |
|---|---|---|
| committer | morefigs <morefigs@gmail.com> | 2019-01-30 11:39:52 +1100 |
| commit | 1c5ebb2ddd0f7b84e536a9acf3d534aaab12de06 (patch) | |
| tree | 2017063f55c05e8eac346b54870cc9f62fd22b08 | |
| parent | 2d86dcf99782bc4aa2dc769bde87ef50769b9482 (diff) | |
| download | pymba-1c5ebb2ddd0f7b84e536a9acf3d534aaab12de06.tar.gz pymba-1c5ebb2ddd0f7b84e536a9acf3d534aaab12de06.zip | |
added pixel format to byte mapping
| -rw-r--r-- | pymba/camera.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pymba/camera.py b/pymba/camera.py index e15ba6d..322762a 100644 --- a/pymba/camera.py +++ b/pymba/camera.py @@ -7,6 +7,33 @@ from .frame import Frame from . import vimba_c +# todo update this to be more like VmbPixelFormatType in VmbCommonTypes.h +# Map pixel formats to bytes per pixel +PIXEL_FORMAT_BYTES = { + "Mono8": 1, + "Mono12": 2, + # todo untested + "Mono12Packed": 1.5, + "Mono14": 2, + "Mono16": 2, + "RGB8": 3, + "RGB8Packed": 3, + "BGR8Packed": 3, + "RGBA8Packed": 4, + "BGRA8Packed": 4, + # todo untested + "YUV411Packed": 4 / 3.0, + "YUV422Packed": 2, + "YUV444Packed": 3, + "BayerRG8": 1, + "BayerRG12": 2, + "BayerGR8": 1, + "BayerGR12": 2, + # todo untested + "BayerGR12Packed": 1.5, +} + + def _camera_infos() -> List[vimba_c.VmbCameraInfo]: """ Gets camera info of all attached cameras. |
