AlbumShaper
1.0a3
|
Interface for editing photo. More...
#include <editingInterface.h>
Public Slots | |
void | handleSelectionChanged () |
void | handleAspectRatioChanged () |
void | setFocus () |
Signals | |
void | photoModified () |
Public Member Functions | |
EditingInterface (QWidget *parent=0, const char *name=0) | |
Constructs layout. More... | |
~EditingInterface () | |
void | setPhoto (Subalbum *collection, Photo *photo) |
Sets the photo pointer and constructs scaled qimage's for painting. More... | |
Photo * | getPhoto () |
Returns a pointer to the currently selected photo. More... | |
bool | currentPhotoRevertable () |
void | revertCurrentPhoto () |
reverts current photo and updates display More... | |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *e) |
Private Slots | |
void | showPrevPhoto () |
Show prev photo. More... | |
void | showNextPhoto () |
Show next photo. More... | |
void | showFirstPhoto () |
Show first photo. More... | |
void | showLastPhoto () |
Show last photo. More... | |
void | rotateRight () |
Rotate image right 90 degrees. More... | |
void | rotateLeft () |
Rotate image left 90 degrees. More... | |
void | flipHorizontal () |
Flip image horizontally. More... | |
void | startCorrectTilt () |
Enter correct image tilt mode. More... | |
void | finishCorrectTilt (QPoint p1, QPoint p2) |
Finish correcting and image's tilt. More... | |
void | flipVertical () |
Flip image vertically. More... | |
void | selectAspectRatio () |
Aspect ratio selection changed. More... | |
void | screenResolutionChanged () |
Update recorded screen resolution and selection if necessary. More... | |
void | rotateSelection () |
Rotate current selection. More... | |
void | crop () |
Cropped image. More... | |
void | enhanceContrast () |
Enhance image contrast. More... | |
void | colorBalance () |
Improve color balance. More... | |
void | removeRedeye () |
Applies redeye removal. More... | |
void | tuneLevels () |
Opens levels editor for manual histogram and brightness/contrast adjustments. More... | |
void | adjustGrain () |
Opens image grain editor. More... | |
void | selectEffect () |
Effect seletion changed. More... | |
void | applyEffect () |
Apply selected effect. More... | |
void | returnAction () |
Exit editing interface. More... | |
Private Member Functions | |
void | showNextPrevFirstLastPhoto (Photo *newPhoto) |
Utility method for show prev/next photos. More... | |
void | rotateFlip (TRANSFORM_CODE rotationFlipType) |
Utility method for rotation + flip slots. More... | |
bool | findSelection (QPoint &topLeft, QPoint &bottomRight) |
Finds the selected region of the image. More... | |
void | selectAll (QPoint &topLeft, QPoint &bottomRight) |
Return coordinates that select entire image. More... | |
QImage * | applyEffect (QString filename, ManipulationOptions *options=NULL) |
utlity function for apply effect and preview effect slots More... | |
void | applyImageUpdate (QImage *editedImage, bool resetSelection) |
Applies update to image. More... | |
Private Attributes | |
ClickableLabel * | previousButton |
Buttons for changing the shown image More... | |
ClickableLabel * | nextButton |
SelectionInterface * | selectionInterface |
This widget scales and displays the photo to fit the available screen space, and provides extensive support for selecting regions of the photo for editing/cropping. More... | |
QComboBox * | aspectRatios |
Widget for selection aspect ratio to crop to. More... | |
QComboBox * | orientations |
int | displayResolutionIndex |
Index for screen resolution, needed if this value pair changes during program executing. More... | |
QSize * | aspectRatioValues |
array of common aspect ratios to crop to More... | |
double * | maxDimensions |
bool | selectionRotated |
state variable indicating if the user wants to use a rotate aspect ratio More... | |
QToolButton * | correctTiltButton |
The start tilt button is disabled while a line is being selected. More... | |
QToolButton * | cropButton |
The crop buttons is disabled when no seletion is present. More... | |
ClickableLabel * | redEyeReductionButton |
The red eye reduction button is disabled when no selection is present. More... | |
QComboBox * | effectsList |
List of effects that can be applied to photos. More... | |
QPushButton * | applyEffectButton |
The apply effect button is disabled when no effect has been chosen. More... | |
QLabel * | effectPreview |
Label that shows preview of effect. More... | |
Subalbum * | collection |
========== Pointer to backend collection More... | |
Photo * | photo |
Pointer to backend photo. More... | |
QString | effectPreviewImageFilename |
Path to scaled down version of image for fast generation of previews of effects. More... | |
LayoutWidget * | layout |
Pointer to the parent layout widget. More... | |
int | displayWidth |
Dimension of photo in display coordinates. More... | |
int | displayHeight |
int | imageWidth |
Dimension of photo in image coordinates. More... | |
int | imageHeight |
Interface for editing photo.
Definition at line 56 of file editingInterface.h.
EditingInterface::EditingInterface | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
Constructs layout.
Definition at line 76 of file editingInterface.cpp.
References adjustGrain(), applyEffect(), applyEffectButton, aspectRatios, aspectRatioValues, BW_EFFECT, colorBalance(), correctTiltButton, crop(), cropButton, displayResolutionIndex, effectPreview, effectsList, EMBOSS_EFFECT, enhanceContrast(), finishCorrectTilt(), flipHorizontal(), flipVertical(), handleAspectRatioChanged(), handleSelectionChanged(), IMAGE_PATH, INVERT_EFFECT, layout, maxDimensions, MOSAIC_EFFECT, nextButton, NUM_MANIPULATIONS, PAINTING_EFFECT, photo, POINTILLISM_EFFECT, previousButton, redEyeReductionButton, removeRedeye(), rotateLeft(), rotateRight(), rotateSelection(), screenResolutionChanged(), selectAspectRatio(), selectEffect(), selectionInterface, SEPIA_EFFECT, ClickableLabel::setEnabled(), ClickableLabel::setPixmap(), showNextPhoto(), showPrevPhoto(), startCorrectTilt(), TIGHT_WIDGET_SPACING, tuneLevels(), and WIDGET_SPACING.
EditingInterface::~EditingInterface | ( | ) |
Definition at line 433 of file editingInterface.cpp.
|
privateslot |
Opens image grain editor.
Definition at line 753 of file editingInterface.cpp.
References applyImageUpdate(), Photo::getImageFilename(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), layout, photo, and StatusWidget::releaseInput().
Referenced by EditingInterface().
|
privateslot |
Apply selected effect.
Definition at line 793 of file editingInterface.cpp.
References applyEffectButton, applyImageUpdate(), editedImage, effectsList, Photo::getImageFilename(), MosaicOptionsDialog::getOptions(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), layout, MOSAIC_EFFECT, photo, StatusWidget::releaseInput(), StatusWidget::setStatus(), and StatusWidget::showProgressBar().
Referenced by EditingInterface(), and selectEffect().
|
private |
utlity function for apply effect and preview effect slots
Definition at line 839 of file editingInterface.cpp.
References blackWhiteEffect(), BW_EFFECT, effectsList, EMBOSS_EFFECT, embossEffect(), INVERT_EFFECT, invertEffect(), MOSAIC_EFFECT, mosaicEffect(), oilPaintingEffect(), PAINTING_EFFECT, POINTILLISM_EFFECT, pointillismEffect(), SEPIA_EFFECT, and sepiaEffect().
|
private |
Applies update to image.
Definition at line 858 of file editingInterface.cpp.
References displayHeight, displayWidth, editedImage, EFFECT_PREVIEW_HEIGHT, EFFECT_PREVIEW_WIDTH, effectPreviewImageFilename, SelectionInterface::getDisplaySize(), Photo::getImageFilename(), getImageSize(), imageHeight, imageWidth, photo, photoModified(), scaleImage(), selectEffect(), selectionInterface, selectionRotated, SelectionInterface::selectNone(), Photo::setImage(), and SelectionInterface::setPhoto().
Referenced by adjustGrain(), applyEffect(), colorBalance(), crop(), enhanceContrast(), finishCorrectTilt(), removeRedeye(), and tuneLevels().
|
privateslot |
Improve color balance.
Definition at line 677 of file editingInterface.cpp.
References applyImageUpdate(), Photo::getImageFilename(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), improveColorBalance(), layout, photo, and StatusWidget::releaseInput().
Referenced by EditingInterface().
|
privateslot |
Cropped image.
Definition at line 631 of file editingInterface.cpp.
References applyImageUpdate(), bottomRight, cropImage(), findSelection(), Photo::getImageFilename(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), layout, photo, StatusWidget::releaseInput(), and topLeft.
Referenced by EditingInterface().
bool EditingInterface::currentPhotoRevertable | ( | ) |
Definition at line 1000 of file editingInterface.cpp.
References photo, and Photo::revertPossible().
Referenced by LayoutWidget::photoStateChangedEvent(), and revertCurrentPhoto().
|
privateslot |
Enhance image contrast.
Definition at line 655 of file editingInterface.cpp.
References applyImageUpdate(), enhanceImageContrast(), Photo::getImageFilename(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), layout, photo, and StatusWidget::releaseInput().
Referenced by EditingInterface().
|
private |
Finds the selected region of the image.
Definition at line 919 of file editingInterface.cpp.
References SelectionInterface::getSelection(), and selectionInterface.
Referenced by crop(), handleSelectionChanged(), and removeRedeye().
|
privateslot |
Finish correcting and image's tilt.
Definition at line 1220 of file editingInterface.cpp.
References applyImageUpdate(), correctImageTilt(), correctTiltButton, Photo::getImageFilename(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), layout, photo, and StatusWidget::releaseInput().
Referenced by EditingInterface().
|
privateslot |
Flip image horizontally.
Definition at line 562 of file editingInterface.cpp.
References FLIP_H, and rotateFlip().
Referenced by EditingInterface(), and keyPressEvent().
|
privateslot |
Flip image vertically.
Definition at line 567 of file editingInterface.cpp.
References FLIP_V, and rotateFlip().
Referenced by EditingInterface(), and keyPressEvent().
Photo * EditingInterface::getPhoto | ( | ) |
Returns a pointer to the currently selected photo.
Definition at line 435 of file editingInterface.cpp.
References photo.
Referenced by LayoutWidget::tabChanged().
|
slot |
Definition at line 943 of file editingInterface.cpp.
References aspectRatios.
Referenced by EditingInterface().
|
slot |
Definition at line 933 of file editingInterface.cpp.
References bottomRight, cropButton, findSelection(), redEyeReductionButton, ClickableLabel::setEnabled(), and topLeft.
Referenced by EditingInterface().
|
protected |
Definition at line 957 of file editingInterface.cpp.
References flipHorizontal(), flipVertical(), returnAction(), rotateLeft(), rotateRight(), showFirstPhoto(), showLastPhoto(), showNextPhoto(), and showPrevPhoto().
|
signal |
Referenced by applyImageUpdate(), revertCurrentPhoto(), rotateFlip(), and showNextPrevFirstLastPhoto().
|
privateslot |
Applies redeye removal.
Definition at line 699 of file editingInterface.cpp.
References applyImageUpdate(), bottomRight, findSelection(), Photo::getImageFilename(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), layout, photo, StatusWidget::releaseInput(), removeRedeyeRegions(), and topLeft.
Referenced by EditingInterface().
|
privateslot |
Exit editing interface.
Definition at line 913 of file editingInterface.cpp.
References layout, and LayoutWidget::organize().
Referenced by keyPressEvent().
void EditingInterface::revertCurrentPhoto | ( | ) |
reverts current photo and updates display
Revert photo
Definition at line 1008 of file editingInterface.cpp.
References currentPhotoRevertable(), displayHeight, displayWidth, EFFECT_PREVIEW_HEIGHT, EFFECT_PREVIEW_WIDTH, effectPreviewImageFilename, SelectionInterface::getDisplaySize(), Photo::getImageFilename(), getImageSize(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), imageHeight, imageWidth, layout, Photo::originalImageFilename(), photo, photoModified(), StatusWidget::releaseInput(), Photo::revertPhoto(), scaleImage(), selectEffect(), selectionInterface, and SelectionInterface::setPhoto().
Referenced by LayoutWidget::revertPhotos().
|
private |
Utility method for rotation + flip slots.
Definition at line 572 of file editingInterface.cpp.
References displayHeight, displayWidth, EFFECT_PREVIEW_HEIGHT, EFFECT_PREVIEW_WIDTH, effectPreviewImageFilename, SelectionInterface::getDisplaySize(), Photo::getImageFilename(), getImageSize(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), imageHeight, imageWidth, layout, photo, photoModified(), StatusWidget::releaseInput(), ROTATE_270, ROTATE_90, scaleImage(), selectAspectRatio(), selectEffect(), selectionInterface, selectionRotated, Photo::setImage(), SelectionInterface::setPhoto(), and transformImage().
Referenced by flipHorizontal(), flipVertical(), rotateLeft(), and rotateRight().
|
privateslot |
Rotate image left 90 degrees.
Definition at line 557 of file editingInterface.cpp.
References ROTATE_270, and rotateFlip().
Referenced by EditingInterface(), and keyPressEvent().
|
privateslot |
Rotate image right 90 degrees.
Definition at line 552 of file editingInterface.cpp.
References ROTATE_90, and rotateFlip().
Referenced by EditingInterface(), and keyPressEvent().
|
privateslot |
Rotate current selection.
Definition at line 1057 of file editingInterface.cpp.
References aspectRatios, bottomRight, calcScaledImageDimensions(), SelectionInterface::getSelection(), imageHeight, imageWidth, selectAspectRatio(), selectionInterface, selectionRotated, SelectionInterface::setSelection(), and topLeft.
Referenced by EditingInterface().
|
privateslot |
Update recorded screen resolution and selection if necessary.
Definition at line 621 of file editingInterface.cpp.
References aspectRatios, aspectRatioValues, displayResolutionIndex, and selectAspectRatio().
Referenced by EditingInterface().
|
private |
Return coordinates that select entire image.
Definition at line 949 of file editingInterface.cpp.
References imageHeight, and imageWidth.
|
privateslot |
Aspect ratio selection changed.
Definition at line 1122 of file editingInterface.cpp.
References aspectRatios, aspectRatioValues, calcScaledImageDimensions(), displayResolutionIndex, SelectionInterface::getSelection(), imageHeight, imageWidth, maxDimensions, selectionInterface, selectionRotated, and SelectionInterface::setSelection().
Referenced by EditingInterface(), rotateFlip(), rotateSelection(), screenResolutionChanged(), and showNextPrevFirstLastPhoto().
|
privateslot |
Effect seletion changed.
Definition at line 779 of file editingInterface.cpp.
References applyEffect(), editedImage, effectPreview, and effectPreviewImageFilename.
Referenced by applyImageUpdate(), EditingInterface(), revertCurrentPhoto(), rotateFlip(), setPhoto(), and showNextPrevFirstLastPhoto().
|
slot |
Definition at line 1051 of file editingInterface.cpp.
References selectionInterface.
Referenced by LayoutWidget::tabChanged().
Sets the photo pointer and constructs scaled qimage's for painting.
Definition at line 437 of file editingInterface.cpp.
References aspectRatios, collection, cropButton, displayHeight, displayWidth, EFFECT_PREVIEW_HEIGHT, EFFECT_PREVIEW_WIDTH, effectPreviewImageFilename, effectsList, SelectionInterface::getDisplaySize(), Photo::getImageFilename(), getImageSize(), Photo::getNext(), Photo::getPrev(), imageHeight, imageWidth, nextButton, photo, previousButton, redEyeReductionButton, scaleImage(), selectEffect(), selectionInterface, selectionRotated, ClickableLabel::setEnabled(), ClickableLabel::setInvisible(), and SelectionInterface::setPhoto().
Referenced by LayoutWidget::tabChanged().
|
privateslot |
Show first photo.
Definition at line 492 of file editingInterface.cpp.
References collection, Subalbum::getFirst(), photo, and showNextPrevFirstLastPhoto().
Referenced by keyPressEvent().
|
privateslot |
Show last photo.
Definition at line 500 of file editingInterface.cpp.
References collection, Subalbum::getLast(), photo, and showNextPrevFirstLastPhoto().
Referenced by keyPressEvent().
|
privateslot |
Show next photo.
Definition at line 483 of file editingInterface.cpp.
References Photo::getNext(), photo, and showNextPrevFirstLastPhoto().
Referenced by EditingInterface(), and keyPressEvent().
|
private |
Utility method for show prev/next photos.
Definition at line 508 of file editingInterface.cpp.
References aspectRatios, displayHeight, displayWidth, EFFECT_PREVIEW_HEIGHT, EFFECT_PREVIEW_WIDTH, effectPreviewImageFilename, SelectionInterface::getDisplaySize(), Photo::getImageFilename(), getImageSize(), Photo::getNext(), Photo::getPrev(), imageHeight, imageWidth, nextButton, photo, photoModified(), previousButton, scaleImage(), selectAspectRatio(), selectEffect(), selectionInterface, selectionRotated, ClickableLabel::setInvisible(), SelectionInterface::setPhoto(), and SelectionInterface::setSelection().
Referenced by showFirstPhoto(), showLastPhoto(), showNextPhoto(), and showPrevPhoto().
|
privateslot |
Show prev photo.
Definition at line 474 of file editingInterface.cpp.
References Photo::getPrev(), photo, and showNextPrevFirstLastPhoto().
Referenced by EditingInterface(), and keyPressEvent().
|
privateslot |
Enter correct image tilt mode.
Definition at line 1212 of file editingInterface.cpp.
References correctTiltButton, SelectionInterface::enterDrawLineMode(), and selectionInterface.
Referenced by EditingInterface().
|
privateslot |
Opens levels editor for manual histogram and brightness/contrast adjustments.
Definition at line 727 of file editingInterface.cpp.
References applyImageUpdate(), Photo::getImageFilename(), Window::getStatus(), LayoutWidget::getWindow(), StatusWidget::grabInput(), layout, photo, and StatusWidget::releaseInput().
Referenced by EditingInterface().
|
private |
The apply effect button is disabled when no effect has been chosen.
Definition at line 211 of file editingInterface.h.
Referenced by applyEffect(), and EditingInterface().
|
private |
Widget for selection aspect ratio to crop to.
Definition at line 183 of file editingInterface.h.
Referenced by EditingInterface(), handleAspectRatioChanged(), rotateSelection(), screenResolutionChanged(), selectAspectRatio(), setPhoto(), and showNextPrevFirstLastPhoto().
|
private |
array of common aspect ratios to crop to
Definition at line 192 of file editingInterface.h.
Referenced by EditingInterface(), screenResolutionChanged(), and selectAspectRatio().
|
private |
========== Pointer to backend collection
Definition at line 217 of file editingInterface.h.
Referenced by setPhoto(), showFirstPhoto(), and showLastPhoto().
|
private |
The start tilt button is disabled while a line is being selected.
Definition at line 199 of file editingInterface.h.
Referenced by EditingInterface(), finishCorrectTilt(), and startCorrectTilt().
|
private |
The crop buttons is disabled when no seletion is present.
Definition at line 202 of file editingInterface.h.
Referenced by EditingInterface(), handleSelectionChanged(), and setPhoto().
|
private |
Definition at line 229 of file editingInterface.h.
Referenced by applyImageUpdate(), revertCurrentPhoto(), rotateFlip(), setPhoto(), and showNextPrevFirstLastPhoto().
|
private |
Index for screen resolution, needed if this value pair changes during program executing.
Definition at line 189 of file editingInterface.h.
Referenced by EditingInterface(), screenResolutionChanged(), and selectAspectRatio().
|
private |
Dimension of photo in display coordinates.
Definition at line 229 of file editingInterface.h.
Referenced by applyImageUpdate(), revertCurrentPhoto(), rotateFlip(), setPhoto(), and showNextPrevFirstLastPhoto().
|
private |
Label that shows preview of effect.
Definition at line 214 of file editingInterface.h.
Referenced by EditingInterface(), and selectEffect().
|
private |
Path to scaled down version of image for fast generation of previews of effects.
Definition at line 223 of file editingInterface.h.
Referenced by applyImageUpdate(), revertCurrentPhoto(), rotateFlip(), selectEffect(), setPhoto(), and showNextPrevFirstLastPhoto().
|
private |
List of effects that can be applied to photos.
Definition at line 208 of file editingInterface.h.
Referenced by applyEffect(), EditingInterface(), and setPhoto().
|
private |
Definition at line 232 of file editingInterface.h.
Referenced by applyImageUpdate(), revertCurrentPhoto(), rotateFlip(), rotateSelection(), selectAll(), selectAspectRatio(), setPhoto(), and showNextPrevFirstLastPhoto().
|
private |
Dimension of photo in image coordinates.
Definition at line 232 of file editingInterface.h.
Referenced by applyImageUpdate(), revertCurrentPhoto(), rotateFlip(), rotateSelection(), selectAll(), selectAspectRatio(), setPhoto(), and showNextPrevFirstLastPhoto().
|
private |
Pointer to the parent layout widget.
Definition at line 226 of file editingInterface.h.
Referenced by adjustGrain(), applyEffect(), colorBalance(), crop(), EditingInterface(), enhanceContrast(), finishCorrectTilt(), removeRedeye(), returnAction(), revertCurrentPhoto(), rotateFlip(), and tuneLevels().
|
private |
Definition at line 193 of file editingInterface.h.
Referenced by EditingInterface(), and selectAspectRatio().
|
private |
Definition at line 176 of file editingInterface.h.
Referenced by EditingInterface(), setPhoto(), and showNextPrevFirstLastPhoto().
|
private |
Definition at line 186 of file editingInterface.h.
|
private |
Pointer to backend photo.
Definition at line 220 of file editingInterface.h.
Referenced by adjustGrain(), applyEffect(), applyImageUpdate(), colorBalance(), crop(), currentPhotoRevertable(), EditingInterface(), enhanceContrast(), finishCorrectTilt(), getPhoto(), removeRedeye(), revertCurrentPhoto(), rotateFlip(), setPhoto(), showFirstPhoto(), showLastPhoto(), showNextPhoto(), showNextPrevFirstLastPhoto(), showPrevPhoto(), and tuneLevels().
|
private |
Buttons for changing the shown image
Definition at line 176 of file editingInterface.h.
Referenced by EditingInterface(), setPhoto(), and showNextPrevFirstLastPhoto().
|
private |
The red eye reduction button is disabled when no selection is present.
Definition at line 205 of file editingInterface.h.
Referenced by EditingInterface(), handleSelectionChanged(), and setPhoto().
|
private |
This widget scales and displays the photo to fit the available screen space, and provides extensive support for selecting regions of the photo for editing/cropping.
Definition at line 180 of file editingInterface.h.
Referenced by applyImageUpdate(), EditingInterface(), findSelection(), revertCurrentPhoto(), rotateFlip(), rotateSelection(), selectAspectRatio(), setFocus(), setPhoto(), showNextPrevFirstLastPhoto(), and startCorrectTilt().
|
private |
state variable indicating if the user wants to use a rotate aspect ratio
Definition at line 196 of file editingInterface.h.
Referenced by applyImageUpdate(), rotateFlip(), rotateSelection(), selectAspectRatio(), setPhoto(), and showNextPrevFirstLastPhoto().