5#include "pxcrypt/pxcrypt_codec_export.h"
11#include <qx/core/qx-abstracterror.h>
14#include "pxcrypt/codec/decoder.h"
19class MultiDecoderPrivate;
35 Error decode(QByteArray& decoded,
const QList<QImage>& encoded,
const QList<QImage>& mediums = {});
59 static inline const QString PREFIX_STRING = u
"Decoding failed."_s;
60 static inline const QHash<Type, QString> ERR_STRINGS{
62 {MissingSources, u
"No encoded images were provided."_s},
63 {InvalidSource, u
"The encoded image is invalid."_s},
64 {MissingMediums, u
"The encoded images require mediums to be decoded but none or not enough were provided, or some were invalid..."_s},
65 {DimensionMismatch, u
"One of the required medium image has different dimensions than the encoded image."_s},
66 {NotLargeEnough, u
"The provided image is not large enough to be an encoded image."_s},
67 {InvalidMeta, u
"The provided image is not encoded."_s},
68 {PartMismatch, u
"One of the parts had a different complete checksum or tag than the rest, or an unexpected part index."_s},
69 {PartsMissing, u
"The image set consists of more parts than were provided."_s},
70 {ChecksumMismatch, u
"The full payload checksum did not match that of the reassembled payload."_s},
71 {SkimFailed, u
"There was an error while skimming data."_s}
78 qsizetype mImageIndex;
82 Error(Type t = NoError, qsizetype idx = -1,
const QString& s = {});
88 qsizetype imageIndex()
const;
89 QString specific()
const;
90 QString errorString()
const;
93 quint32 deriveValue()
const override;
94 QString derivePrimary()
const override;
95 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 MultiDecoder::Error class is used to report errors during multi-image decoding.
Definition multi_decoder.h:39
Error(Type t=NoError, qsizetype idx=-1, const QString &s={})
Definition multi_decoder.cpp:329
Type
Definition multi_decoder.h:43
@ InvalidMeta
Definition multi_decoder.h:50
@ DimensionMismatch
Definition multi_decoder.h:48
@ ChecksumMismatch
Definition multi_decoder.h:53
@ PartsMissing
Definition multi_decoder.h:52
@ MissingMediums
Definition multi_decoder.h:47
@ MissingSources
Definition multi_decoder.h:45
@ SkimFailed
Definition multi_decoder.h:54
@ NoError
Definition multi_decoder.h:44
@ InvalidSource
Definition multi_decoder.h:46
@ NotLargeEnough
Definition multi_decoder.h:49
@ PartMismatch
Definition multi_decoder.h:51
QString tag() const
Definition multi_decoder.cpp:190
Error decode(QByteArray &decoded, const QList< QImage > &encoded, const QList< QImage > &mediums={})
Definition multi_decoder.cpp:207
MultiDecoder()
Definition multi_decoder.cpp:181
The PxCrypt namespace is the main namespace through which all functionality of the PxCrypt library is...
Definition decoder.cpp:6