File indexing completed on 2024-04-28 15:40:25
0001 /* SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org> 0002 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef IMAGE_UTIL_H 0007 #define IMAGE_UTIL_H 0008 #include <kpabase/FileName.h> 0009 0010 #include <QImage> 0011 0012 namespace Utilities 0013 { 0014 /** 0015 * @brief scaleImage returns the scaled image, honoring the settings for smooth scaling. 0016 * @param image 0017 * @param size 0018 * @param mode aspect ratio mode 0019 * @return a scaled image 0020 */ 0021 QImage scaleImage(const QImage &image, const QSize &size, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio); 0022 0023 /** 0024 * @brief saveImage saves a QImage to a FileName, making sure that the directory exists. 0025 * @param fileName 0026 * @param image 0027 * @param format the storage format for QImage::save(), usually "JPEG" 0028 */ 0029 void saveImage(const DB::FileName &fileName, const QImage &image, const char *format); 0030 } 0031 0032 #endif /* IMAGE_UTIL_H */ 0033 0034 // vi:expandtab:tabstop=4 shiftwidth=4: