예제 #1
0
    def __init__(self, width, height):
        super().__init__()

        buffer_format = QOpenGLFramebufferObjectFormat()
        buffer_format.setAttachment(QOpenGLFramebufferObject.Depth)
        self._fbo = QOpenGLFramebufferObject(width, height, buffer_format)

        self._contents = None
예제 #2
0
    def __init__(self, width, height):
        super().__init__()

        buffer_format = QOpenGLFramebufferObjectFormat()
        buffer_format.setAttachment(QOpenGLFramebufferObject.Depth)
        self._fbo = QOpenGLFramebufferObject(width, height, buffer_format)

        self._contents = None
예제 #3
0
    def createFramebufferObject(self, size):
        format = QOpenGLFramebufferObjectFormat()
        format.setAttachment(QOpenGLFramebufferObject.CombinedDepthStencil)
        format.setSamples(4)

        self._qfbo = QOpenGLFramebufferObject(size, format)
        return self._qfbo
예제 #4
0
 def get_frame_cv(self, width, height):
     fmt = QOpenGLFramebufferObjectFormat()
     fmt.setSamples(self.fmt.samples())
     fbo = QOpenGLFramebufferObject(width, height)
     fbo.setAttachment(fbo.Depth)
     fbo.bind()
     GL.glFinish()
     # resize framebuffer to desired resolution
     self.resizeGL(width, height)
     # draw the scene
     self.update_scene()
     self.glDraw()
     GL.glFinish()
     # read the raw image data
     img = GL.glReadPixels(0, 0, width, height, GL.GL_RGB,
                           GL.GL_UNSIGNED_BYTE)
     # convert raw image data to cv2 format
     img = np.reshape(np.frombuffer(img, np.ubyte), (height, width, 3))
     img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
     img = cv2.flip(img, 0)
     fbo.release()
     return img
예제 #5
0
 def createFramebufferObject(self, size):
     #print("\n\nLogoInFboRenderer.createFramebufferObject", size)#, QApplication.instance()
     format = QOpenGLFramebufferObjectFormat()
     format.setAttachment(QOpenGLFramebufferObject.CombinedDepthStencil)
     format.setSamples(4)
     self.frmBuffer = QOpenGLFramebufferObject(size, format)
     #print("hola3", self.frmBuffer)
     return self.frmBuffer
예제 #6
0
 def createFrameBuffer(self, width, height):
     buffer_format = QOpenGLFramebufferObjectFormat()
     buffer_format.setAttachment(QOpenGLFramebufferObject.Depth)
     return QOpenGLFramebufferObject(width, height, buffer_format)
예제 #7
0
 def createFrameBuffer(self, width, height):
     buffer_format = QOpenGLFramebufferObjectFormat()
     buffer_format.setAttachment(QOpenGLFramebufferObject.Depth)
     return QOpenGLFramebufferObject(width, height, buffer_format)
예제 #8
0
 def createFrameBufferObject(self, size):
     f = QOpenGLFramebufferObjectFormat()
     f.setAttachment(QOpenGLFramebufferObject.CombinedDepthStencil)
     f.setSamples(4)
     return QOpenGLFramebufferObject(size, f)