|
AlbumShaper 1.0a3
|
#include <fstream>#include <cstdlib>#include <iostream>#include <cmath>#include <qstring.h>#include <qimage.h>#include <qdir.h>#include <qfile.h>#include <qcolor.h>#include <qpoint.h>#include <qpainter.h>#include "imageTools.h"#include "jpeg/jpegTools.h"#include "jpeg/jpegSize.h"#include "../../config.h"
Go to the source code of this file.
Functions | |
| bool | isJpeg (const char *filename) |
| Checks to see if an image is a valid jpg by seeing if the image dimensions can be read. | |
| void | calcScaledImageDimensions (int origWidth, int origHeight, int idealWidth, int idealHeight, int &width, int &height) |
| Computes scale of image dimensions while respecting aspect ratio, equivalent to a QImage::scaleMin without actually scaling any image. | |
| void | constructImages (QString imageName, QImage &slideshowImage, QImage &thumbnailImage) |
| Constructs slideshow and thumbnail images for a full sized image. | |
| bool | transformImage (QString fileIn, QString fileOut, TRANSFORM_CODE transformation) |
| Apply image transformation on image | |
| bool | scaleImage (QString fileIn, QString fileOut, int newWidth, int newHeight) |
| Scale image and save copy to disk. | |
| bool | scaleImage (QString fileIn, QImage &scaledImage, int targetWidth, int targetHeight) |
| Loaded scaled version of image | |
| bool | getImageSize (const char *filename, QSize &size) |
| Get image dimensions. | |
| bool | getImageSize (const char *filename, int &width, int &height) |
| Get image dimensions. | |
| double | RGBtoL (QRgb *rgb) |
| find luminance of a rgb color triplet | |
| void | RGBtoHSV (double r, double g, double b, double *h, double *s, double *v) |
| Convert a RGB color triplet to HSV. | |
| void | HSVtoRGB (double *r, double *g, double *b, double h, double s, double v) |
| Convert a HSV color triplet to RGB. | |
| void calcScaledImageDimensions | ( | int | origWidth, |
| int | origHeight, | ||
| int | idealWidth, | ||
| int | idealHeight, | ||
| int & | width, | ||
| int & | height ) |
Computes scale of image dimensions while respecting aspect ratio, equivalent to a QImage::scaleMin without actually scaling any image.
Definition at line 39 of file imageTools.cpp.
Referenced by AlbumStatistics::AlbumStatistics(), constructImages(), SubalbumPreviewWidget::createSubalbumPixmap(), PhotoDescEdit::PhotoDescEdit(), EditingInterface::rotateSelection(), EditingInterface::selectAspectRatio(), Subalbum::setRepresentativeImage(), and Album::setRepresentativeImages().
| void constructImages | ( | QString | imageName, |
| QImage & | slideshowImage, | ||
| QImage & | thumbnailImage ) |
Constructs slideshow and thumbnail images for a full sized image.
Definition at line 69 of file imageTools.cpp.
References calcScaledImageDimensions(), getImageSize(), scaleImage(), SLIDESHOW_HEIGHT, SLIDESHOW_WIDTH, THUMBNAIL_HEIGHT, and THUMBNAIL_WIDTH.
Referenced by Photo::constructSmallerImages().
| bool getImageSize | ( | const char * | filename, |
| int & | width, | ||
| int & | height ) |
Get image dimensions.
Definition at line 201 of file imageTools.cpp.
References getJPEGSize(), height, and width.
| bool getImageSize | ( | const char * | filename, |
| QSize & | size ) |
Get image dimensions.
Definition at line 192 of file imageTools.cpp.
References getImageSize().
Referenced by MosaicOptionsDialog::appendImagesInPath(), EditingInterface::applyImageUpdate(), constructImages(), constructImageTiles(), getImageSize(), GrainEditor::GrainEditor(), HistogramInterface::HistogramInterface(), PhotoDescEdit::PhotoDescEdit(), EditingInterface::revertCurrentPhoto(), EditingInterface::rotateFlip(), GeneratePreviewThread::run(), ScaledPreviewInterface::ScaledPreviewInterface(), SelectionPlacementInterface::SelectionPlacementInterface(), EditingInterface::setPhoto(), SelectionInterface::setPhoto(), Subalbum::setRepresentativeImage(), Album::setRepresentativeImages(), setWallpaper(), and EditingInterface::showNextPrevFirstLastPhoto().
| void HSVtoRGB | ( | double * | r, |
| double * | g, | ||
| double * | b, | ||
| double | h, | ||
| double | s, | ||
| double | v ) |
Convert a HSV color triplet to RGB.
Definition at line 264 of file imageTools.cpp.
Referenced by HistogramEditor::adjustImage(), SelectionInterface::constructDisplayImages(), embossEffect(), enhanceImageContrast(), SelectionPlacementInterface::SelectionPlacementInterface(), and sharpenImage().
| bool isJpeg | ( | const char * | filename | ) |
Checks to see if an image is a valid jpg by seeing if the image dimensions can be read.
Definition at line 33 of file imageTools.cpp.
References getJPEGSize().
Referenced by Photo::setImage(), and transformImage().
| void RGBtoHSV | ( | double | r, |
| double | g, | ||
| double | b, | ||
| double * | h, | ||
| double * | s, | ||
| double * | v ) |
Convert a RGB color triplet to HSV.
Definition at line 231 of file imageTools.cpp.
References b.
Referenced by HistogramEditor::adjustImage(), SelectionInterface::constructDisplayImages(), embossEffect(), enhanceImageContrast(), RGBtoL(), SelectionPlacementInterface::SelectionPlacementInterface(), and sharpenImage().
| double RGBtoL | ( | QRgb * | rgb | ) |
find luminance of a rgb color triplet
Definition at line 217 of file imageTools.cpp.
References b, and RGBtoHSV().
Referenced by enhanceImageContrast().
| bool scaleImage | ( | QString | fileIn, |
| QImage & | scaledImage, | ||
| int | targetWidth, | ||
| int | targetHeight ) |
Loaded scaled version of image
Definition at line 171 of file imageTools.cpp.
References scaleJPEG().
| bool scaleImage | ( | QString | fileIn, |
| QString | fileOut, | ||
| int | newWidth, | ||
| int | newHeight ) |
Scale image and save copy to disk.
Definition at line 157 of file imageTools.cpp.
References scaleImage().
Referenced by EditingInterface::applyImageUpdate(), RecentAlbumMenuItem::changeItem(), constructImages(), constructImageTiles(), GrainEditor::GrainEditor(), HistogramInterface::HistogramInterface(), SlideshowWidget::loadPhoto(), TitleWidget::refreshOpenRecentMenu(), EditingInterface::revertCurrentPhoto(), EditingInterface::rotateFlip(), GeneratePreviewThread::run(), ScaledPreviewInterface::ScaledPreviewInterface(), scaleImage(), SelectionPlacementInterface::SelectionPlacementInterface(), EditingInterface::setPhoto(), SelectionInterface::setPhoto(), Subalbum::setRepresentativeImage(), Album::setRepresentativeImages(), setWallpaper(), and EditingInterface::showNextPrevFirstLastPhoto().
| bool transformImage | ( | QString | fileIn, |
| QString | fileOut, | ||
| TRANSFORM_CODE | transformation ) |
Apply image transformation on image
Definition at line 112 of file imageTools.cpp.
References FLIP_H, isJpeg(), ROTATE_270, ROTATE_90, and transformJPEG().
Referenced by Photo::applyTransformation(), and EditingInterface::rotateFlip().