/usr/lib/python2.7/dist-packages/pymecavideo/toQimage.py is in python-mecavideo 6.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from PyQt4.QtGui import QImage, qRgb
import numpy as np
class NotImplementedException:
pass
def toQImage(im, copy=False):
"""transforme une image ope,cv (numpy array) en une QImage"""
if im is None:
return QImage()
if im.dtype == np.uint8:
if len(im.shape) == 3:
if im.shape[2] == 3:
qim = QImage(im.data, im.shape[1], im.shape[0], QImage.Format_RGB888);
return qim.copy() if copy else qim
raise NotImplementedException
|