From 0cd476acbbfe4b81fb6958eda0da0044b377fa29 Mon Sep 17 00:00:00 2001 From: Nikola Vuckovic Date: Thu, 9 May 2024 11:54:34 +0200 Subject: [PATCH] add missing headers --- cpp/core/src/zxing/Binarizer.h | 52 +++++++++++++++++++++++ cpp/core/src/zxing/DecodeHints.h | 73 ++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 cpp/core/src/zxing/Binarizer.h create mode 100644 cpp/core/src/zxing/DecodeHints.h diff --git a/cpp/core/src/zxing/Binarizer.h b/cpp/core/src/zxing/Binarizer.h new file mode 100644 index 000000000..39b93f42c --- /dev/null +++ b/cpp/core/src/zxing/Binarizer.h @@ -0,0 +1,52 @@ +#pragma once + +/* + * Binarizer.h + * zxing + * + * Copyright 2010 ZXing authors All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include // for ResultPoint +#include "zxing/LuminanceSource.h" // for LuminanceSource +#include // for Ref, Counted +#include "zxing/common/Error.hpp" + +namespace pping { + +class BitArray; +class BitMatrix; +class LuminanceSource; + +class Binarizer : public Counted { + private: + Ref source_; + + public: + Binarizer(Ref source) noexcept; + virtual ~Binarizer() = default; + + virtual FallibleRef getBlackRow (int y, Ref row) const MB_NOEXCEPT_EXCEPT_BADALLOC = 0; + virtual FallibleRef getBlackMatrix( ) const MB_NOEXCEPT_EXCEPT_BADALLOC = 0; + + auto const & getLuminanceSource() const noexcept { return source_; } + virtual Ref createBinarizer(Ref source) const MB_NOEXCEPT_EXCEPT_BADALLOC = 0; + + int getWidth () const noexcept; + int getHeight() const noexcept; + +}; + +} diff --git a/cpp/core/src/zxing/DecodeHints.h b/cpp/core/src/zxing/DecodeHints.h new file mode 100644 index 000000000..c1a599c06 --- /dev/null +++ b/cpp/core/src/zxing/DecodeHints.h @@ -0,0 +1,73 @@ +#pragma once +/* + * DecodeHintType.h + * zxing + * + * Copyright 2010 ZXing authors All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include // for Str +#include // for Binarizer +#include // for BarcodeFormat, BarcodeFormat::AZTEC_BARCODE, BarcodeFormat::CODE_128, BarcodeFormat::CODE_39, BarcodeFormat::Barcod... +#include // for ResultPointCallback + +#include "zxing/common/Counted.h" // for Ref + +namespace pping { + +typedef unsigned int DecodeHintType; + +class DecodeHints { + + private: + + DecodeHintType hints; + + Ref callback; + + public: + + static const DecodeHintType BARCODEFORMAT_QR_CODE_HINT = 1 << static_cast(BarcodeFormat::QR_CODE); + static const DecodeHintType BARCODEFORMAT_DATA_MATRIX_HINT = 1 << static_cast(BarcodeFormat::DATA_MATRIX); + static const DecodeHintType BARCODEFORMAT_UPC_E_HINT = 1 << static_cast(BarcodeFormat::UPC_E); + static const DecodeHintType BARCODEFORMAT_UPC_A_HINT = 1 << static_cast(BarcodeFormat::UPC_A); + static const DecodeHintType BARCODEFORMAT_EAN_8_HINT = 1 << static_cast(BarcodeFormat::EAN_8); + static const DecodeHintType BARCODEFORMAT_EAN_13_HINT = 1 << static_cast(BarcodeFormat::EAN_13); + static const DecodeHintType BARCODEFORMAT_CODE_128_HINT = 1 << static_cast(BarcodeFormat::CODE_128); + static const DecodeHintType BARCODEFORMAT_CODE_39_HINT = 1 << static_cast(BarcodeFormat::CODE_39); + static const DecodeHintType BARCODEFORMAT_ITF_HINT = 1 << static_cast(BarcodeFormat::ITF); + static const DecodeHintType BARCODEFORMAT_AZTEC_HINT = 1 << static_cast(BarcodeFormat::AZTEC_BARCODE); + static const DecodeHintType CHARACTER_SET = 1 << 30; + static const DecodeHintType TRYHARDER_HINT = static_cast< DecodeHintType >( 1 << 31 ); + + static const DecodeHints PRODUCT_HINT; + static const DecodeHints ONED_HINT; + static const DecodeHints DEFAULT_HINT; + + DecodeHints(); + DecodeHints(DecodeHintType init); + + void addFormat(BarcodeFormat toadd) noexcept; + bool containsFormat(BarcodeFormat tocheck) const noexcept; + void setTryHarder(bool toset); + bool getTryHarder() const; + + void setResultPointCallback(Ref const&); + Ref getResultPointCallback() const; + +}; + +} +