Example #1
0
 def asQPixmap(self):
     '''Returns a qpixmap for this frame'''
     if self._rgbdata is not None:
         height, width = self._rgbdata.shape[:2]
         qimg = QtGui.QImage(self._rgbdata, width, height,
                             QtGui.QImage.Format_RGB888)
     else:
         qimg = QtGui.QImage(320, 240, QtGui.QImage.Format_RGB888)
     return QtGui.QPixmap.fromImage(qimg)
Example #2
0
 def convertFrame(self):
     try:
         height, width = self.currentFrame.shape[:2]
         #             print "%s, %s" %(width, height)
         img = QtGui.QImage(self.currentFrame, width, height,
                            QtGui.QImage.Format_RGB888)
         img = QtGui.QPixmap.fromImage(img)
         self.previousFrame = self.currentFrame
         return img
     except:
         return None
Example #3
0
 def convertFrame(self):
     """
     converts frame to format suitable for QtGui
     """
     try:
         height,width=self.currentFrame.shape[:2]
         img=QtGui.QImage(self.currentFrame,
                           width,
                           height,
                           QtGui.QImage.Format_RGB888)
         img=QtGui.QPixmap.fromImage(img)
         self.previousFrame = self.currentFrame
         return img
     except:
         return None
Example #4
0
 def asQImage(self):
     '''Returns a qimage version of this frame'''
     height, width = self._rgbdata.shape[:2]
     return QtGui.QImage(self._rgbdata, width, height,
                         QtGui.QImage.Format_RGB888)
Example #5
0
 def asQImage(self):
     '''Returns a qimage version of this frame'''
     if self._qimage is None:
         self._qimage = QtGui.QImage(self._filename)
     return self._qimage