00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef BACKEND_TOOLS_IMAGETOOLS_H
00012 #define BACKEND_TOOLS_IMAGETOOLS_H
00013
00014
00015
00016
00017 class QString;
00018 class QImage;
00019 class QPoint;
00020 class QSize;
00021 #include <qcolor.h>
00022
00023
00024 typedef enum
00025 {
00026 ROTATE_90,
00027 ROTATE_270,
00028 FLIP_H,
00029 FLIP_V,
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