blob: cb88c62b3065e51b4f8b5132b58fc075ee9f48d8 [file] [log] [blame]
Dan Sinclair1770c022016-03-14 14:14:16 -04001// Copyright 2014 PDFium Authors. All rights reserved.
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
Dan Sinclaire7786682017-03-29 15:18:41 -04007#ifndef FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_
8#define FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_
Dan Sinclair1770c022016-03-14 14:14:16 -04009
Tom Sepez0804b3f2017-05-01 14:06:10 -070010#include <memory>
Tom Sepez8b6186f2017-03-28 12:06:45 -070011#include <vector>
12
Tom Sepez3627b502020-04-16 19:36:20 +000013#include "core/fxcrt/fx_memory_wrappers.h"
14
Dan Sinclair1770c022016-03-14 14:14:16 -040015class CBC_BarcodeRow;
tsepezaef780d2016-04-28 14:56:27 -070016
Tom Sepez6a43b5c2019-07-26 16:35:10 +000017class CBC_BarcodeMatrix final {
Dan Sinclair1770c022016-03-14 14:14:16 -040018 public:
Henrique Nakashima8ce49f82018-08-23 19:53:08 +000019 CBC_BarcodeMatrix(size_t width, size_t height);
Tom Sepez6a43b5c2019-07-26 16:35:10 +000020 ~CBC_BarcodeMatrix();
weili29b8ad02016-06-14 18:20:04 -070021
Henrique Nakashima98982a82018-08-22 22:26:06 +000022 CBC_BarcodeRow* getRow(size_t row) const { return m_matrix[row].get(); }
Henrique Nakashima81e08302018-08-22 21:28:36 +000023 size_t getWidth() const { return m_width; }
24 size_t getHeight() const { return m_height; }
Tom Sepez3627b502020-04-16 19:36:20 +000025 std::vector<uint8_t, FxAllocAllocator<uint8_t>> toBitArray();
Dan Sinclair1770c022016-03-14 14:14:16 -040026
27 private:
Tom Sepez0804b3f2017-05-01 14:06:10 -070028 std::vector<std::unique_ptr<CBC_BarcodeRow>> m_matrix;
Henrique Nakashima81e08302018-08-22 21:28:36 +000029 size_t m_width;
30 size_t m_height;
Dan Sinclair1770c022016-03-14 14:14:16 -040031};
32
Dan Sinclaire7786682017-03-29 15:18:41 -040033#endif // FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_