Exemplo n.º 1
0
    def __action(self):

        # Build a filter string
        known_image_types = [('Windows Bitmaps', ['*.bmp', '*.dib']),
                             ('JPEG files', ['*.jpg', '*.jpeg']),
                             ('JPEG2K files', ['*.jp2']),
                             ('PNG Files', ['*.png']),
                             ('Portable Image Format files', ['*.pbm', '*.pgm', '*.ppm']),
                             ('TIFF files', ['*.tiff', '*.tif'])
                             ]

        known_image_types.insert(0, ('All Images',
                                     list(itertools.chain.from_iterable(i[1] for i in known_image_types))))

        filter_string = ";;".join("%s (%s)" % (i[0], " ".join(i[1])) for i in known_image_types)

        fname, _ = QtGui.QFileDialog.getOpenFileName(self.window, "Open Image", filter=filter_string)

        if not fname:
            return

        il = ImageLayer.fromFile(self.window.project, fname)

        # Allow the user to align the image
        dlg = LayerAlignmentDialog(self.window, self.window.project, il)
        res = dlg.exec_()
        if res == QtGui.QDialog.Accepted:
            self.window.project.imagery.add_imagelayer(il)
Exemplo n.º 2
0
    def __action(self):

        # Build a filter string
        known_image_types = [('Windows Bitmaps', ['*.bmp', '*.dib']),
                             ('JPEG files', ['*.jpg', '*.jpeg']),
                             ('JPEG2K files', ['*.jp2']),
                             ('PNG Files', ['*.png']),
                             ('Portable Image Format files',
                              ['*.pbm', '*.pgm', '*.ppm']),
                             ('TIFF files', ['*.tiff', '*.tif'])]

        known_image_types.insert(
            0,
            ('All Images',
             list(
                 itertools.chain.from_iterable(i[1]
                                               for i in known_image_types))))

        filter_string = ";;".join("%s (%s)" % (i[0], " ".join(i[1]))
                                  for i in known_image_types)

        fname, _ = QtGui.QFileDialog.getOpenFileName(self.window,
                                                     "Open Image",
                                                     filter=filter_string)

        if not fname:
            return

        il = ImageLayer.fromFile(self.window.project, fname)

        # Allow the user to align the image
        dlg = LayerAlignmentDialog(self.window, self.window.project, il)
        res = dlg.exec_()
        if res == QtGui.QDialog.Accepted:
            self.window.project.imagery.add_imagelayer(il)
Exemplo n.º 3
0
    def addImage(self):
        fname, _ = QtGui.QFileDialog.getOpenFileName(self, "Open Image")

        if not fname:
            return

        il = ImageLayer.fromFile(self.project, fname)

        # Allow the user to align the image
        dlg = LayerAlignmentDialog(self, self.project, il)
        res = dlg.exec_()
        if res == QtGui.QDialog.Accepted:
            self.project.imagery.add_imagelayer(il)
Exemplo n.º 4
0
    def addImage(self):
        fname, _ = QtGui.QFileDialog.getOpenFileName(self, "Open Image")

        if not fname:
            return

        il = ImageLayer.fromFile(self.project, fname)

        # Allow the user to align the image
        dlg = LayerAlignmentDialog(self, self.project, il)
        res = dlg.exec_()
        if res == QtGui.QDialog.Accepted:
            self.project.imagery.add_imagelayer(il)
Exemplo n.º 5
0
 def __triggered(self, action):
     ly = action.data()
     dlg = LayerAlignmentDialog(self.window, self.window.project, ly)
     dlg.exec_()
Exemplo n.º 6
0
 def m(action):
     ly = action.data()
     dlg = LayerAlignmentDialog(self, self.project, ly)
     dlg.exec_()
Exemplo n.º 7
0
 def __triggered(self, action: QtWidgets.QAction) -> None:
     ly = action.data()
     dlg = LayerAlignmentDialog(self._window, self._window.project, ly)
     dlg.exec_()
Exemplo n.º 8
0
 def m(action):
     ly = action.data()
     dlg = LayerAlignmentDialog(self, self.project, ly)
     dlg.exec_()