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)
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
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
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)
def asQImage(self): '''Returns a qimage version of this frame''' if self._qimage is None: self._qimage = QtGui.QImage(self._filename) return self._qimage