xref: /aosp_15_r20/external/pdfium/fxbarcode/pdf417/BC_PDF417Writer.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_PDF417WRITER_H_
8 #define FXBARCODE_PDF417_BC_PDF417WRITER_H_
9 
10 #include <stddef.h>
11 #include <stdint.h>
12 
13 #include "core/fxcrt/data_vector.h"
14 #include "core/fxcrt/widestring.h"
15 #include "fxbarcode/BC_TwoDimWriter.h"
16 
17 class CBC_PDF417Writer final : public CBC_TwoDimWriter {
18  public:
19   CBC_PDF417Writer();
20   ~CBC_PDF417Writer() override;
21 
22   DataVector<uint8_t> Encode(WideStringView contents,
23                              int32_t* pOutWidth,
24                              int32_t* pOutHeight);
25 
26   // CBC_TwoDimWriter
27   bool SetErrorCorrectionLevel(int32_t level) override;
28 
29  private:
30   void RotateArray(DataVector<uint8_t>* bitarray,
31                    int32_t width,
32                    int32_t height);
33 };
34 
35 #endif  // FXBARCODE_PDF417_BC_PDF417WRITER_H_
36