FactDev  0.1
image.h
1 #ifndef IMAGE_H
2 #define IMAGE_H
3 
4 #include <QPixmap>
5 #include <QBuffer>
6 
7 namespace Gui {
8 namespace Utils {
9 
14 class Image
15 {
16 public:
23  static QByteArray imageToBytes(QImage image, const QString ext="PNG");
24 
32  static QByteArray pixmapToBytes(const QPixmap pix, const QString ext="PNG");
33 
39  static QImage pixmapToImage(const QPixmap pix);
40 
46  static QPixmap bytesToPixmap(const QByteArray bytes);
47 
57  static QPixmap getImage(QString path, int width = 256, int height = 256);
58 
59 };
60 
61 }
62 }
63 #endif // IMAGE_H
static QPixmap getImage(QString path, int width=256, int height=256)
Image::getImage Return a scaled image from the icon specified by it path. The image returned has a re...
Definition: image.cpp:21
static QPixmap bytesToPixmap(const QByteArray bytes)
Image::BytesToPixmap Return QPixmap from an array of bytes.
Definition: image.cpp:16
static QByteArray imageToBytes(QImage image, const QString ext="PNG")
Image::imageToBytes Return a QByteArray of the QImage image
Definition: image.cpp:29
static QByteArray pixmapToBytes(const QPixmap pix, const QString ext="PNG")
Image::pixmapToBytes Return a QByteArray of the QPixmap image
Definition: image.cpp:6
static QImage pixmapToImage(const QPixmap pix)
Image::pixmapToImage Return a QImage of QPixmap image
Definition: image.cpp:11
The Image class Contains generic methods on image formats.
Definition: image.h:14