From a892b38bf3a8820daa383bd036649abbd2e5e395 Mon Sep 17 00:00:00 2001 From: Nikolaos Ftylitakis Date: Sun, 1 Aug 2021 23:50:16 +0300 Subject: [PATCH] change array to vector --- .../zxing/aztec/detector/AztecDetector.cpp | 4 +- src/zxing/zxing/common/Array.h | 269 +++++++++--------- .../common/reedsolomon/ReedSolomonDecoder.cpp | 6 +- .../detector/DataMatrixDetector.cpp | 2 +- src/zxing/zxing/oned/ITFReader.cpp | 2 +- .../pdf417/decoder/PDF417BitMatrixParser.cpp | 6 +- .../decoder/PDF417DecodedBitStreamParser.cpp | 8 +- .../pdf417/decoder/ec/ErrorCorrection.cpp | 10 +- .../zxing/pdf417/decoder/ec/ModulusGF.cpp | 8 +- .../zxing/pdf417/decoder/ec/ModulusPoly.cpp | 16 +- .../zxing/pdf417/detector/PDF417Detector.cpp | 10 +- .../zxing/qrcode/detector/QRDetector.cpp | 2 +- 12 files changed, 172 insertions(+), 171 deletions(-) diff --git a/src/zxing/zxing/aztec/detector/AztecDetector.cpp b/src/zxing/zxing/aztec/detector/AztecDetector.cpp index 1b6b12f..569e468 100644 --- a/src/zxing/zxing/aztec/detector/AztecDetector.cpp +++ b/src/zxing/zxing/aztec/detector/AztecDetector.cpp @@ -167,7 +167,7 @@ Detector::getMatrixCornerPoints(std::vector > bullEyeCornerPoints) { !isValid(targetdx, targetdy)) { throw ReaderException("matrix extends over image bounds"); } - Array< Ref >* array = new Array< Ref >(); + std::vector< Ref >* array = new std::vector< Ref >(); vector< Ref >& returnValue (array->values()); returnValue.push_back(Ref(new ResultPoint(float(targetax), float(targetay)))); returnValue.push_back(Ref(new ResultPoint(float(targetbx), float(targetby)))); @@ -190,7 +190,7 @@ void Detector::correctParameterData(Ref parameterData, bool com int numECCodewords = numCodewords - numDataCodewords; - ArrayRef parameterWords(new Array(numCodewords)); + ArrayRef parameterWords(new std::vector(numCodewords)); int codewordSize = 4; for (int i = 0; i < numCodewords; i++) { diff --git a/src/zxing/zxing/common/Array.h b/src/zxing/zxing/common/Array.h index 83b4232..b525407 100644 --- a/src/zxing/zxing/common/Array.h +++ b/src/zxing/zxing/common/Array.h @@ -22,152 +22,153 @@ */ #include +#include -#include +//#include -namespace zxing { +//namespace zxing { -template class Array : public Counted { -protected: -public: - std::vector values_; - Array() {} - Array(int n) : - Counted(), values_(n, T()) { - } - Array(T const* ts, int n) : - Counted(), values_(ts, ts+n) { - } - Array(T const* ts, T const* te) : - Counted(), values_(ts, te) { - } - Array(T v, int n) : - Counted(), values_(n, v) { - } - Array(std::vector &v) : - Counted(), values_(v) { - } - Array(Array &other) : - Counted(), values_(other.values_) { - } - Array(Array *other) : - Counted(), values_(other->values_) { - } - virtual ~Array() { - } - Array& operator=(const Array &other) { - values_ = other.values_; - return *this; - } - Array& operator=(const std::vector &array) { - values_ = array; - return *this; - } - T const& operator[](int i) const { - return values_[i]; - } - T& operator[](int i) { - return values_[i]; - } - int size() const { - return int(values_.size()); - } - bool empty() const { - return values_.size() == 0; - } - std::vector const& values() const { - return values_; - } - std::vector& values() { - return values_; - } - void push_back(T value) { - values_.push_back(value); - } -}; +//template class Array : public Counted { +//protected: +//public: +// std::vector values_; +// Array() {} +// Array(int n) : +// Counted(), values_(n, T()) { +// } +// Array(T const* ts, int n) : +// Counted(), values_(ts, ts+n) { +// } +// Array(T const* ts, T const* te) : +// Counted(), values_(ts, te) { +// } +// Array(T v, int n) : +// Counted(), values_(n, v) { +// } +// Array(std::vector &v) : +// Counted(), values_(v) { +// } +// Array(std::vector &other) : +// Counted(), values_(other.values_) { +// } +// Array(std::vector *other) : +// Counted(), values_(other->values_) { +// } +// virtual ~Array() { +// } +// std::vector& operator=(const std::vector &other) { +// values_ = other.values_; +// return *this; +// } +// std::vector& operator=(const std::vector &array) { +// values_ = array; +// return *this; +// } +// T const& operator[](int i) const { +// return values_[i]; +// } +// T& operator[](int i) { +// return values_[i]; +// } +// int size() const { +// return int(values_.size()); +// } +// bool empty() const { +// return values_.size() == 0; +// } +// std::vector const& values() const { +// return values_; +// } +// std::vector& values() { +// return values_; +// } +// void push_back(T value) { +// values_.push_back(value); +// } +//}; -template class ArrayRef : public Counted { -private: -public: - Array *array_; - ArrayRef() : - array_(0) { - } - explicit ArrayRef(int n) : - array_(0) { - reset(new Array (n)); - } - ArrayRef(T *ts, int n) : - array_(0) { - reset(new Array (ts, n)); - } - ArrayRef(Array *a) : - array_(0) { - reset(a); - } - ArrayRef(const ArrayRef &other) : - Counted(), array_(0) { - reset(other.array_); - } +//template class ArrayRef : public Counted { +//private: +//public: +// std::vector *array_; +// ArrayRef() : +// array_(0) { +// } +// explicit ArrayRef(int n) : +// array_(0) { +// reset(new std::vector (n)); +// } +// ArrayRef(T *ts, int n) : +// array_(0) { +// reset(new std::vector (ts, n)); +// } +// ArrayRef(std::vector *a) : +// array_(0) { +// reset(a); +// } +// ArrayRef(const ArrayRef &other) : +// Counted(), array_(0) { +// reset(other.array_); +// } - template - ArrayRef(const ArrayRef &other) : - array_(0) { - reset(static_cast *>(other.array_)); - } +// template +// ArrayRef(const ArrayRef &other) : +// array_(0) { +// reset(static_cast *>(other.array_)); +// } - ~ArrayRef() { - if (array_) { - array_->release(); - } - array_ = 0; - } +// ~ArrayRef() { +// if (array_) { +// array_->release(); +// } +// array_ = 0; +// } - T const& operator[](int i) const { - return (*array_)[i]; - } +// T const& operator[](int i) const { +// return (*array_)[i]; +// } - T& operator[](int i) { - return (*array_)[i]; - } +// T& operator[](int i) { +// return (*array_)[i]; +// } - void reset(Array *a) { - if (a) { - a->retain(); - } - if (array_) { - array_->release(); - } - array_ = a; - } - void reset(const ArrayRef &other) { - reset(other.array_); - } - ArrayRef& operator=(const ArrayRef &other) { - reset(other); - return *this; - } - ArrayRef& operator=(Array *a) { - reset(a); - return *this; - } +// void reset(std::vector *a) { +// if (a) { +// a->retain(); +// } +// if (array_) { +// array_->release(); +// } +// array_ = a; +// } +// void reset(const ArrayRef &other) { +// reset(other.array_); +// } +// ArrayRef& operator=(const ArrayRef &other) { +// reset(other); +// return *this; +// } +// ArrayRef& operator=(std::vector *a) { +// reset(a); +// return *this; +// } - Array& operator*() const { - return *array_; - } +// std::vector& operator*() const { +// return *array_; +// } - Array* operator->() const { - return array_; - } +// std::vector* operator->() const { +// return array_; +// } - operator bool () const { - return array_ != 0; - } - bool operator ! () const { - return array_ == 0; - } -}; +// operator bool () const { +// return array_ != 0; +// } +// bool operator ! () const { +// return array_ == 0; +// } +//}; -} // namespace zxing +//} // namespace zxing #endif // ZXING_ARRAY_H diff --git a/src/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.cpp b/src/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.cpp index a88b6bc..c53150b 100644 --- a/src/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.cpp +++ b/src/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.cpp @@ -132,11 +132,11 @@ ArrayRef ReedSolomonDecoder::findErrorLocations(Ref errorLoc // This is a direct application of Chien's search int numErrors = errorLocator->getDegree(); if (numErrors == 1) { // shortcut - ArrayRef result(new Array(1)); + ArrayRef result(new std::vector(1)); result[0] = errorLocator->getCoefficient(1); return result; } - ArrayRef result(new Array(numErrors)); + ArrayRef result(new std::vector(numErrors)); int e = 0; for (size_t i = 1; i < field->getSize() && e < numErrors; i++) { if (errorLocator->evaluateAt(i) == 0) { @@ -153,7 +153,7 @@ ArrayRef ReedSolomonDecoder::findErrorLocations(Ref errorLoc ArrayRef ReedSolomonDecoder::findErrorMagnitudes(Ref errorEvaluator, ArrayRef errorLocations) { // This is directly applying Forney's Formula int s = errorLocations->size(); - ArrayRef result(new Array(s)); + ArrayRef result(new std::vector(s)); for (int i = 0; i < s; i++) { int xiInverse = field->inverse(errorLocations[i]); int denominator = 1; diff --git a/src/zxing/zxing/datamatrix/detector/DataMatrixDetector.cpp b/src/zxing/zxing/datamatrix/detector/DataMatrixDetector.cpp index ec2a805..9cc91bd 100644 --- a/src/zxing/zxing/datamatrix/detector/DataMatrixDetector.cpp +++ b/src/zxing/zxing/datamatrix/detector/DataMatrixDetector.cpp @@ -246,7 +246,7 @@ Ref Detector::detect() { bits = sampleGrid(image_, dimensionCorrected, dimensionCorrected, transform); } - ArrayRef< Ref > points (new Array< Ref >(4)); + ArrayRef< Ref > points (new std::vector< Ref >(4)); points[0].reset(topLeft); points[1].reset(bottomLeft); points[2].reset(correctedTopRight); diff --git a/src/zxing/zxing/oned/ITFReader.cpp b/src/zxing/zxing/oned/ITFReader.cpp index 5514612..b9d0f76 100644 --- a/src/zxing/zxing/oned/ITFReader.cpp +++ b/src/zxing/zxing/oned/ITFReader.cpp @@ -45,7 +45,7 @@ const int N = 1; // Pixed width of a narrow line const int DEFAULT_ALLOWED_LENGTHS_[] = { 48, 44, 24, 20, 18, 16, 14, 12, 10, 8, 6 }; -const ArrayRef DEFAULT_ALLOWED_LENGTHS (new Array(VECTOR_INIT(DEFAULT_ALLOWED_LENGTHS_))); +const ArrayRef DEFAULT_ALLOWED_LENGTHS (new std::vector(VECTOR_INIT(DEFAULT_ALLOWED_LENGTHS_))); /** * Start/end guard pattern. diff --git a/src/zxing/zxing/pdf417/decoder/PDF417BitMatrixParser.cpp b/src/zxing/zxing/pdf417/decoder/PDF417BitMatrixParser.cpp index b8c396c..b1af129 100644 --- a/src/zxing/zxing/pdf417/decoder/PDF417BitMatrixParser.cpp +++ b/src/zxing/zxing/pdf417/decoder/PDF417BitMatrixParser.cpp @@ -72,9 +72,9 @@ ArrayRef BitMatrixParser::readCodewords() //int width = bitMatrix_->getWidth(); int height = bitMatrix_->getHeight(); - erasures_ = new Array(MAX_CW_CAPACITY); + erasures_ = new std::vector(MAX_CW_CAPACITY); - ArrayRef codewords (new Array(MAX_CW_CAPACITY)); + ArrayRef codewords (new std::vector(MAX_CW_CAPACITY)); int next = 0; int rowNumber = 0; for (int i = 0; i < height; i++) { @@ -187,7 +187,7 @@ ArrayRef BitMatrixParser::trimArray(ArrayRef array, int size) throw IllegalArgumentException("BitMatrixParser::trimArray: negative size!"); } // 2012-10-12 hfn don't throw "NoErrorException" when size == 0 - ArrayRef a = new Array(size); + ArrayRef a = new std::vector(size); for (int i = 0; i < size; i++) { a[i] = array[i]; } diff --git a/src/zxing/zxing/pdf417/decoder/PDF417DecodedBitStreamParser.cpp b/src/zxing/zxing/pdf417/decoder/PDF417DecodedBitStreamParser.cpp index 695883d..e38ff6c 100644 --- a/src/zxing/zxing/pdf417/decoder/PDF417DecodedBitStreamParser.cpp +++ b/src/zxing/zxing/pdf417/decoder/PDF417DecodedBitStreamParser.cpp @@ -366,8 +366,8 @@ int DecodedBitStreamParser::byteCompaction(int mode, // is not a multiple of 6 int count = 0; int64_t value = 0; - ArrayRef decodedData = new Array(6); - ArrayRef byteCompactedCodewords = new Array(6); + ArrayRef decodedData = new std::vector(6); + ArrayRef byteCompactedCodewords = new std::vector(6); bool end = false; int nextCode = codewords[codeIndex++]; while ((codeIndex < codewords[0]) && !end) { @@ -442,7 +442,7 @@ int DecodedBitStreamParser::byteCompaction(int mode, if ((count % 5 == 0) && (count > 0)) { // Decode every 5 codewords // Convert to Base 256 - ArrayRef decodedData = new Array(6); + ArrayRef decodedData = new std::vector(6); for (int j = 0; j < 6; ++j) { decodedData[5 - j] = (zxing::byte) (value & 0xFF); value >>= 8; @@ -470,7 +470,7 @@ int DecodedBitStreamParser::numericCompaction(ArrayRef codewords, int count = 0; bool end = false; - ArrayRef numericCodewords = new Array(MAX_NUMERIC_CODEWORDS); + ArrayRef numericCodewords = new std::vector(MAX_NUMERIC_CODEWORDS); while (codeIndex < codewords[0] && !end) { int code = codewords[codeIndex++]; diff --git a/src/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.cpp b/src/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.cpp index 2756faf..6a69cd1 100644 --- a/src/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.cpp +++ b/src/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.cpp @@ -49,7 +49,7 @@ void ErrorCorrection::decode(ArrayRef received, ArrayRef erasures) { Ref poly (new ModulusPoly(field_, received)); - ArrayRef S( new Array(numECCodewords)); + ArrayRef S( new std::vector(numECCodewords)); bool error = false; for (int i = numECCodewords; i > 0; i--) { int eval = poly->evaluateAt(field_.exp(i)); @@ -65,7 +65,7 @@ void ErrorCorrection::decode(ArrayRef received, for (int i=0;isize();i++) { int b = field_.exp(received->size() - 1 - erasures[i]); // Add (1 - bx) term: - ArrayRef one_minus_b_x(new Array(2)); + ArrayRef one_minus_b_x(new std::vector(2)); one_minus_b_x[1]=field_.subtract(0,b); one_minus_b_x[0]=1; Ref term (new ModulusPoly(field_,one_minus_b_x)); @@ -160,7 +160,7 @@ vector > ErrorCorrection::runEuclideanAlgorithm(Ref ErrorCorrection::findErrorLocations(Ref errorLocator) { // This is a direct application of Chien's search int numErrors = errorLocator->getDegree(); - ArrayRef result( new Array(numErrors)); + ArrayRef result( new std::vector(numErrors)); int e = 0; for (int i = 1; i < field_.getSize() && e < numErrors; i++) { if (errorLocator->evaluateAt(i) == 0) { @@ -193,7 +193,7 @@ ArrayRef ErrorCorrection::findErrorMagnitudes(Ref errorEvaluat ArrayRef errorLocations) { int i; int errorLocatorDegree = errorLocator->getDegree(); - ArrayRef formalDerivativeCoefficients (new Array(errorLocatorDegree)); + ArrayRef formalDerivativeCoefficients (new std::vector(errorLocatorDegree)); for (i = 1; i <= errorLocatorDegree; i++) { formalDerivativeCoefficients[errorLocatorDegree - i] = field_.multiply(i, errorLocator->getCoefficient(i)); @@ -202,7 +202,7 @@ ArrayRef ErrorCorrection::findErrorMagnitudes(Ref errorEvaluat // This is directly applying Forney's Formula int s = errorLocations->size(); - ArrayRef result ( new Array(s)); + ArrayRef result ( new std::vector(s)); for (i = 0; i < s; i++) { int xiInverse = field_.inverse(errorLocations[i]); int numerator = field_.subtract(0, errorEvaluator->evaluateAt(xiInverse)); diff --git a/src/zxing/zxing/pdf417/decoder/ec/ModulusGF.cpp b/src/zxing/zxing/pdf417/decoder/ec/ModulusGF.cpp index 741f014..38b70b8 100644 --- a/src/zxing/zxing/pdf417/decoder/ec/ModulusGF.cpp +++ b/src/zxing/zxing/pdf417/decoder/ec/ModulusGF.cpp @@ -40,8 +40,8 @@ ModulusGF ModulusGF::PDF417_GF(929,3); ModulusGF::ModulusGF(int modulus, int generator) : modulus_(modulus) { - expTable_ = new Array(modulus_); - logTable_ = new Array(modulus_); + expTable_ = new std::vector(modulus_); + logTable_ = new std::vector(modulus_); int x = 1,i; for (i = 0; i < modulus_; i++) { expTable_[i] = x; @@ -51,7 +51,7 @@ ModulusGF::ModulusGF(int modulus, int generator) logTable_[expTable_[i]] = i; } // logTable[0] == 0 but this should never be used - ArrayRefaZero(new Array(1)),aOne(new Array(1)); + ArrayRefaZero(new std::vector(1)),aOne(new std::vector(1)); aZero[0]=0;aOne[0]=1; zero_ = new ModulusPoly(*this, aZero); one_ = new ModulusPoly(*this, aOne); @@ -74,7 +74,7 @@ Ref ModulusGF::buildMonomial(int degree, int coefficient) return zero_; } int nCoefficients = degree + 1; - ArrayRef coefficients (new Array(nCoefficients)); + ArrayRef coefficients (new std::vector(nCoefficients)); coefficients[0] = coefficient; Ref result(new ModulusPoly(*this,coefficients)); return result; diff --git a/src/zxing/zxing/pdf417/decoder/ec/ModulusPoly.cpp b/src/zxing/zxing/pdf417/decoder/ec/ModulusPoly.cpp index bda298e..213c933 100644 --- a/src/zxing/zxing/pdf417/decoder/ec/ModulusPoly.cpp +++ b/src/zxing/zxing/pdf417/decoder/ec/ModulusPoly.cpp @@ -45,18 +45,18 @@ ModulusPoly::ModulusPoly(ModulusGF& field, ArrayRef coefficients) } if (firstNonZero == coefficientsLength) { coefficientsLength = field_.getZero()->getCoefficients()->size(); - coefficients_.reset(new Array (coefficientsLength)); + coefficients_.reset(new std::vector (coefficientsLength)); *coefficients_ = *(field_.getZero()->getCoefficients()); } else { ArrayRef c(coefficients); coefficientsLength -= firstNonZero; - coefficients_.reset(new Array (coefficientsLength)); + coefficients_.reset(new std::vector (coefficientsLength)); for (int i = 0; i < coefficientsLength; i++) { coefficients_[i] = c[i + firstNonZero]; } /* coefficientsLength -= firstNonZero; - coefficients_.reset(new Array(coefficientsLength - firstNonZero)); + coefficients_.reset(new std::vector(coefficientsLength - firstNonZero)); for (int i = 0; i < coefficientsLength; i++) { coefficients_[i] = coefficients[i + firstNonZero]; } @@ -135,7 +135,7 @@ Ref ModulusPoly::add(Ref other) { smallerCoefficients = largerCoefficients; largerCoefficients = temp; } - ArrayRef sumDiff (new Array(largerCoefficients->size())); + ArrayRef sumDiff (new std::vector(largerCoefficients->size())); int lengthDiff = largerCoefficients->size() - smallerCoefficients->size(); // Copy high-order terms only found in higher-degree polynomial's coefficients for (int i = 0; i < lengthDiff; i++) { @@ -171,7 +171,7 @@ Ref ModulusPoly::multiply(Ref other) { int aLength = aCoefficients->size(); ArrayRef bCoefficients = other->coefficients_; int bLength = bCoefficients->size(); - ArrayRef product (new Array(aLength + bLength - 1)); + ArrayRef product (new std::vector(aLength + bLength - 1)); for (i = 0; i < aLength; i++) { int aCoeff = aCoefficients[i]; for (j = 0; j < bLength; j++) { @@ -183,7 +183,7 @@ Ref ModulusPoly::multiply(Ref other) { Ref ModulusPoly::negative() { int size = coefficients_->size(); - ArrayRef negativeCoefficients (new Array(size)); + ArrayRef negativeCoefficients (new std::vector(size)); for (int i = 0; i < size; i++) { negativeCoefficients[i] = field_.subtract(0, coefficients_[i]); } @@ -198,7 +198,7 @@ Ref ModulusPoly::multiply(int scalar) { return Ref(this); } int size = coefficients_->size(); - ArrayRef product( new Array(size)); + ArrayRef product( new std::vector(size)); for (int i = 0; i < size; i++) { product[i] = field_.multiply(coefficients_[i], scalar); } @@ -213,7 +213,7 @@ Ref ModulusPoly::multiplyByMonomial(int degree, int coefficient) { return field_.getZero(); } int size = coefficients_->size(); - ArrayRef product (new Array(size + degree)); + ArrayRef product (new std::vector(size + degree)); for (int i = 0; i < size; i++) { product[i] = field_.multiply(coefficients_[i], coefficient); } diff --git a/src/zxing/zxing/pdf417/detector/PDF417Detector.cpp b/src/zxing/zxing/pdf417/detector/PDF417Detector.cpp index 55a5976..dbc51bd 100644 --- a/src/zxing/zxing/pdf417/detector/PDF417Detector.cpp +++ b/src/zxing/zxing/pdf417/detector/PDF417Detector.cpp @@ -151,7 +151,7 @@ ArrayRef< Ref > Detector::findVertices(Ref matrix, int r ArrayRef< Ref > result(16); bool found = false; - ArrayRef counters(new Array(START_PATTERN_LENGTH)); + ArrayRef counters(new std::vector(START_PATTERN_LENGTH)); // Top Left for (int i = 0; i < height; i += rowStep) { @@ -179,7 +179,7 @@ ArrayRef< Ref > Detector::findVertices(Ref matrix, int r } } - counters = new Array(STOP_PATTERN_LENGTH); + counters = new std::vector(STOP_PATTERN_LENGTH); // Top right if (found) { // Found the Bottom Left vertex @@ -221,7 +221,7 @@ ArrayRef< Ref > Detector::findVertices180(Ref matrix, in ArrayRef< Ref > result(16); bool found = false; - ArrayRef counters = new Array(START_PATTERN_REVERSE_LENGTH); + ArrayRef counters = new std::vector(START_PATTERN_REVERSE_LENGTH); // Top Left for (int i = height - 1; i > 0; i -= rowStep) { @@ -251,7 +251,7 @@ ArrayRef< Ref > Detector::findVertices180(Ref matrix, in } } - counters = new Array(STOP_PATTERN_REVERSE_LENGTH); + counters = new std::vector(STOP_PATTERN_REVERSE_LENGTH); // Top Right if (found) { // Found the Bottom Left vertex @@ -317,7 +317,7 @@ ArrayRef Detector::findGuardPattern(Ref matrix, if (counterPosition == patternLength - 1) { if (patternMatchVariance(counters, pattern, MAX_INDIVIDUAL_VARIANCE) < MAX_AVG_VARIANCE) { - ArrayRef result = new Array(2); + ArrayRef result = new std::vector(2); result[0] = patternStart; result[1] = x; return result; diff --git a/src/zxing/zxing/qrcode/detector/QRDetector.cpp b/src/zxing/zxing/qrcode/detector/QRDetector.cpp index 8dd3a33..90fe6db 100644 --- a/src/zxing/zxing/qrcode/detector/QRDetector.cpp +++ b/src/zxing/zxing/qrcode/detector/QRDetector.cpp @@ -118,7 +118,7 @@ Ref Detector::processFinderPatternInfo(Ref in Ref transform = createTransform(topLeft, topRight, bottomLeft, alignmentPattern, dimension); Ref bits(sampleGrid(image_, dimension, transform)); - ArrayRef< Ref > points(new Array< Ref >(alignmentPattern == 0 ? 3 : 4)); + ArrayRef< Ref > points(new std::vector< Ref >(alignmentPattern == 0 ? 3 : 4)); points[0].reset(bottomLeft); points[1].reset(topLeft); points[2].reset(topRight);