blob: 65eea88f7fcf82919221fe2779b32b0c299ab433 [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_PDF417WRITER_H_
8#define FXBARCODE_PDF417_BC_PDF417WRITER_H_
Dan Sinclair1770c022016-03-14 14:14:16 -04009
Tom Sepezdf2f16a2021-07-27 21:41:48 +000010#include <stddef.h>
11
Tom Sepez8b6186f2017-03-28 12:06:45 -070012#include <vector>
13
Tom Sepez3627b502020-04-16 19:36:20 +000014#include "core/fxcrt/fx_memory_wrappers.h"
Tom Sepez1e151c62021-11-22 23:46:09 +000015#include "core/fxcrt/widestring.h"
Dan Sinclaire7786682017-03-29 15:18:41 -040016#include "fxbarcode/BC_TwoDimWriter.h"
Dan Sinclaira98600a2016-03-21 15:15:56 -040017
Tom Sepez55865452018-08-27 20:18:04 +000018class CBC_PDF417Writer final : public CBC_TwoDimWriter {
Dan Sinclair1770c022016-03-14 14:14:16 -040019 public:
20 CBC_PDF417Writer();
weili29b8ad02016-06-14 18:20:04 -070021 ~CBC_PDF417Writer() override;
22
Tom Sepez3627b502020-04-16 19:36:20 +000023 std::vector<uint8_t, FxAllocAllocator<uint8_t>>
24 Encode(WideStringView contents, int32_t* pOutWidth, int32_t* pOutHeight);
weili29b8ad02016-06-14 18:20:04 -070025
26 // CBC_TwoDimWriter
tsepezd19e9122016-11-02 15:43:18 -070027 bool SetErrorCorrectionLevel(int32_t level) override;
weili29b8ad02016-06-14 18:20:04 -070028
Dan Sinclair1770c022016-03-14 14:14:16 -040029 private:
Tom Sepez3627b502020-04-16 19:36:20 +000030 void RotateArray(std::vector<uint8_t, FxAllocAllocator<uint8_t>>* bitarray,
tsepez82aa3962017-01-20 12:59:50 -080031 int32_t width,
32 int32_t height);
Dan Sinclair1770c022016-03-14 14:14:16 -040033};
34
Dan Sinclaire7786682017-03-29 15:18:41 -040035#endif // FXBARCODE_PDF417_BC_PDF417WRITER_H_