mirror of https://github.com/status-im/qzxing.git
completed the first version of EncodeHint
This commit is contained in:
parent
66e7668815
commit
820fa54de0
|
@ -1 +1,9 @@
|
|||
#include "EncodeHint.h"
|
||||
|
||||
namespace zxing {
|
||||
|
||||
EncodeHint::EncodeHint() :
|
||||
errorCorrectionLevel_(NULL), characterSet_(""), margin_(0)
|
||||
{}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
#ifndef ENCODEHINTTYPE_H
|
||||
#define ENCODEHINTTYPE_H
|
||||
|
||||
#include <string>
|
||||
#include <zxing/qrcode/ErrorCorrectionLevel.h>
|
||||
|
||||
namespace zxing {
|
||||
|
||||
enum class EncodeHintType {
|
||||
|
||||
class EncodeHint
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* Specifies what degree of error correction to use, for example in QR Codes.
|
||||
* Type depends on the encoder. For example for QR codes it's type
|
||||
|
@ -12,59 +16,29 @@ enum class EncodeHintType {
|
|||
* For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
|
||||
* Note: an Aztec symbol should have a minimum of 25% EC words.
|
||||
*/
|
||||
ERROR_CORRECTION,
|
||||
zxing::qrcode::ErrorCorrectionLevel* errorCorrectionLevel_;
|
||||
|
||||
/**
|
||||
* Specifies what character encoding to use where applicable (type {@link String})
|
||||
*/
|
||||
CHARACTER_SET,
|
||||
|
||||
/**
|
||||
* Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
|
||||
*/
|
||||
DATA_MATRIX_SHAPE,
|
||||
|
||||
/**
|
||||
* Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
||||
*/
|
||||
MIN_SIZE,
|
||||
|
||||
/**
|
||||
* Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
||||
*/
|
||||
MAX_SIZE,
|
||||
std::string characterSet_;
|
||||
|
||||
/**
|
||||
* Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
|
||||
* by format; for example it controls margin before and after the barcode horizontally for
|
||||
* most 1D formats. (Type {@link Integer}).
|
||||
*/
|
||||
MARGIN,
|
||||
int margin_;
|
||||
|
||||
/**
|
||||
* Specifies whether to use compact mode for PDF417 (type {@link Boolean}).
|
||||
*/
|
||||
PDF417_COMPACT,
|
||||
public:
|
||||
EncodeHint();
|
||||
|
||||
/**
|
||||
* Specifies what compaction mode to use for PDF417 (type
|
||||
* {@link com.google.zxing.pdf417.encoder.Compaction Compaction}).
|
||||
*/
|
||||
PDF417_COMPACTION,
|
||||
const std::string getCharacterSet() const { return characterSet_; }
|
||||
const zxing::qrcode::ErrorCorrectionLevel* getErrorCorrectionLevel() { return errorCorrectionLevel_; }
|
||||
|
||||
/**
|
||||
* Specifies the minimum and maximum number of rows and columns for PDF417 (type
|
||||
* {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
|
||||
*/
|
||||
PDF417_DIMENSIONS,
|
||||
|
||||
/**
|
||||
* Specifies the required number of layers for an Aztec code:
|
||||
* a negative number (-1, -2, -3, -4) specifies a compact Aztec code
|
||||
* 0 indicates to use the minimum number of layers (the default)
|
||||
* a positive number (1, 2, .. 32) specifies a normaol (non-compact) Aztec code
|
||||
*/
|
||||
AZTEC_LAYERS,
|
||||
void setCharacterSet(const std::string& characterSet) { characterSet_ = characterSet; }
|
||||
void setErrorCorrectionLevel(zxing::qrcode::ErrorCorrectionLevel* errorCorectionLevel)
|
||||
{ errorCorrectionLevel_ = errorCorectionLevel; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue