5#include "pxcrypt/pxcrypt_codec_export.h"
11#include "pxcrypt/decode_error.h"
21 static inline const DecodeError ERR_INVALID_SOURCE =
22 DecodeError(DecodeError::InvalidSource, u
"The encoded image is invalid."_s);
23 static inline const DecodeError ERR_MISSING_MEDIUM =
24 DecodeError(DecodeError::MissingMedium, u
"The encoded image requires a medium to be decoded but none was provided."_s);
25 static inline const DecodeError ERR_DIMENSION_MISTMATCH =
26 DecodeError(DecodeError::DimensionMismatch, u
"The required medium image has different dimensions than the encoded image."_s);
27 static inline const DecodeError ERR_NOT_LARGE_ENOUGH =
28 DecodeError(DecodeError::NotLargeEnough, u
"The provided image is not large enough to be an encoded image."_s);
30 DecodeError(DecodeError::InvalidMeta, u
"The provided image is not encoded."_s);
31 static inline const DecodeError ERR_INVALID_HEADER =
32 DecodeError(DecodeError::InvalidHeader, u
"The provided image is not encoded or the password/medium are incorrect."_s);
33 static inline const DecodeError ERR_LENGTH_MISMATCH =
34 DecodeError(DecodeError::LengthMismatch, u
"The encoded image's header indicates it contains more data than possible."_s);
35 static inline const DecodeError ERR_UNEXPECTED_END =
36 DecodeError(DecodeError::UnexpectedEnd, u
"All pixels were skimmed before the expected payload size was reached."_s);
37 static inline const DecodeError ERR_CHECKSUM_MISMATCH =
38 DecodeError(DecodeError::ChecksumMismatch, u
"The payload's checksum did not match the expected value."_s);
57 static bool canFitHeader(
const QSize& dim, quint8 bpc);
61 bool hasError()
const;
70 QByteArray decode(
const QImage& encoded,
const QImage& medium = QImage());
The DecodeError class is used to report errors during image decoding.
Definition decode_error.h:14
The Decoder class provides the means to skim and decrypt data from the color channels of an encoded i...
Definition decoder.h:17
The PxCrypt namespace is the main namespace through which all functionality of the PxCrypt library is...
Definition decode_error.cpp:5