예제 #1
0
    def __init__(self, functions):

        QWidget.__init__(self)
        self.setMinimumSize(1250, 920)
        self.setMaximumSize(1250, 920)
        self.functions = functions
        self.lastCommand = None
        self.history = []

        # self.imageList = imageList
        self.scale = config.imgScale
        self.n = 4 + len(functions)

        self.buttonScale = config.buttonScale
        self.buttonCol = config.buttonCol
        self.blankSize = config.blankSize

        self.filler = tools.painterTools['Filler']
        self.pen = tools.painterTools['Pen']
        self.tool = self.filler
        self.tool.setWidget(self)
        # self.resultTool = tools.Concater()
        self.gridFlag = False

        self.fillWidth = 5

        self.bgid = 0

        self.outputs = []
        self.final = None

        self.imageAlpha = 0.3

        MyPushButton.setWidget(self)
        self.initImageLayout()
        self.initToolLayout()

        # self.setImageAlpha(self.imageAlpha)
        self.setFiller(self.filler.getTheta())
        self.setPen(5)
        self.trimapButtonGroup.button(1).setChecked(True)
        self.backgroundButtonGroup.button(0).setChecked(True)

        self.mainLayout = QVBoxLayout()
        self.mainLayout.addLayout(self.imageLayout)
        self.mainLayout.addLayout(self.toolLayout)

        self.setLayout(self.mainLayout)
예제 #2
0
    def __init__(self, functions):

        QWidget.__init__(self)
        self.setMinimumSize(1100, 715)
        self.setMaximumSize(1100, 715)
        self.functions = functions
        self.lastCommand = None
        self.history = []
        self.reHistory = []

        # self.imageList = imageList
        self.scale = config.imgScale
        self.n = 4 + len(functions)

        self.buttonScale = config.buttonScale
        self.buttonCol = config.buttonCol
        self.blankSize = config.blankSize

        self.filler = tools.painterTools['Filler']
        self.pen = tools.painterTools['Pen']
        self.tool = self.filler
        self.tool.setWidget(self)
        self.gridFlag = False

        self.fillWidth = 5
        self.drewAction = 0
        self.bgid = 2
        self.mouse = False
        self.cnt = 1
        self.len = 1

        self.outputs = []
        self.final = None

        self.imageAlpha = 0.3

        MyPushButton.setWidget(self)
        self.initImageLayout()
        self.initToolLayout()
        self.initAlphaSliderLayout()
        self.initToolLeftGridLayout()
        self.initToolRightGridLayout()

        self.setImageAlpha(self.imageAlpha)
        self.setFiller(self.filler.getTheta())
        self.setPen(5)
        self.trimapButtonGroup.button(1).setChecked(True)
        self.backgroundButtonGroup.button(0).setChecked(True)

        self.mainLayout = QVBoxLayout()
        imageBoxLayout = QHBoxLayout()
        imageBoxLayout.addWidget(self.vboxAlphaBox)
        imageBoxLayout.addWidget(self.hImageGroupBox)
        self.mainLayout.addLayout(imageBoxLayout)
        toolBoxLayout = QHBoxLayout()
        toolBoxLayout.addWidget(self.toolLeftGridGroupBox)
        toolBoxLayout.addWidget(self.toolRightGridGroupBox)
        self.mainLayout.addLayout(toolBoxLayout)
        # self.mainLayout.addLayout(self.toolLayout)

        self.setLayout(self.mainLayout)