AlbumShaper
1.0a3
|
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image, and a desription. More...
#include <photo.h>
Public Member Functions | |
Photo (Subalbum *subalbum, Photo *prev, int photoNumber) | |
Sets default information. More... | |
~Photo () | |
QImage * | getThumbnailImage () |
Gets thumbnail image. More... | |
bool | constructSmallerImages () |
Construct thumbnail and slideshow images, load up thumbnail image, and set photo has being modified. More... | |
bool | setImage (QString imageName, QString slideshowName, QString thumbnailName) |
Setup photo using preexisting full size, slideshow, and thumbnail images. More... | |
bool | setImage (QString imageName, int uniqueID) |
Setup photo using a new image. We'll need to create slideshow and thumbnail images. More... | |
bool | setImage (QString editedImageFilename) |
Reset photo data after photo editing has taken place. More... | |
QString | getImageFilename () |
Gets the image filename. More... | |
QString | getSlideshowFilename () |
Gets the slideshow filename. More... | |
QString | getThumbnailFilename () |
Gets the thumbnail filename. More... | |
void | setImageFilename (QString val) |
Sets the image filename. More... | |
void | setSlideshowFilename (QString val) |
Sets the slideshow filename. More... | |
void | setThumbnailFilename (QString val) |
Sets the thumbnail filename. More... | |
QString | getImageChecksum () |
Get image checksum. More... | |
QString | getThumbnailChecksum () |
Get thumbanil checksum. More... | |
QString | getSlideshowChecksum () |
Get thumbanil checksum. More... | |
void | setImageChecksum (QString val) |
Update image checksum. More... | |
void | setThumbnailChecksum (QString val) |
Update thumbnail checksum. More... | |
void | setSlideshowChecksum (QString val) |
Update slideshow checksum. More... | |
QString | getDescription () |
Gets the description. More... | |
void | setDescription (QString val) |
Sets the description. More... | |
Photo * | getPrev () |
Returns the previous photo pointer. More... | |
Photo * | getNext () |
Returns next photo pointer. More... | |
void | setPrev (Photo *val) |
Sets prev photo pointer. More... | |
void | setNext (Photo *val) |
Sets next photo pointer. More... | |
QDateTime * | importFromDisk (QDomNode *root) |
Builds photo from XML DOM node, returns date modified info from xml. More... | |
void | exportToXML (Q3TextStream &stream) |
Exports photo to xml. More... | |
void | rotate90 () |
Rotates image clockwise 90 degrees. More... | |
void | rotate270 () |
Rotates image clockwise 270 degrees. More... | |
void | flipHorizontally () |
Flips image about horizontal axis. More... | |
void | flipVertically () |
Flips image about vertical axis. More... | |
void | applyTransformation (TRANSFORM_CODE transformation) |
Apply transformation. More... | |
bool | getNeedsSavingVal () |
Returns if the image needs to be saved to its permament location. More... | |
void | setNeedsSavingVal (bool val) |
Sets if the image needs to be saved to its permanent location. More... | |
bool | getEverSaved () |
Returns if the image has ever been saved to a permanant location. More... | |
void | setEverSaved (bool val) |
sets everSaved More... | |
void | revertPhoto () |
revert photo to original form More... | |
bool | revertPossible () |
can photo be reverted to a differnt original form More... | |
bool | getRecentlyReverted () |
was the photo recently reverted? if so ignore the presence of orig files on disk More... | |
void | setRecentlyReverted (bool val) |
reset the recently reverted value to val More... | |
QString | originalImageFilename () |
orig filename More... | |
int | getInitialPhotoNumber () |
Returns initial photo number. More... | |
void | setInitialPhotoNumber (int val) |
Sets initial photo number. More... | |
int | getInitialSubalbumNumber () |
Returns initial subalbum number. More... | |
void | setInitialSubalbumNumber (int val) |
Sets initial subalbum number. More... | |
Private Attributes | |
Subalbum * | subalbum |
Subalbum photo is in. More... | |
Photo * | prev |
Pointer to prev photo. More... | |
Photo * | next |
Pointer to next photo. More... | |
int | initialPhotoNumber |
int | initialSubalbumNumber |
QString | description |
Photo description. More... | |
QImage * | thumbnailImage |
Thumbnail Image. More... | |
QString | imageLocation |
Filenames. More... | |
QString | slideshowLocation |
QString | thumbnailLocation |
QString | imageChecksum |
MD5 checksums, used to determine if image/thumbnail have been changed. More... | |
QString | slideshowChecksum |
QString | thumbnailChecksum |
bool | needsSaving |
Unsaved modifications? More... | |
bool | everSaved |
Has the photo ever been saved? More... | |
bool | recentlyReverted |
Has the photo recently been reverted to it's original form? If so during the next save the orig file can safely be remove. More... | |
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image, and a desription.
Sets default information.
Definition at line 32 of file photo.cpp.
References description, everSaved, Subalbum::getSubalbumNumber(), imageChecksum, imageLocation, initialPhotoNumber, initialSubalbumNumber, needsSaving, next, prev, recentlyReverted, slideshowChecksum, slideshowLocation, subalbum, thumbnailChecksum, thumbnailImage, and thumbnailLocation.
Photo::~Photo | ( | ) |
void Photo::applyTransformation | ( | TRANSFORM_CODE | transformation | ) |
Apply transformation.
Definition at line 476 of file photo.cpp.
References constructSmallerImages(), Subalbum::getAlbum(), getEverSaved(), Album::getTmpDir(), imageLocation, initialPhotoNumber, initialSubalbumNumber, moveFile(), needsSaving, recentlyReverted, slideshowLocation, subalbum, thumbnailLocation, and transformImage().
Referenced by flipHorizontally(), flipVertically(), rotate270(), and rotate90().
bool Photo::constructSmallerImages | ( | ) |
Construct thumbnail and slideshow images, load up thumbnail image, and set photo has being modified.
Definition at line 85 of file photo.cpp.
References constructImages(), imageLocation, needsSaving, Subalbum::setModified(), slideshowLocation, subalbum, thumbnailImage, and thumbnailLocation.
Referenced by applyTransformation(), and setImage().
void Photo::exportToXML | ( | Q3TextStream & | stream | ) |
Exports photo to xml.
Definition at line 414 of file photo.cpp.
References description, fixXMLString(), getImageFilename(), getSlideshowFilename(), getThumbnailFilename(), imageChecksum, slideshowChecksum, and thumbnailChecksum.
Referenced by Subalbum::exportToXML().
void Photo::flipHorizontally | ( | ) |
Flips image about horizontal axis.
Definition at line 473 of file photo.cpp.
References applyTransformation(), and FLIP_H.
void Photo::flipVertically | ( | ) |
Flips image about vertical axis.
Definition at line 474 of file photo.cpp.
References applyTransformation(), and FLIP_V.
QString Photo::getDescription | ( | ) |
Gets the description.
Definition at line 208 of file photo.cpp.
References description.
Referenced by PhotoDescEdit::PhotoDescEdit(), PhotoPreviewWidget::PhotoPreviewWidget(), SlideshowWidget::showPhoto(), and PhotoPreviewWidget::updateDescription().
bool Photo::getEverSaved | ( | ) |
Returns if the image has ever been saved to a permanant location.
Definition at line 534 of file photo.cpp.
References everSaved.
Referenced by applyTransformation(), Album::exportSubalbumImages(), originalImageFilename(), and setImage().
QString Photo::getImageChecksum | ( | ) |
Get image checksum.
Definition at line 200 of file photo.cpp.
References imageChecksum.
Referenced by Subalbum::importFromDisk().
QString Photo::getImageFilename | ( | ) |
Gets the image filename.
Definition at line 192 of file photo.cpp.
References imageLocation.
Referenced by EditingInterface::adjustGrain(), AlbumStatistics::AlbumStatistics(), EditingInterface::applyEffect(), EditingInterface::applyImageUpdate(), EditingInterface::colorBalance(), EditingInterface::crop(), EditingInterface::enhanceContrast(), Album::exportLargeImages(), Album::exportSubalbumImages(), exportToXML(), EditingInterface::finishCorrectTilt(), SlideshowWidget::loadPhoto(), PhotoDescEdit::PhotoDescEdit(), EditingInterface::removeRedeye(), Album::removeStagnantOrigFiles(), EditingInterface::revertCurrentPhoto(), revertPossible(), EditingInterface::rotateFlip(), TitleWidget::setAlbumImage(), EditingInterface::setPhoto(), setWallpaper(), EditingInterface::showNextPrevFirstLastPhoto(), and EditingInterface::tuneLevels().
int Photo::getInitialPhotoNumber | ( | ) |
Returns initial photo number.
Definition at line 608 of file photo.cpp.
References initialPhotoNumber.
Referenced by Album::exportSubalbumImages(), and Album::reorderSubalbumImages().
int Photo::getInitialSubalbumNumber | ( | ) |
Returns initial subalbum number.
Definition at line 611 of file photo.cpp.
References initialSubalbumNumber.
Referenced by Album::exportSubalbumImages(), and Album::reorderSubalbumImages().
bool Photo::getNeedsSavingVal | ( | ) |
Returns if the image needs to be saved to its permament location.
Definition at line 531 of file photo.cpp.
References needsSaving.
Referenced by Album::exportSubalbumImages().
Photo * Photo::getNext | ( | ) |
Returns next photo pointer.
Definition at line 225 of file photo.cpp.
References next.
Referenced by SlideshowWidget::advancePhoto(), AlbumStatistics::AlbumStatistics(), SlideshowWidget::beginSlideshow(), Album::exportCompressedWebAlbum(), Album::exportLargeImages(), Album::exportSubalbumImages(), Subalbum::exportToXML(), Album::getThumbnailFilenames(), Subalbum::photoMoved(), SubalbumWidget::refreshPhotos(), Subalbum::removePhoto(), Album::removeStagnantOrigFiles(), Album::reorderSubalbumImages(), EditingInterface::setPhoto(), EditingInterface::showNextPhoto(), EditingInterface::showNextPrevFirstLastPhoto(), Subalbum::syncPhotoList(), and Subalbum::~Subalbum().
Photo * Photo::getPrev | ( | ) |
Returns the previous photo pointer.
Definition at line 224 of file photo.cpp.
References prev.
Referenced by SlideshowWidget::backupPhoto(), Subalbum::photoMoved(), Subalbum::removePhoto(), EditingInterface::setPhoto(), EditingInterface::showNextPrevFirstLastPhoto(), and EditingInterface::showPrevPhoto().
bool Photo::getRecentlyReverted | ( | ) |
was the photo recently reverted? if so ignore the presence of orig files on disk
Definition at line 547 of file photo.cpp.
References recentlyReverted.
Referenced by Album::exportSubalbumImages(), and Album::removeStagnantOrigFiles().
QString Photo::getSlideshowChecksum | ( | ) |
Get thumbanil checksum.
Definition at line 202 of file photo.cpp.
References slideshowChecksum.
Referenced by Subalbum::importFromDisk().
QString Photo::getSlideshowFilename | ( | ) |
Gets the slideshow filename.
Definition at line 193 of file photo.cpp.
References slideshowLocation.
Referenced by AlbumStatistics::AlbumStatistics(), Album::exportCompressedWebAlbum(), Album::exportSubalbumImages(), exportToXML(), and PhotoDescEdit::PhotoDescEdit().
QString Photo::getThumbnailChecksum | ( | ) |
Get thumbanil checksum.
Definition at line 201 of file photo.cpp.
References thumbnailChecksum.
Referenced by Subalbum::importFromDisk().
QString Photo::getThumbnailFilename | ( | ) |
Gets the thumbnail filename.
Definition at line 194 of file photo.cpp.
References thumbnailLocation.
Referenced by Album::exportCompressedWebAlbum(), Album::exportSubalbumImages(), exportToXML(), Album::getThumbnailFilenames(), PhotoDescEdit::PhotoDescEdit(), TitleWidget::setSubalbumImage(), and PhotoPreviewWidget::updateImage().
QImage * Photo::getThumbnailImage | ( | ) |
QDateTime * Photo::importFromDisk | ( | QDomNode * | root | ) |
Builds photo from XML DOM node, returns date modified info from xml.
Definition at line 239 of file photo.cpp.
References description, imageChecksum, slideshowChecksum, and thumbnailChecksum.
Referenced by Subalbum::importFromDisk().
QString Photo::originalImageFilename | ( | ) |
orig filename
Definition at line 572 of file photo.cpp.
References Subalbum::getAlbum(), getEverSaved(), Album::getSaveLocation(), imageLocation, initialPhotoNumber, initialSubalbumNumber, and subalbum.
Referenced by Album::removeStagnantOrigFiles(), EditingInterface::revertCurrentPhoto(), revertPhoto(), and revertPossible().
void Photo::revertPhoto | ( | ) |
revert photo to original form
Definition at line 557 of file photo.cpp.
References originalImageFilename(), recentlyReverted, revertPossible(), and setImage().
Referenced by EditingInterface::revertCurrentPhoto().
bool Photo::revertPossible | ( | ) |
can photo be reverted to a differnt original form
Definition at line 537 of file photo.cpp.
References getImageFilename(), originalImageFilename(), and recentlyReverted.
Referenced by EditingInterface::currentPhotoRevertable(), and revertPhoto().
void Photo::rotate270 | ( | ) |
Rotates image clockwise 270 degrees.
Definition at line 472 of file photo.cpp.
References applyTransformation(), and ROTATE_270.
void Photo::rotate90 | ( | ) |
Rotates image clockwise 90 degrees.
Definition at line 471 of file photo.cpp.
References applyTransformation(), and ROTATE_90.
void Photo::setDescription | ( | QString | val | ) |
Sets the description.
Definition at line 210 of file photo.cpp.
References description, Subalbum::setModified(), and subalbum.
Referenced by Subalbum::addPhoto(), and PhotoDescEdit::disappear().
void Photo::setEverSaved | ( | bool | val | ) |
sets everSaved
Definition at line 535 of file photo.cpp.
References everSaved.
Referenced by Album::exportSubalbumImages(), and setImage().
bool Photo::setImage | ( | QString | imageName, |
QString | slideshowName, | ||
QString | thumbnailName | ||
) |
Setup photo using preexisting full size, slideshow, and thumbnail images.
We call this method when loading photos from disk and resizing is not necessary.
Definition at line 105 of file photo.cpp.
References imageLocation, needsSaving, slideshowLocation, thumbnailImage, and thumbnailLocation.
Referenced by Subalbum::addPhoto(), EditingInterface::applyImageUpdate(), Subalbum::lazyAddPhoto(), revertPhoto(), and EditingInterface::rotateFlip().
bool Photo::setImage | ( | QString | imageName, |
int | uniqueID | ||
) |
Setup photo using a new image. We'll need to create slideshow and thumbnail images.
Definition at line 124 of file photo.cpp.
References constructSmallerImages(), copyFile(), Subalbum::getAlbum(), Album::getTmpDir(), imageLocation, initialPhotoNumber, initialSubalbumNumber, isJpeg(), setEverSaved(), slideshowLocation, subalbum, and thumbnailLocation.
bool Photo::setImage | ( | QString | editedImageFilename | ) |
Reset photo data after photo editing has taken place.
Slideshow and thumbnail images need to be regenerated.
Definition at line 156 of file photo.cpp.
References constructSmallerImages(), copyFile(), Subalbum::getAlbum(), getEverSaved(), Album::getTmpDir(), imageLocation, initialPhotoNumber, initialSubalbumNumber, recentlyReverted, slideshowLocation, subalbum, and thumbnailLocation.
void Photo::setImageChecksum | ( | QString | val | ) |
Update image checksum.
Definition at line 204 of file photo.cpp.
References imageChecksum.
Referenced by Album::exportSubalbumImages().
void Photo::setImageFilename | ( | QString | val | ) |
Sets the image filename.
Definition at line 196 of file photo.cpp.
References imageLocation.
Referenced by Album::exportSubalbumImages(), and Album::reorderSubalbumImages().
void Photo::setInitialPhotoNumber | ( | int | val | ) |
Sets initial photo number.
Definition at line 609 of file photo.cpp.
References initialPhotoNumber.
Referenced by Album::reorderSubalbumImages().
void Photo::setInitialSubalbumNumber | ( | int | val | ) |
Sets initial subalbum number.
Definition at line 612 of file photo.cpp.
References initialSubalbumNumber.
Referenced by Album::reorderSubalbumImages().
void Photo::setNeedsSavingVal | ( | bool | val | ) |
Sets if the image needs to be saved to its permanent location.
Definition at line 532 of file photo.cpp.
References needsSaving.
Referenced by Album::exportSubalbumImages().
void Photo::setNext | ( | Photo * | val | ) |
Sets next photo pointer.
Definition at line 233 of file photo.cpp.
References next, Subalbum::setModified(), and subalbum.
Referenced by Subalbum::addPhoto(), Subalbum::lazyAddPhoto(), Subalbum::photoMoved(), Subalbum::removePhoto(), and Subalbum::syncPhotoList().
void Photo::setPrev | ( | Photo * | val | ) |
Sets prev photo pointer.
Definition at line 227 of file photo.cpp.
References prev, Subalbum::setModified(), and subalbum.
Referenced by Subalbum::addPhoto(), Subalbum::lazyAddPhoto(), Subalbum::photoMoved(), Subalbum::removePhoto(), and Subalbum::syncPhotoList().
void Photo::setRecentlyReverted | ( | bool | val | ) |
reset the recently reverted value to val
Definition at line 552 of file photo.cpp.
References recentlyReverted.
Referenced by Album::removeStagnantOrigFiles().
void Photo::setSlideshowChecksum | ( | QString | val | ) |
Update slideshow checksum.
Definition at line 206 of file photo.cpp.
References slideshowChecksum.
Referenced by Album::exportSubalbumImages().
void Photo::setSlideshowFilename | ( | QString | val | ) |
Sets the slideshow filename.
Definition at line 197 of file photo.cpp.
References slideshowLocation.
Referenced by Album::exportSubalbumImages(), and Album::reorderSubalbumImages().
void Photo::setThumbnailChecksum | ( | QString | val | ) |
Update thumbnail checksum.
Definition at line 205 of file photo.cpp.
References thumbnailChecksum.
Referenced by Album::exportSubalbumImages().
void Photo::setThumbnailFilename | ( | QString | val | ) |
Sets the thumbnail filename.
Definition at line 198 of file photo.cpp.
References thumbnailLocation.
Referenced by Album::exportSubalbumImages(), and Album::reorderSubalbumImages().
|
private |
Photo description.
Definition at line 205 of file photo.h.
Referenced by exportToXML(), getDescription(), importFromDisk(), Photo(), and setDescription().
|
private |
Has the photo ever been saved?
Definition at line 224 of file photo.h.
Referenced by getEverSaved(), Photo(), and setEverSaved().
|
private |
MD5 checksums, used to determine if image/thumbnail have been changed.
Definition at line 216 of file photo.h.
Referenced by exportToXML(), getImageChecksum(), importFromDisk(), Photo(), and setImageChecksum().
|
private |
Filenames.
Definition at line 211 of file photo.h.
Referenced by applyTransformation(), constructSmallerImages(), getImageFilename(), originalImageFilename(), Photo(), setImage(), and setImageFilename().
|
private |
Definition at line 199 of file photo.h.
Referenced by applyTransformation(), getInitialPhotoNumber(), originalImageFilename(), Photo(), setImage(), and setInitialPhotoNumber().
|
private |
Definition at line 202 of file photo.h.
Referenced by applyTransformation(), getInitialSubalbumNumber(), originalImageFilename(), Photo(), setImage(), and setInitialSubalbumNumber().
|
private |
Unsaved modifications?
Definition at line 221 of file photo.h.
Referenced by applyTransformation(), constructSmallerImages(), getNeedsSavingVal(), Photo(), setImage(), and setNeedsSavingVal().
|
private |
|
private |
|
private |
Has the photo recently been reverted to it's original form? If so during the next save the orig file can safely be remove.
Definition at line 228 of file photo.h.
Referenced by applyTransformation(), getRecentlyReverted(), Photo(), revertPhoto(), revertPossible(), setImage(), and setRecentlyReverted().
|
private |
Definition at line 217 of file photo.h.
Referenced by exportToXML(), getSlideshowChecksum(), importFromDisk(), Photo(), and setSlideshowChecksum().
|
private |
Definition at line 212 of file photo.h.
Referenced by applyTransformation(), constructSmallerImages(), getSlideshowFilename(), Photo(), setImage(), and setSlideshowFilename().
|
private |
Subalbum photo is in.
Definition at line 190 of file photo.h.
Referenced by applyTransformation(), constructSmallerImages(), originalImageFilename(), Photo(), setDescription(), setImage(), setNext(), and setPrev().
|
private |
Definition at line 218 of file photo.h.
Referenced by exportToXML(), getThumbnailChecksum(), importFromDisk(), Photo(), and setThumbnailChecksum().
|
private |
Thumbnail Image.
Definition at line 208 of file photo.h.
Referenced by constructSmallerImages(), getThumbnailImage(), Photo(), setImage(), and ~Photo().
|
private |
Definition at line 213 of file photo.h.
Referenced by applyTransformation(), constructSmallerImages(), getThumbnailFilename(), Photo(), setImage(), and setThumbnailFilename().