hytos / DTI_PID / DTI_PID / Commands / FlipImageCommand.py @ 46d5088b
이력 | 보기 | 이력해설 | 다운로드 (1.31 KB)
1 | 1439cf3b | 김정우 | import os.path |
---|---|---|---|
2 | import AbstractCommand |
||
3 | try:
|
||
4 | from PyQt5.QtCore import Qt, QPoint, QPointF, QRectF, pyqtSignal, QT_VERSION_STR, QBuffer, QRect, QRegExp |
||
5 | from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QPainter, QColor, QPen, QBrush, QCursor, QTransform, QFont, QRegExpValidator, QValidator |
||
6 | from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QFileDialog, QMessageBox |
||
7 | except ImportError: |
||
8 | try:
|
||
9 | from PyQt4.QtCore import Qt, QPoint, QPointF, QRectF, pyqtSignal, QT_VERSION_STR, QBuffer, QRect, QRegExp |
||
10 | from PyQt4.QtGui import QGraphicsView, QGraphicsScene, QImage, QPixmap, QPainterPath, QFileDialog, QPainter, QColor, QPen, QBrush, QCursor, QTransform, QFont, QRegExpValidator, QValidator |
||
11 | except ImportError: |
||
12 | raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.") |
||
13 | |||
14 | class FlipImageCommand(AbstractCommand.AbstractCommand): |
||
15 | '''
|
||
16 | @history 2018.05.09 Jeongwoo Draw Rect on ±1 area
|
||
17 | '''
|
||
18 | def __init__(self, imageViewer, horizontal = False, vertical = True): |
||
19 | super(FlipImageCommand, self).__init__(imageViewer) |
||
20 | image = imageViewer.image().mirrored(horizontal = horizontal, vertical = vertical) |
||
21 | imageViewer.setImage(image) |
||
22 | |||
23 | def execute(self, param): |
||
24 | pass
|
||
25 | |||
26 | def undo(self): |
||
27 | pass
|
||
28 | |||
29 | def redo(self): |
||
30 | pass |