Exemple #1
0
 def __init__(self, position):
     Animation.__init__(self)
     self.position = position
     self.scan_animation = None
     self.size = self.DEFAULT_SIZE
     self.drawers = [
         RectangleDrawer(self.position, self.size,
                         inside_color=ScanAnimation.BACKGROUND_COLOR),
     ]
Exemple #2
0
 def __init__(self, position):
     Animation.__init__(self)
     self.position = position
     self.scan_animation = None
     self.size = self.DEFAULT_SIZE
     self.drawers = [
         RectangleDrawer(self.position, self.size,
                         inside_color=ScanAnimation.BACKGROUND_COLOR),
     ]
Exemple #3
0
    def __init__(self, scan_workflow, page=None, previous_drawer=None):
        Animation.__init__(self)

        self.previous_drawer = previous_drawer

        self.scan_drawers = []

        self.ocr_drawers = {}  # angle --> [drawers]

        self.animators = []
        self._position = (0, 0)

        self.scan_workflow = scan_workflow

        self.__used_angles = None  # == any

        self.page = page
        self.rotation_done = False

        scan_workflow.connect(
            "scan-start",
            lambda gobj: GLib.idle_add(self.__on_scan_started_cb))
        scan_workflow.connect(
            "scan-info", lambda gobj, img_x, img_y: GLib.idle_add(
                self.__on_scan_info_cb, img_x, img_y))
        scan_workflow.connect(
            "scan-chunk", lambda gobj, line, chunk: GLib.idle_add(
                self.__on_scan_chunk_cb, line, chunk))
        scan_workflow.connect(
            "scan-done",
            lambda gobj, img: GLib.idle_add(self.__on_scan_done_cb, img))
        scan_workflow.connect(
            "ocr-start",
            lambda gobj, img: GLib.idle_add(self.__on_ocr_started_cb, img))
        scan_workflow.connect(
            "ocr-angles",
            lambda gobj, imgs: GLib.idle_add(self.__on_ocr_angles_cb, imgs))
        scan_workflow.connect(
            "ocr-score", lambda gobj, angle, score: GLib.idle_add(
                self.__on_ocr_score_cb, angle, score))
        scan_workflow.connect(
            "ocr-done", lambda gobj, angle, img, boxes: GLib.idle_add(
                self.__on_ocr_done_cb, angle, img, boxes))
Exemple #4
0
    def __init__(self, scan_workflow):
        Animation.__init__(self)

        self.scan_drawers = []

        self.ocr_drawers = {}  # angle --> [drawers]

        self.animators = []
        self._position = (0, 0)

        self.scan_workflow = scan_workflow

        self.__used_angles = None  # == any

        # we are used as a page drawer, but our page is being built
        # --> no actual page
        self.page = None
        self.rotation_done = False

        scan_workflow.connect(
            "scan-start",
            lambda gobj: GLib.idle_add(self.__on_scan_started_cb))
        scan_workflow.connect(
            "scan-info", lambda gobj, img_x, img_y: GLib.idle_add(
                self.__on_scan_info_cb, img_x, img_y))
        scan_workflow.connect(
            "scan-chunk", lambda gobj, line, chunk: GLib.idle_add(
                self.__on_scan_chunk_cb, line, chunk))
        scan_workflow.connect(
            "scan-done",
            lambda gobj, img: GLib.idle_add(self.__on_scan_done_cb, img))
        scan_workflow.connect(
            "ocr-start",
            lambda gobj, img: GLib.idle_add(self.__on_ocr_started_cb, img))
        scan_workflow.connect(
            "ocr-angles",
            lambda gobj, imgs: GLib.idle_add(self.__on_ocr_angles_cb, imgs))
        scan_workflow.connect(
            "ocr-score", lambda gobj, angle, score: GLib.idle_add(
                self.__on_ocr_score_cb, angle, score))
        scan_workflow.connect(
            "ocr-done", lambda gobj, angle, img, boxes: GLib.idle_add(
                self.__on_ocr_done_cb, angle, img, boxes))
Exemple #5
0
    def __init__(self, scan_workflow, page=None, previous_drawer=None):
        Animation.__init__(self)

        self.previous_drawer = previous_drawer

        self.scan_drawers = []

        self.ocr_drawers = {}  # angle --> [drawers]

        self.animators = []
        self._position = (0, 0)

        self.scan_workflow = scan_workflow

        self.__used_angles = None  # == any

        self.page = page
        self.rotation_done = False

        scan_workflow.connect("scan-start",
                              lambda gobj:
                              GLib.idle_add(self.__on_scan_started_cb))
        scan_workflow.connect("scan-info", lambda gobj, img_x, img_y:
                              GLib.idle_add(self.__on_scan_info_cb,
                                            img_x, img_y))
        scan_workflow.connect("scan-chunk", lambda gobj, line, chunk:
                              GLib.idle_add(self.__on_scan_chunk_cb, line,
                                            chunk))
        scan_workflow.connect("scan-done", lambda gobj, img:
                              GLib.idle_add(self.__on_scan_done_cb, img))
        scan_workflow.connect("ocr-start", lambda gobj, img:
                              GLib.idle_add(self.__on_ocr_started_cb, img))
        scan_workflow.connect("ocr-angles", lambda gobj, imgs:
                              GLib.idle_add(self.__on_ocr_angles_cb, imgs))
        scan_workflow.connect("ocr-score", lambda gobj, angle, score:
                              GLib.idle_add(self.__on_ocr_score_cb,
                                            angle, score))
        scan_workflow.connect("ocr-done", lambda gobj, angle, img, boxes:
                              GLib.idle_add(self.__on_ocr_done_cb, angle, img,
                                            boxes))
Exemple #6
0
 def set_canvas(self, canvas):
     Animation.set_canvas(self, canvas)
     assert(self.canvas)
     for drawer in self.drawers:
         drawer.set_canvas(canvas)
Exemple #7
0
 def set_canvas(self, canvas):
     Animation.set_canvas(self, canvas)
     assert(self.canvas)
     for drawer in self.drawers:
         drawer.set_canvas(canvas)