CCIMXDesktop
 
Loading...
Searching...
No Matches
PhotoSaver Class Reference

The PhotoSaver class provides static methods for saving images. More...

#include <PhotoSaver.h>

Public Types

enum class  Error { SaveSuccess , NullImage , DirUnsavable , ImageSelfSaveFailed }
 Error enum describes possible error states in saving process. More...
 

Public Member Functions

 PhotoSaver ()=default
 def constructor
 
 Q_DISABLE_COPY (PhotoSaver)
 Q_DISABLE_COPY disables copy constructor and assignment operator.
 

Static Public Member Functions

static bool dirSavable (const QString &dir)
 dirSavable checks whether the given directory is writable/savable.
 
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.
 

Detailed Description

The PhotoSaver class provides static methods for saving images.

Member Enumeration Documentation

◆ Error

enum class PhotoSaver::Error
strong

Error enum describes possible error states in saving process.

Enumerator
SaveSuccess 

Save was successful.

NullImage 

Image is null.

DirUnsavable 

Directory is not writable or savable.

ImageSelfSaveFailed 

Image saving failed internally.

Member Function Documentation

◆ dirSavable()

bool PhotoSaver::dirSavable ( const QString &  dir)
static

dirSavable checks whether the given directory is writable/savable.

Parameters
dirThe directory path to check.
Returns
True if directory is writable, otherwise false.

◆ saveOnce()

PhotoSaver::Error PhotoSaver::saveOnce ( const QPixmap &  image,
const QString &  dir,
const QString  prefix = ".jpg" 
)
static

saveOnce saves the image once to the given directory with a filename prefix.

Parameters
imageThe image to save.
dirThe target directory.
prefixThe filename prefix or suffix (default ".jpg").
Returns
The result code of the save operation.

The documentation for this class was generated from the following files: