AlbumShaper
1.0a3
|
00001 //============================================== 00002 // copyright : (C) 2003-2005 by Will Stokes 00003 //============================================== 00004 // This program is free software; you can redistribute it 00005 // and/or modify it under the terms of the GNU General 00006 // Public License as published by the Free Software 00007 // Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 //============================================== 00010 00011 #ifndef BACKEND_TOOLS_IMAGETOOLS_H 00012 #define BACKEND_TOOLS_IMAGETOOLS_H 00013 00014 //-------------------- 00015 //forward declarations 00016 //-------------------- 00017 class QString; 00018 class QImage; 00019 class QPoint; 00020 class QSize; 00021 #include <qcolor.h> 00022 00023 //Transform Codes 00024 typedef enum 00025 { 00026 ROTATE_90, //rotate clockwise 90 degrees 00027 ROTATE_270, //rotate counter-clockwise 90 degrees 00028 FLIP_H, //flip left-to-right 00029 FLIP_V, //flip top-to-bottom 00030 } TRANSFORM_CODE; 00031 00033 bool isJpeg(const char* filename); 00034 00037 void calcScaledImageDimensions(int origWidth, int origHeight, 00038 int idealWidth, int idealHeight, 00039 int& width, int& height); 00040 00042 void constructImages(QString imageName, 00043 QImage& slideshowImage, QImage& thumbnailImage); 00044 00046 bool transformImage( QString fileIn, QString fileOut, TRANSFORM_CODE transformation ); 00047 00049 bool scaleImage( QString fileIn, QString fileOut, 00050 int newWidth, int newHeight ); 00051 00053 bool scaleImage(QString fileIn, QImage& scaledImage, int targetWidth, int targetHeight); 00054 00056 bool getImageSize( const char* filename,QSize& size ); 00057 00059 bool getImageSize( const char* filename, int& width, int& height ); 00060 00062 double RGBtoL(QRgb* rgb); 00063 00065 void RGBtoHSV( double r, double g, double b, 00066 double *h, double *s, double *v ); 00067 00069 void HSVtoRGB( double *r, double *g, double *b, 00070 double h, double s, double v ); 00071 00072 #endif //BACKEND_TOOLS_IMAGETOOLS_H