mirror of https://github.com/status-im/qzxing.git
minor refactoring in code format
This commit is contained in:
parent
a57f8b24d3
commit
61a9f1d55b
|
@ -110,7 +110,8 @@ void MatrixUtil::buildMatrix(const BitArray& dataBits,
|
||||||
embedDataBits(dataBits, maskPattern, matrix);
|
embedDataBits(dataBits, maskPattern, matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MatrixUtil::embedBasicPatterns(const Version& version, ByteMatrix& matrix) {
|
void MatrixUtil::embedBasicPatterns(const Version& version, ByteMatrix& matrix)
|
||||||
|
{
|
||||||
// Let's get started with embedding big squares at corners.
|
// Let's get started with embedding big squares at corners.
|
||||||
embedPositionDetectionPatternsAndSeparators(matrix);
|
embedPositionDetectionPatternsAndSeparators(matrix);
|
||||||
// Then, embed the dark dot at the left bottom corner.
|
// Then, embed the dark dot at the left bottom corner.
|
||||||
|
|
|
@ -12,27 +12,33 @@ QRCode::QRCode() :
|
||||||
maskPattern_(-1),
|
maskPattern_(-1),
|
||||||
matrix_ptr_(NULL) {}
|
matrix_ptr_(NULL) {}
|
||||||
|
|
||||||
const Mode *QRCode::getMode() const {
|
const Mode *QRCode::getMode() const
|
||||||
|
{
|
||||||
return mode_ptr_;
|
return mode_ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ErrorCorrectionLevel *QRCode::getECLevel() const {
|
const ErrorCorrectionLevel *QRCode::getECLevel() const
|
||||||
|
{
|
||||||
return ecLevel_ptr_;
|
return ecLevel_ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Version *QRCode::getVersion() const {
|
const Version *QRCode::getVersion() const
|
||||||
|
{
|
||||||
return version_ptr_;
|
return version_ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int QRCode::getMaskPattern() const {
|
const int QRCode::getMaskPattern() const
|
||||||
|
{
|
||||||
return maskPattern_;
|
return maskPattern_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ByteMatrix *QRCode::getMatrix() const{
|
const ByteMatrix *QRCode::getMatrix() const
|
||||||
|
{
|
||||||
return matrix_ptr_;
|
return matrix_ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string QRCode::toString() {
|
const std::string QRCode::toString()
|
||||||
|
{
|
||||||
std::stringstream result;
|
std::stringstream result;
|
||||||
result << "<<\n";
|
result << "<<\n";
|
||||||
result << " mode: {unimpl}";
|
result << " mode: {unimpl}";
|
||||||
|
@ -53,7 +59,8 @@ const std::string QRCode::toString() {
|
||||||
return result.str();
|
return result.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QRCode::setMode(const Mode& value) {
|
void QRCode::setMode(const Mode& value)
|
||||||
|
{
|
||||||
mode_ptr_ = new Mode(value);
|
mode_ptr_ = new Mode(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,19 +69,23 @@ void QRCode::setMode(const Mode& value) {
|
||||||
* Also make destructors for all
|
* Also make destructors for all
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void QRCode::setECLevel(const ErrorCorrectionLevel& value) {
|
void QRCode::setECLevel(const ErrorCorrectionLevel& value)
|
||||||
|
{
|
||||||
//ecLevel_ptr_ = value;
|
//ecLevel_ptr_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QRCode::setVersion(const Version& version) {
|
void QRCode::setVersion(const Version& version)
|
||||||
|
{
|
||||||
//version_ptr_ = version;
|
//version_ptr_ = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QRCode::setMaskPattern(int value) {
|
void QRCode::setMaskPattern(int value)
|
||||||
|
{
|
||||||
//maskPattern_ptr_ = value;
|
//maskPattern_ptr_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QRCode::setMatrix(const ByteMatrix &value) {
|
void QRCode::setMatrix(const ByteMatrix &value)
|
||||||
|
{
|
||||||
//matrix_ptr_ = value;
|
//matrix_ptr_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,8 @@ public:
|
||||||
void setMaskPattern(int value);
|
void setMaskPattern(int value);
|
||||||
void setMatrix(const ByteMatrix& value);
|
void setMatrix(const ByteMatrix& value);
|
||||||
|
|
||||||
static bool isValidMaskPattern(int maskPattern) {
|
static bool isValidMaskPattern(int maskPattern)
|
||||||
|
{
|
||||||
return maskPattern >= 0 && maskPattern < NUM_MASK_PATTERNS;
|
return maskPattern >= 0 && maskPattern < NUM_MASK_PATTERNS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue