コード例 #1
0
ファイル: MiniImage.py プロジェクト: rll/labeling_tool
    def renderImageTask(self, task):
        timeElapsed = task.time - self.timeOld
        if timeElapsed < Settings.RRENDER_INTERVAL:
            return task.cont
        self.timeOld = task.time

        if (self.pnmimage is None) or (Settings.RRENDER_K is None) or (Settings.RRENDER_DISTORT is None):
            return task.done
        if not self.visible:
            return task.done

        imgcopy = PNMImage()
        imgcopy.copyFrom(self.pnmimage)
        # Rerender.rerenderNoWrite( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, self.camParams)
        Rerender.rerenderNoWriteNoH5(
            self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, Settings.RRENDER_K, Settings.RRENDER_DISTORT
        )
        self.tex.load(imgcopy)
        return task.cont
コード例 #2
0
    def toggleVisibility(self):
        if (self.visible):
            self.visible = False
            self.imageNode.stash()

        else:
            self.visible = True
            self.imageNode.unstash()
            self.timeOld = 0

            imgcopy = PNMImage()
            imgcopy.copyFrom(self.pnmimage)
            #Rerender.rerenderNoWrite( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, self.camParams)
            Rerender.rerenderNoWriteNoH5(self.app.selectedObject,
                                         self.app.pointcloud.TruPos, imgcopy,
                                         Settings.RRENDER_K,
                                         Settings.RRENDER_DISTORT)
            self.tex.load(imgcopy)

            taskMgr.add(self.renderImageTask, 'renderImageTask')
コード例 #3
0
    def renderImageTask(self, task):
        timeElapsed = task.time - self.timeOld
        if timeElapsed < Settings.RRENDER_INTERVAL:
            return task.cont
        self.timeOld = task.time

        if (self.pnmimage is None) or (Settings.RRENDER_K is None) or (
                Settings.RRENDER_DISTORT is None):
            return task.done
        if (not self.visible):
            return task.done

        imgcopy = PNMImage()
        imgcopy.copyFrom(self.pnmimage)
        #Rerender.rerenderNoWrite( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, self.camParams)
        Rerender.rerenderNoWriteNoH5(self.app.selectedObject,
                                     self.app.pointcloud.TruPos, imgcopy,
                                     Settings.RRENDER_K,
                                     Settings.RRENDER_DISTORT)
        self.tex.load(imgcopy)
        return task.cont
コード例 #4
0
ファイル: MiniImage.py プロジェクト: rll/labeling_tool
    def toggleVisibility(self):
        if self.visible:
            self.visible = False
            self.imageNode.stash()

        else:
            self.visible = True
            self.imageNode.unstash()
            self.timeOld = 0

            imgcopy = PNMImage()
            imgcopy.copyFrom(self.pnmimage)
            # Rerender.rerenderNoWrite( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, self.camParams)
            Rerender.rerenderNoWriteNoH5(
                self.app.selectedObject,
                self.app.pointcloud.TruPos,
                imgcopy,
                Settings.RRENDER_K,
                Settings.RRENDER_DISTORT,
            )
            self.tex.load(imgcopy)

            taskMgr.add(self.renderImageTask, "renderImageTask")