xref: /aosp_15_r20/external/pdfium/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2014 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_
8 #define FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_
9 
10 #include <stdint.h>
11 
12 #include <memory>
13 #include <vector>
14 
15 #include "core/fxcrt/data_vector.h"
16 
17 class CBC_BarcodeRow;
18 
19 class CBC_BarcodeMatrix final {
20  public:
21   CBC_BarcodeMatrix(size_t width, size_t height);
22   ~CBC_BarcodeMatrix();
23 
getRow(size_t row)24   CBC_BarcodeRow* getRow(size_t row) const { return m_matrix[row].get(); }
getWidth()25   size_t getWidth() const { return m_width; }
getHeight()26   size_t getHeight() const { return m_height; }
27   DataVector<uint8_t> toBitArray();
28 
29  private:
30   std::vector<std::unique_ptr<CBC_BarcodeRow>> m_matrix;
31   size_t m_width;
32   size_t m_height;
33 };
34 
35 #endif  // FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_
36