2 * Copyright 2013 ZXing authors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.google.zxing.qrcode.decoder;
19 import com.google.zxing.ResultPoint;
22 * Meta-data container for QR Code decoding. Instances of this class may be used to convey information back to the
23 * decoding caller. Callers are expected to process this.
25 * @see com.google.zxing.common.DecoderResult#getOther()
27 public final class QRCodeDecoderMetaData {
29 private final boolean mirrored;
31 QRCodeDecoderMetaData(boolean mirrored) {
32 this.mirrored = mirrored;
36 * @return true if the QR Code was mirrored.
38 public boolean isMirrored() {
43 * Apply the result points' order correction due to mirroring.
45 * @param points Array of points to apply mirror correction to.
47 public void applyMirroredCorrection(ResultPoint[] points) {
48 if (!mirrored || points == null || points.length < 3) {
51 ResultPoint bottomLeft = points[0];
52 points[0] = points[2];
53 points[2] = bottomLeft;
54 // No need to 'fix' top-left and alignment pattern.