Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/tesseract/src/ccstruct/image.h @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 /////////////////////////////////////////////////////////////////////// | |
| 2 // File: image.h | |
| 3 // Description: Image wrapper. | |
| 4 // | |
| 5 // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 6 // you may not use this file except in compliance with the License. | |
| 7 // You may obtain a copy of the License at | |
| 8 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 // Unless required by applicable law or agreed to in writing, software | |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 // See the License for the specific language governing permissions and | |
| 13 // limitations under the License. | |
| 14 /////////////////////////////////////////////////////////////////////// | |
| 15 | |
| 16 #ifndef TESSERACT_CCSTRUCT_IMAGE_H_ | |
| 17 #define TESSERACT_CCSTRUCT_IMAGE_H_ | |
| 18 | |
| 19 #include <tesseract/export.h> | |
| 20 | |
| 21 struct Pix; | |
| 22 | |
| 23 namespace tesseract { | |
| 24 | |
| 25 class TESS_API Image { | |
| 26 public: | |
| 27 Pix *pix_ = nullptr; | |
| 28 | |
| 29 public: | |
| 30 Image() = default; | |
| 31 Image(Pix *pix) : pix_(pix) {} | |
| 32 | |
| 33 // service | |
| 34 bool operator==(decltype(nullptr)) const { return pix_ == nullptr; } | |
| 35 bool operator!=(decltype(nullptr)) const { return pix_ != nullptr; } | |
| 36 explicit operator bool() const { return pix_ != nullptr; } | |
| 37 operator Pix *() const { return pix_; } | |
| 38 explicit operator Pix **() { return &pix_; } | |
| 39 Pix *operator->() const { return pix_; } | |
| 40 | |
| 41 // api | |
| 42 Image clone() const; // increases refcount | |
| 43 Image copy() const; // does full copy | |
| 44 void destroy(); | |
| 45 bool isZero() const; | |
| 46 | |
| 47 // ops | |
| 48 Image operator|(Image) const; | |
| 49 Image &operator|=(Image); | |
| 50 Image operator&(Image) const; | |
| 51 Image &operator&=(Image); | |
| 52 }; | |
| 53 | |
| 54 } // namespace tesseract | |
| 55 | |
| 56 #endif // TESSERACT_CCSTRUCT_IMAGE_H_ |
