1#ifndef STANDARD_DECODER_H
2#define STANDARD_DECODER_H
5#include "pxcrypt/pxcrypt_codec_export.h"
11#include <qx/core/qx-abstracterror.h>
14#include "pxcrypt/codec/decoder.h"
19class StandardDecoderPrivate;
35 Error decode(QByteArray& decoded,
const QImage& encoded,
const QImage& medium = QImage());
55 static inline const QString PREFIX_STRING = u
"Decoding failed."_s;
56 static inline const QHash<Type, QString> ERR_STRINGS{
58 {InvalidSource, u
"The encoded image is invalid."_s},
59 {MissingMedium, u
"The encoded image requires a medium to be decoded but none was provided."_s},
60 {DimensionMismatch, u
"The required medium image has different dimensions than the encoded image."_s},
61 {NotLargeEnough, u
"The provided image is not large enough to be an encoded image."_s},
62 {InvalidMeta, u
"The provided image is not encoded."_s},
63 {SkimFailed, u
"There was an error while skimming data."_s}
73 Error(Type t = NoError,
const QString& s = {});
79 QString specific()
const;
80 QString errorString()
const;
83 quint32 deriveValue()
const override;
84 QString derivePrimary()
const override;
85 QString deriveSecondary()
const override;
The Encoder class is a base class from which all PxCrypt decoders derive in order to skim and decrypt...
Definition decoder.h:17
The StandardDecoder::Error class is used to report errors during image decoding.
Definition standard_decoder.h:39
Type
Definition standard_decoder.h:43
@ SkimFailed
Definition standard_decoder.h:50
@ InvalidSource
Definition standard_decoder.h:45
@ InvalidMeta
Definition standard_decoder.h:49
@ NoError
Definition standard_decoder.h:44
@ NotLargeEnough
Definition standard_decoder.h:48
@ DimensionMismatch
Definition standard_decoder.h:47
@ MissingMedium
Definition standard_decoder.h:46
Error(Type t=NoError, const QString &s={})
Definition standard_decoder.cpp:215
QString tag() const
Definition standard_decoder.cpp:82
StandardDecoder()
Definition standard_decoder.cpp:73
Error decode(QByteArray &decoded, const QImage &encoded, const QImage &medium=QImage())
Definition standard_decoder.cpp:97
The PxCrypt namespace is the main namespace through which all functionality of the PxCrypt library is...
Definition decoder.cpp:6