2016-08-28 15:10:43 +02:00
|
|
|
#ifndef HYPERION_IMAGEOPTION_H
|
|
|
|
#define HYPERION_IMAGEOPTION_H
|
|
|
|
|
|
|
|
#include "Option.h"
|
|
|
|
#include <QImage>
|
|
|
|
#include <QCommandLineParser>
|
|
|
|
|
|
|
|
namespace commandline
|
|
|
|
{
|
|
|
|
|
|
|
|
class ImageOption: public Option
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
QImage _image;
|
2020-08-08 23:12:43 +02:00
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
public:
|
|
|
|
ImageOption(const QString &name,
|
|
|
|
const QString &description = QString(),
|
|
|
|
const QString &valueName = QString(),
|
|
|
|
const QString &defaultValue = QString()
|
|
|
|
)
|
|
|
|
: Option(name, description, valueName, defaultValue)
|
|
|
|
{}
|
2020-08-08 23:12:43 +02:00
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
ImageOption(const QStringList &names,
|
|
|
|
const QString &description = QString(),
|
|
|
|
const QString &valueName = QString(),
|
|
|
|
const QString &defaultValue = QString()
|
|
|
|
)
|
|
|
|
: Option(names, description, valueName, defaultValue)
|
|
|
|
{}
|
2020-08-08 23:12:43 +02:00
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
ImageOption(const QCommandLineOption &other)
|
|
|
|
: Option(other)
|
|
|
|
{}
|
|
|
|
|
2020-08-08 23:12:43 +02:00
|
|
|
bool validate(Parser & parser, QString & value) override;
|
|
|
|
QImage& getImage(Parser &parser) { return _image; }
|
2016-08-28 15:10:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //HYPERION_IMAGEOPTION_H
|