mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
C++ for r2690
git-svn-id: https://zxing.googlecode.com/svn/trunk@2691 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
9d1497fd27
commit
a3228a81a8
35
cpp/core/src/zxing/IllegalStateException.h
Normal file
35
cpp/core/src/zxing/IllegalStateException.h
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
||||||
|
|
||||||
|
#ifndef __ILLEGAL_STATE_EXCEPTION_H__
|
||||||
|
#define __ILLEGAL_STATE_EXCEPTION_H__
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 20011 ZXing authors
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may illegal use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <zxing/ReaderException.h>
|
||||||
|
|
||||||
|
namespace zxing {
|
||||||
|
|
||||||
|
class IllegalStateException : public ReaderException {
|
||||||
|
public:
|
||||||
|
IllegalStateException() throw() {}
|
||||||
|
IllegalStateException(const char *msg) throw() : ReaderException(msg) {}
|
||||||
|
~IllegalStateException() throw() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __ILLEGAL_STATE_EXCEPTION_H__
|
|
@ -22,13 +22,14 @@
|
||||||
#include <zxing/common/reedsolomon/ReedSolomonDecoder.h>
|
#include <zxing/common/reedsolomon/ReedSolomonDecoder.h>
|
||||||
#include <zxing/common/reedsolomon/ReedSolomonException.h>
|
#include <zxing/common/reedsolomon/ReedSolomonException.h>
|
||||||
#include <zxing/common/IllegalArgumentException.h>
|
#include <zxing/common/IllegalArgumentException.h>
|
||||||
|
#include <zxing/IllegalStateException.h>
|
||||||
|
|
||||||
using namespace std; // remove
|
using std::vector;
|
||||||
|
|
||||||
using zxing::Ref;
|
using zxing::Ref;
|
||||||
using zxing::ArrayRef;
|
using zxing::ArrayRef;
|
||||||
using zxing::ReedSolomonDecoder;
|
using zxing::ReedSolomonDecoder;
|
||||||
using zxing::GenericGFPoly;
|
using zxing::GenericGFPoly;
|
||||||
|
using zxing::IllegalStateException;
|
||||||
|
|
||||||
// VC++
|
// VC++
|
||||||
using zxing::GenericGF;
|
using zxing::GenericGF;
|
||||||
|
@ -107,6 +108,10 @@ vector<Ref<GenericGFPoly> > ReedSolomonDecoder::runEuclideanAlgorithm(Ref<Generi
|
||||||
}
|
}
|
||||||
|
|
||||||
t = q->multiply(tLast)->addOrSubtract(tLastLast);
|
t = q->multiply(tLast)->addOrSubtract(tLastLast);
|
||||||
|
|
||||||
|
if (r->getDegree() >= rLast->getDegree()) {
|
||||||
|
throw IllegalStateException("Division algorithm failed to reduce polynomial?");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sigmaTildeAtZero = t->getCoefficient(0);
|
int sigmaTildeAtZero = t->getCoefficient(0);
|
||||||
|
|
|
@ -38,8 +38,9 @@ public:
|
||||||
ReedSolomonDecoder(Ref<GenericGF> fld);
|
ReedSolomonDecoder(Ref<GenericGF> fld);
|
||||||
~ReedSolomonDecoder();
|
~ReedSolomonDecoder();
|
||||||
void decode(ArrayRef<int> received, int twoS);
|
void decode(ArrayRef<int> received, int twoS);
|
||||||
private:
|
|
||||||
std::vector<Ref<GenericGFPoly> > runEuclideanAlgorithm(Ref<GenericGFPoly> a, Ref<GenericGFPoly> b, int R);
|
std::vector<Ref<GenericGFPoly> > runEuclideanAlgorithm(Ref<GenericGFPoly> a, Ref<GenericGFPoly> b, int R);
|
||||||
|
|
||||||
|
private:
|
||||||
ArrayRef<int> findErrorLocations(Ref<GenericGFPoly> errorLocator);
|
ArrayRef<int> findErrorLocations(Ref<GenericGFPoly> errorLocator);
|
||||||
ArrayRef<int> findErrorMagnitudes(Ref<GenericGFPoly> errorEvaluator, ArrayRef<int> errorLocations);
|
ArrayRef<int> findErrorMagnitudes(Ref<GenericGFPoly> errorEvaluator, ArrayRef<int> errorLocations);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue