mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Correctly set rotated points values. Closes Issue 1041.
The rotate code was setting the rotated points in a copy of the vector of points, rather than in the vector owned by the result. Use a reference instead of a copy so changes persist. git-svn-id: https://zxing.googlecode.com/svn/trunk@1995 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
274dd52968
commit
90f7e7b865
|
@ -44,6 +44,10 @@ const std::vector<Ref<ResultPoint> >& Result::getResultPoints() const {
|
||||||
return resultPoints_;
|
return resultPoints_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<Ref<ResultPoint> >& Result::getResultPoints() {
|
||||||
|
return resultPoints_;
|
||||||
|
}
|
||||||
|
|
||||||
BarcodeFormat Result::getBarcodeFormat() const {
|
BarcodeFormat Result::getBarcodeFormat() const {
|
||||||
return format_;
|
return format_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ public:
|
||||||
Ref<String> getText();
|
Ref<String> getText();
|
||||||
ArrayRef<unsigned char> getRawBytes();
|
ArrayRef<unsigned char> getRawBytes();
|
||||||
const std::vector<Ref<ResultPoint> >& getResultPoints() const;
|
const std::vector<Ref<ResultPoint> >& getResultPoints() const;
|
||||||
|
std::vector<Ref<ResultPoint> >& getResultPoints();
|
||||||
BarcodeFormat getBarcodeFormat() const;
|
BarcodeFormat getBarcodeFormat() const;
|
||||||
|
|
||||||
friend std::ostream& operator<<(std::ostream &out, Result& result);
|
friend std::ostream& operator<<(std::ostream &out, Result& result);
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace zxing {
|
||||||
result.putMetadata(ResultMetadataType.ORIENTATION, new Integer(orientation));
|
result.putMetadata(ResultMetadataType.ORIENTATION, new Integer(orientation));
|
||||||
*/
|
*/
|
||||||
// Update result points
|
// Update result points
|
||||||
std::vector<Ref<ResultPoint> > points (result->getResultPoints());
|
std::vector<Ref<ResultPoint> >& points (result->getResultPoints());
|
||||||
int height = rotatedImage->getHeight();
|
int height = rotatedImage->getHeight();
|
||||||
for (size_t i = 0; i < points.size(); i++) {
|
for (size_t i = 0; i < points.size(); i++) {
|
||||||
points[i].reset(new OneDResultPoint(height - points[i]->getY() - 1, points[i]->getX()));
|
points[i].reset(new OneDResultPoint(height - points[i]->getY() - 1, points[i]->getX()));
|
||||||
|
|
Loading…
Reference in a new issue