blob: 2278f931e86c1ddfeeea05902197d62b69484a1a [file] [log] [blame]
Dan Sinclaira98600a2016-03-21 15:15:56 -04001// Copyright 2016 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 * Copyright 2011 ZXing authors
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
Dan Sinclaire7786682017-03-29 15:18:41 -040022#include "fxbarcode/cbc_codebase.h"
Dan Sinclaira98600a2016-03-21 15:15:56 -040023
Tom Sepezea23e0a2017-05-01 14:24:19 -070024#include <utility>
25
Dan Sinclaire7786682017-03-29 15:18:41 -040026#include "fxbarcode/BC_Writer.h"
Dan Sinclaira98600a2016-03-21 15:15:56 -040027
Tom Sepezea23e0a2017-05-01 14:24:19 -070028CBC_CodeBase::CBC_CodeBase(std::unique_ptr<CBC_Writer> pWriter)
29 : m_pBCWriter(std::move(pWriter)) {}
Dan Sinclaira98600a2016-03-21 15:15:56 -040030
31CBC_CodeBase::~CBC_CodeBase() {}
32
tsepezd19e9122016-11-02 15:43:18 -070033bool CBC_CodeBase::SetCharEncoding(int32_t encoding) {
Lei Zhang1badb852017-04-20 15:58:56 -070034 return m_pBCWriter->SetCharEncoding(encoding);
Dan Sinclaira98600a2016-03-21 15:15:56 -040035}
36
tsepezd19e9122016-11-02 15:43:18 -070037bool CBC_CodeBase::SetModuleHeight(int32_t moduleHeight) {
Lei Zhang1badb852017-04-20 15:58:56 -070038 return m_pBCWriter->SetModuleHeight(moduleHeight);
Dan Sinclaira98600a2016-03-21 15:15:56 -040039}
40
tsepezd19e9122016-11-02 15:43:18 -070041bool CBC_CodeBase::SetModuleWidth(int32_t moduleWidth) {
Lei Zhang1badb852017-04-20 15:58:56 -070042 return m_pBCWriter->SetModuleWidth(moduleWidth);
Dan Sinclaira98600a2016-03-21 15:15:56 -040043}
44
tsepezd19e9122016-11-02 15:43:18 -070045bool CBC_CodeBase::SetHeight(int32_t height) {
Lei Zhang1badb852017-04-20 15:58:56 -070046 return m_pBCWriter->SetHeight(height);
Dan Sinclaira98600a2016-03-21 15:15:56 -040047}
48
tsepezd19e9122016-11-02 15:43:18 -070049bool CBC_CodeBase::SetWidth(int32_t width) {
Lei Zhang1badb852017-04-20 15:58:56 -070050 return m_pBCWriter->SetWidth(width);
Dan Sinclaira98600a2016-03-21 15:15:56 -040051}
52
53void CBC_CodeBase::SetBackgroundColor(FX_ARGB backgroundColor) {
Lei Zhang1badb852017-04-20 15:58:56 -070054 m_pBCWriter->SetBackgroundColor(backgroundColor);
Dan Sinclaira98600a2016-03-21 15:15:56 -040055}
56
57void CBC_CodeBase::SetBarcodeColor(FX_ARGB foregroundColor) {
Lei Zhang1badb852017-04-20 15:58:56 -070058 m_pBCWriter->SetBarcodeColor(foregroundColor);
Dan Sinclaira98600a2016-03-21 15:15:56 -040059}