comparison mupdf-source/thirdparty/tesseract/src/ccstruct/image.cpp @ 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 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 // http://www.apache.org/licenses/LICENSE-2.0
6 // Unless required by applicable law or agreed to in writing, software
7 // distributed under the License is distributed on an "AS IS" BASIS,
8 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9 // See the License for the specific language governing permissions and
10 // limitations under the License.
11 ///////////////////////////////////////////////////////////////////////
12
13 // Include automatically generated configuration file if running autoconf.
14 #ifdef HAVE_CONFIG_H
15 # include "config_auto.h"
16 #endif
17
18 #include "image.h"
19
20 #include <allheaders.h>
21
22 namespace tesseract {
23
24 Image Image::clone() const {
25 return pix_ ? pixClone(pix_) : nullptr;
26 }
27
28 Image Image::copy() const {
29 return pixCopy(nullptr, pix_);
30 }
31
32 void Image::destroy() {
33 pixDestroy(&pix_);
34 }
35
36 bool Image::isZero() const {
37 l_int32 r = 0;
38 pixZero(pix_, &r);
39 return r == 1;
40 }
41
42 Image Image::operator|(Image i) const {
43 return pixOr(nullptr, pix_, i);
44 }
45
46 Image &Image::operator|=(Image i) {
47 pixOr(pix_, pix_, i);
48 return *this;
49 }
50
51 Image Image::operator&(Image i) const {
52 return pixAnd(nullptr, pix_, i);
53 }
54
55 Image &Image::operator&=(Image i) {
56 pixAnd(pix_, pix_, i);
57 return *this;
58 }
59
60 }