aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pymba/vimbaframe.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/pymba/vimbaframe.py b/pymba/vimbaframe.py
index 9e92285..964917b 100644
--- a/pymba/vimbaframe.py
+++ b/pymba/vimbaframe.py
@@ -5,14 +5,23 @@ from vimbadll import VimbaDLL
from vimbadll import VimbaC_MemoryBlock
from ctypes import *
-#map pixel formats to bytes per pixel. TODO: packed mono formats?
+#map pixel formats to bytes per pixel.
PIXEL_FORMATS = {
"Mono8": 1,
"Mono12": 2,
+ "Mono12Packed": 1.5,
"Mono14": 2,
"Mono16": 2,
"RGB8Packed": 3,
"BGR8Packed": 3,
+ "RGBA8Packed": 4,
+ "BGRA8Packed": 4,
+ "YUV411Packed": 4/3.0,
+ "YUV422Packed": 2,
+ "YUV444Packed": 3,
+ "BayerRG8": 1,
+ "BayerRG12": 2,
+ "BayerGR12Packed": 1.5,
}
@@ -117,7 +126,8 @@ class VimbaFrame(object):
POINTER(c_ubyte * self.payloadSize))
# make array of c_ubytes from buffer
- array = (c_ubyte * (self.height*self.pixel_bytes) *
- (self.width*self.pixel_bytes)).from_address(addressof(data.contents))
+ array = (c_ubyte * int(self.height*self.pixel_bytes) *
+ int(self.width*self.pixel_bytes)).from_address(addressof(
+ data.contents))
return array