AlbumShaper
1.0a3
|
A selection region placement interface. More...
#include <selectionPlacementInterface.h>
Signals | |
void | placementChanged (QRect) |
Public Member Functions | |
SelectionPlacementInterface (QString imageFilename, QWidget *parent=0, const char *name=0) | |
Creates layout. More... | |
~SelectionPlacementInterface () | |
Deletes objects. More... | |
QRect | getSelectedRegion () |
Returns the selected region in image space. More... | |
void | setSelectedRegion (QRect selection) |
Set the select region using image space coordinates. More... | |
virtual QSize | sizeHint () const |
virtual QSize | minimumSizeHint () const |
Protected Member Functions | |
void | paintEvent (QPaintEvent *e) |
void | mousePressEvent (QMouseEvent *e) |
void | mouseReleaseEvent (QMouseEvent *) |
void | mouseMoveEvent (QMouseEvent *e) |
Private Member Functions | |
QRect | imageToDisplay (QRect r) |
convert rectangle from image coordinates to display coordinates More... | |
bool | overRegion (QPoint p) |
util function used to determine if mouse is over selected region More... | |
void | recenterSelection (QPoint mousePosition) |
util function used to center selection about mouse location More... | |
Private Attributes | |
QImage | scaledImage |
Scaled image used for display purposes. More... | |
QImage | unselectedScaledImage |
Unselected scaled image (desaturated version of scaled image) More... | |
QSize | origImageSize |
original image dimensions More... | |
QRect | selection |
selection More... | |
bool | currentlyDragging |
dragging the mouse only moves the selection if the mouse button is pressed first over the selected region More... | |
bool | currentMouseShapeIsDrag |
current mouse shape. More... | |
A selection region placement interface.
Definition at line 29 of file selectionPlacementInterface.h.
SelectionPlacementInterface::SelectionPlacementInterface | ( | QString | imageFilename, |
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Creates layout.
Definition at line 29 of file selectionPlacementInterface.cpp.
References b, currentlyDragging, currentMouseShapeIsDrag, getImageSize(), HSVtoRGB(), MAX, MIN, origImageSize, RGBtoHSV(), scaledImage, scaleImage(), selection, and unselectedScaledImage.
SelectionPlacementInterface::~SelectionPlacementInterface | ( | ) |
QRect SelectionPlacementInterface::getSelectedRegion | ( | ) |
Returns the selected region in image space.
Definition at line 288 of file selectionPlacementInterface.cpp.
References selection.
|
private |
convert rectangle from image coordinates to display coordinates
Definition at line 264 of file selectionPlacementInterface.cpp.
References origImageSize, and scaledImage.
Referenced by overRegion(), and paintEvent().
|
virtual |
Definition at line 165 of file selectionPlacementInterface.cpp.
References scaledImage.
Referenced by sizeHint().
|
protected |
Definition at line 237 of file selectionPlacementInterface.cpp.
References currentlyDragging, currentMouseShapeIsDrag, getCursor(), MOVE_SELECTION_CURSOR, overRegion(), and recenterSelection().
|
protected |
Definition at line 223 of file selectionPlacementInterface.cpp.
References currentlyDragging, currentMouseShapeIsDrag, getCursor(), MOVE_SELECTION_CURSOR, and recenterSelection().
|
protected |
Definition at line 258 of file selectionPlacementInterface.cpp.
References currentlyDragging.
|
private |
util function used to determine if mouse is over selected region
Definition at line 168 of file selectionPlacementInterface.cpp.
References height, imageToDisplay(), scaledImage, selection, and width.
Referenced by mouseMoveEvent().
|
protected |
Definition at line 93 of file selectionPlacementInterface.cpp.
References bottomRight, buffer, height, imageToDisplay(), origImageSize, scaledImage, selection, topLeft, unselectedScaledImage, and width.
|
signal |
Referenced by recenterSelection().
|
private |
util function used to center selection about mouse location
Definition at line 192 of file selectionPlacementInterface.cpp.
References height, origImageSize, placementChanged(), selection, and width.
Referenced by mouseMoveEvent(), and mousePressEvent().
void SelectionPlacementInterface::setSelectedRegion | ( | QRect | selection | ) |
Set the select region using image space coordinates.
Definition at line 293 of file selectionPlacementInterface.cpp.
References selection.
Referenced by GrainEditor::previewResized().
|
virtual |
Definition at line 162 of file selectionPlacementInterface.cpp.
References minimumSizeHint().
|
private |
dragging the mouse only moves the selection if the mouse button is pressed first over the selected region
Definition at line 81 of file selectionPlacementInterface.h.
Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and SelectionPlacementInterface().
|
private |
current mouse shape.
by caching this value we avoid resetting the mouse cursor every time it moves etc.
Definition at line 85 of file selectionPlacementInterface.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and SelectionPlacementInterface().
|
private |
original image dimensions
Definition at line 74 of file selectionPlacementInterface.h.
Referenced by imageToDisplay(), paintEvent(), recenterSelection(), and SelectionPlacementInterface().
|
private |
Scaled image used for display purposes.
Definition at line 68 of file selectionPlacementInterface.h.
Referenced by imageToDisplay(), minimumSizeHint(), overRegion(), paintEvent(), and SelectionPlacementInterface().
|
private |
selection
Definition at line 77 of file selectionPlacementInterface.h.
Referenced by getSelectedRegion(), overRegion(), paintEvent(), recenterSelection(), SelectionPlacementInterface(), and setSelectedRegion().
|
private |
Unselected scaled image (desaturated version of scaled image)
Definition at line 71 of file selectionPlacementInterface.h.
Referenced by paintEvent(), and SelectionPlacementInterface().