• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // 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 
7 #ifndef FXBARCODE_COMMON_BC_COMMONBYTEMATRIX_H_
8 #define FXBARCODE_COMMON_BC_COMMONBYTEMATRIX_H_
9 
10 #include <stdint.h>
11 
12 #include <vector>
13 
14 #include "core/fxcrt/fx_system.h"
15 #include "third_party/base/span.h"
16 
17 class CBC_CommonByteMatrix final {
18  public:
19   CBC_CommonByteMatrix(int32_t width, int32_t height);
20   ~CBC_CommonByteMatrix();
21 
GetWidth()22   int32_t GetWidth() const { return m_width; }
GetHeight()23   int32_t GetHeight() const { return m_height; }
GetArray()24   pdfium::span<const uint8_t> GetArray() const { return m_bytes; }
25   uint8_t Get(int32_t x, int32_t y) const;
26 
27   void Set(int32_t x, int32_t y, int32_t value);
28   void Set(int32_t x, int32_t y, uint8_t value);
29   void clear(uint8_t value);
30 
31  private:
32   int32_t m_width;
33   int32_t m_height;
34   std::vector<uint8_t> m_bytes;
35 };
36 
37 #endif  // FXBARCODE_COMMON_BC_COMMONBYTEMATRIX_H_
38