def getBorderLayer(self, image): lyUtil = LayerUtil(image) layer = lyUtil.getLayerByName(ECst.LY_BORDER) if not layer: layer = lyUtil.renderNewLayer(ECst.LY_BORDER, ECst.CARD_DIMENSION[0], ECst.CARD_DIMENSION[1]) lyUtil.setLayerPostion(layer, LayerUtil.LY_TOP_POSITION) return layer
def paintBorder(self, image): layer = self.getBorderLayer(image) util = LayerUtil(image) util.selectAll() util.select(ECst.CARD_BORDER, ECst.CARD_BORDER, layer.width - 2 * ECst.CARD_BORDER, layer.height - 2 * ECst.CARD_BORDER, CHANNEL_OP_SUBTRACT) util.fillGradient(layer, ECst.GRAD_CARD_BORDER, 0, 0, ECst.CARD_DIMENSION[0], ECst.CARD_DIMENSION[1]) return