Lines Matching refs:cap
49 def convert_capture_to_rgb_image(cap, argument
65 w = cap["width"]
66 h = cap["height"]
67 if cap["format"] == "raw10":
69 cap = unpack_raw10_capture(cap, props)
70 if cap["format"] == "raw12":
72 cap = unpack_raw12_capture(cap, props)
73 if cap["format"] == "yuv":
74 y = cap["data"][0:w*h]
75 u = cap["data"][w*h:w*h*5/4]
76 v = cap["data"][w*h*5/4:w*h*6/4]
78 elif cap["format"] == "jpeg":
79 return decompress_jpeg_to_rgb_image(cap["data"])
80 elif cap["format"] == "raw" or cap["format"] == "rawStats":
82 r,gr,gb,b = convert_capture_to_planes(cap, props)
83 return convert_raw_to_rgb_image(r,gr,gb,b, props, cap["metadata"])
84 elif cap["format"] == "y8":
85 y = cap["data"][0:w*h]
88 raise its.error.Error('Invalid format %s' % (cap["format"]))
91 def unpack_rawstats_capture(cap): argument
101 assert(cap["format"] == "rawStats")
102 w = cap["width"]
103 h = cap["height"]
104 img = numpy.ndarray(shape=(2*h*w*4,), dtype='<f', buffer=cap["data"])
111 def unpack_raw10_capture(cap, props): argument
123 w,h = cap["width"], cap["height"]
126 cap = copy.deepcopy(cap)
127 cap["data"] = unpack_raw10_image(cap["data"].reshape(h,w*5/4))
128 cap["format"] = "raw"
129 return cap
165 def unpack_raw12_capture(cap, props): argument
177 w,h = cap["width"], cap["height"]
180 cap = copy.deepcopy(cap)
181 cap["data"] = unpack_raw12_image(cap["data"].reshape(h,w*3/2))
182 cap["format"] = "raw"
183 return cap
219 def convert_capture_to_planes(cap, props=None): argument
246 w = cap["width"]
247 h = cap["height"]
248 if cap["format"] == "raw10":
250 cap = unpack_raw10_capture(cap, props)
251 if cap["format"] == "raw12":
253 cap = unpack_raw12_capture(cap, props)
254 if cap["format"] == "yuv":
255 y = cap["data"][0:w*h]
256 u = cap["data"][w*h:w*h*5/4]
257 v = cap["data"][w*h*5/4:w*h*6/4]
261 elif cap["format"] == "jpeg":
262 rgb = decompress_jpeg_to_rgb_image(cap["data"]).reshape(w*h*3)
266 elif cap["format"] == "raw":
270 buffer=cap["data"][0:w*h*2])
308 elif cap["format"] == "rawStats":
311 mean_image, var_image = its.image.unpack_rawstats_capture(cap)
315 raise its.error.Error('Invalid format %s' % (cap["format"]))
880 cap = cam.do_capture(reqs, fmt)
881 done = (cap[NUM_FRAMES-1]['metadata']['android.lens.state'] == 0)
886 return cap[NUM_FRAMES-1]