CCIMXDesktop
 
Loading...
Searching...
No Matches
PhotoSaver.h
1#ifndef PHOTOSAVER_H
2#define PHOTOSAVER_H
3
4#include <QPixmap>
5#include <QString>
6#include <QtClassHelperMacros>
7
12public:
16 PhotoSaver() = default;
17
22
26 enum class Error {
28 NullImage,
31 };
32
38 static bool dirSavable(const QString& dir);
39
47 static Error saveOnce(const QPixmap& image, const QString& dir, const QString prefix = ".jpg");
48};
49
50#endif // PHOTOSAVER_H
The PhotoSaver class provides static methods for saving images.
Definition PhotoSaver.h:11
Error
Error enum describes possible error states in saving process.
Definition PhotoSaver.h:26
@ DirUnsavable
Directory is not writable or savable.
@ NullImage
Image is null.
@ SaveSuccess
Save was successful.
@ ImageSelfSaveFailed
Image saving failed internally.
Q_DISABLE_COPY(PhotoSaver)
Q_DISABLE_COPY disables copy constructor and assignment operator.
PhotoSaver()=default
def constructor
static bool dirSavable(const QString &dir)
dirSavable checks whether the given directory is writable/savable.
Definition PhotoSaver.cpp:19
static Error saveOnce(const QPixmap &image, const QString &dir, const QString prefix=".jpg")
saveOnce saves the image once to the given directory with a filename prefix.
Definition PhotoSaver.cpp:5