/* * Copyright 2016 Nu-book Inc. * Copyright 2016 ZXing authors */ // SPDX-License-Identifier: Apache-2.0 #pragma once #include "ZXNullable.h" #include "ResultPoint.h" namespace ZXing { namespace Pdf417 { /** * @author Guenther Grau */ class BoundingBox { int _imgWidth; int _imgHeight; Nullable _topLeft; Nullable _bottomLeft; Nullable _topRight; Nullable _bottomRight; int _minX; int _maxX; int _minY; int _maxY; public: BoundingBox(); int minX() const { return _minX; } int maxX() const { return _maxX; } int minY() const { return _minY; } int maxY() const { return _maxY; } Nullable topLeft() const { return _topLeft; } Nullable topRight() const { return _topRight; } Nullable bottomLeft() const { return _bottomLeft; } Nullable bottomRight() const { return _bottomRight; } static bool Create(int imgWidth, int imgHeight, const Nullable& topLeft, const Nullable& bottomLeft, const Nullable& topRight, const Nullable& bottomRight, BoundingBox& result); static bool Merge(const Nullable& leftBox, const Nullable& rightBox, Nullable& result); static bool AddMissingRows(const BoundingBox&box, int missingStartRows, int missingEndRows, bool isLeft, BoundingBox& result); private: void calculateMinMaxValues(); }; } // Pdf417 } // ZXing