AlbumShaper
1.0a3
|
A split view interface provides a means to show before and after versions of an image while adjustments are being made, in addition to dragging this split point left/right or up/down. This abtract class must be subclassed in order to properly handle resize events, in addition to actually setting the original and adjusted images. More...
#include <splitViewInterface.h>
Public Member Functions | |
SplitViewInterface (QWidget *parent=0, const char *name=0) | |
Creates layout. More... | |
void | setPreviewMode (PREVIEW_MODE mode, bool forceDrawLabel=false) |
Sets preview mode. More... | |
virtual QSize | sizeHint () const =0 |
virtual QSize | minimumSizeHint () const |
void | setImages (QImage origImage, QImage adjustedImage) |
void | setAdjustedImage (QImage adjustedImage) |
sets adjusted image and repaints More... | |
QImage & | getOrigImage () |
returns orig image object More... | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *e) |
void | mousePressEvent (QMouseEvent *e) |
void | mouseReleaseEvent (QMouseEvent *) |
void | mouseMoveEvent (QMouseEvent *e) |
virtual void | resizeEvent (QResizeEvent *)=0 |
Private Member Functions | |
double | displayToWorld (int coordinate) |
convert display coordinates to world coordinates (double from 0.0 - 1.0) More... | |
int | worldToDisplay (double coordinate) |
convert world coordinates to display coordinates (int from 0 to origImage width-1) More... | |
bool | nearSplitPoint (QPoint p) |
determines if mouse is near split point More... | |
Private Attributes | |
PREVIEW_MODE | previewMode |
Current display setting (adjusted or split screen) More... | |
bool | forceDrawLabel |
Draw original/adjusted lables outside of split view mode? More... | |
QString | originalString |
Original and adjusted strings. More... | |
QString | adjustedString |
QFont | textFont |
Larger font used for drawing text. More... | |
double | dragOffset |
x (or y) coordinate of split between drawn adjusted and original images More... | |
PREVIEW_MOUSE_MODE | mouseMode |
current mouse move mode More... | |
PREVIEW_MOUSE_MODE | currentMouseShape |
current mouse shape. More... | |
QImage | origImage |
Scaled original image. More... | |
QImage | adjustedImage |
Scaled adjusted image. More... | |
A split view interface provides a means to show before and after versions of an image while adjustments are being made, in addition to dragging this split point left/right or up/down. This abtract class must be subclassed in order to properly handle resize events, in addition to actually setting the original and adjusted images.
Definition at line 47 of file splitViewInterface.h.
SplitViewInterface::SplitViewInterface | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
Creates layout.
Definition at line 31 of file splitViewInterface.cpp.
References adjustedString, currentMouseShape, dragOffset, forceDrawLabel, mouseMode, NO_EFFECT_ON_SPLIT, originalString, previewMode, SPLIT_VIEW, and textFont.
|
private |
convert display coordinates to world coordinates (double from 0.0 - 1.0)
Definition at line 392 of file splitViewInterface.cpp.
References origImage.
Referenced by mouseMoveEvent().
QImage & SplitViewInterface::getOrigImage | ( | ) |
returns orig image object
Definition at line 416 of file splitViewInterface.cpp.
References origImage.
Referenced by GrainEditor::generateAdjustedPreviewImage(), and HistogramEditor::generateAdjustedPreviewImage().
|
virtual |
Reimplemented in ScaledPreviewInterface.
Definition at line 408 of file splitViewInterface.cpp.
References adjustedString, originalString, TEXT_BACKGROUND_MARGIN, and textFont.
Referenced by ScaledPreviewInterface::minimumSizeHint().
|
protected |
Definition at line 326 of file splitViewInterface.cpp.
References adjustedString, currentMouseShape, displayToWorld(), DRAG_SPLIT, dragOffset, getCursor(), height, mouseMode, MOVE_HOR_CURSOR, MOVE_VERT_CURSOR, nearSplitPoint(), NO_EFFECT_ON_SPLIT, origImage, originalString, TEXT_BACKGROUND_MARGIN, TEXT_INSET, textFont, and width.
|
protected |
Definition at line 319 of file splitViewInterface.cpp.
References DRAG_SPLIT, mouseMode, and nearSplitPoint().
|
protected |
Definition at line 379 of file splitViewInterface.cpp.
References currentMouseShape, DRAG_SPLIT, mouseMode, nearSplitPoint(), and NO_EFFECT_ON_SPLIT.
|
private |
determines if mouse is near split point
Definition at line 291 of file splitViewInterface.cpp.
References DRAG_THRESHOLD, dragOffset, height, origImage, previewMode, SPLIT_VIEW, width, and worldToDisplay().
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
|
protected |
Definition at line 62 of file splitViewInterface.cpp.
References ADJUSTED_IMAGE, adjustedImage, adjustedString, buffer, dragOffset, forceDrawLabel, height, INV_SPLIT_VIEW, origImage, ORIGINAL_IMAGE, originalString, previewMode, SPLIT_VIEW, TEXT_BACKGROUND_MARGIN, TEXT_INSET, textFont, width, and worldToDisplay().
|
protectedpure virtual |
Implemented in PanningPreviewInterface, and ScaledPreviewInterface.
void SplitViewInterface::setAdjustedImage | ( | QImage | adjustedImage | ) |
sets adjusted image and repaints
Definition at line 427 of file splitViewInterface.cpp.
References adjustedImage.
Referenced by GrainEditor::generateAdjustedPreviewImage(), and HistogramEditor::generateAdjustedPreviewImage().
void SplitViewInterface::setImages | ( | QImage | origImage, |
QImage | adjustedImage | ||
) |
Definition at line 419 of file splitViewInterface.cpp.
References adjustedImage, and origImage.
Referenced by PanningPreviewInterface::generateOrigImage(), and ScaledPreviewInterface::resizeEvent().
void SplitViewInterface::setPreviewMode | ( | PREVIEW_MODE | mode, |
bool | forceDrawLabel = false |
||
) |
Sets preview mode.
Definition at line 283 of file splitViewInterface.cpp.
References forceDrawLabel, and previewMode.
Referenced by GrainEditor::keyPressEvent(), HistogramEditor::keyPressEvent(), GrainEditor::keyReleaseEvent(), HistogramEditor::keyReleaseEvent(), GrainEditor::selectPreviewImageType(), and HistogramEditor::selectPreviewImageType().
|
pure virtual |
Implemented in PanningPreviewInterface, and ScaledPreviewInterface.
|
private |
convert world coordinates to display coordinates (int from 0 to origImage width-1)
Definition at line 400 of file splitViewInterface.cpp.
References origImage.
Referenced by nearSplitPoint(), and paintEvent().
|
private |
Scaled adjusted image.
Definition at line 116 of file splitViewInterface.h.
Referenced by paintEvent(), setAdjustedImage(), and setImages().
|
private |
Definition at line 97 of file splitViewInterface.h.
Referenced by minimumSizeHint(), mouseMoveEvent(), paintEvent(), and SplitViewInterface().
|
private |
current mouse shape.
by caching this value we avoid resetting the mouse cursor every time it moves etc.
Definition at line 110 of file splitViewInterface.h.
Referenced by mouseMoveEvent(), mouseReleaseEvent(), and SplitViewInterface().
|
private |
x (or y) coordinate of split between drawn adjusted and original images
Definition at line 103 of file splitViewInterface.h.
Referenced by mouseMoveEvent(), nearSplitPoint(), paintEvent(), and SplitViewInterface().
|
private |
Draw original/adjusted lables outside of split view mode?
Definition at line 93 of file splitViewInterface.h.
Referenced by paintEvent(), setPreviewMode(), and SplitViewInterface().
|
private |
current mouse move mode
Definition at line 106 of file splitViewInterface.h.
Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and SplitViewInterface().
|
private |
Scaled original image.
Definition at line 113 of file splitViewInterface.h.
Referenced by displayToWorld(), getOrigImage(), mouseMoveEvent(), nearSplitPoint(), paintEvent(), setImages(), and worldToDisplay().
|
private |
Original and adjusted strings.
Definition at line 96 of file splitViewInterface.h.
Referenced by minimumSizeHint(), mouseMoveEvent(), paintEvent(), and SplitViewInterface().
|
private |
Current display setting (adjusted or split screen)
Definition at line 90 of file splitViewInterface.h.
Referenced by nearSplitPoint(), paintEvent(), setPreviewMode(), and SplitViewInterface().
|
private |
Larger font used for drawing text.
Definition at line 100 of file splitViewInterface.h.
Referenced by minimumSizeHint(), mouseMoveEvent(), paintEvent(), and SplitViewInterface().