/src/tesseract/src/ccstruct/image.cpp
Line | Count | Source (jump to first uncovered line) |
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 | 335k | Image Image::clone() const { |
25 | 335k | return pix_ ? pixClone(pix_) : nullptr; |
26 | 335k | } |
27 | | |
28 | 30.9k | Image Image::copy() const { |
29 | 30.9k | return pixCopy(nullptr, pix_); |
30 | 30.9k | } |
31 | | |
32 | 6.37M | void Image::destroy() { |
33 | 6.37M | pixDestroy(&pix_); |
34 | 6.37M | } |
35 | | |
36 | 0 | bool Image::isZero() const { |
37 | 0 | l_int32 r = 0; |
38 | 0 | pixZero(pix_, &r); |
39 | 0 | return r == 1; |
40 | 0 | } |
41 | | |
42 | 0 | Image Image::operator|(Image i) const { |
43 | 0 | return pixOr(nullptr, pix_, i); |
44 | 0 | } |
45 | | |
46 | 0 | Image &Image::operator|=(Image i) { |
47 | 0 | pixOr(pix_, pix_, i); |
48 | 0 | return *this; |
49 | 0 | } |
50 | | |
51 | 0 | Image Image::operator&(Image i) const { |
52 | 0 | return pixAnd(nullptr, pix_, i); |
53 | 0 | } |
54 | | |
55 | 0 | Image &Image::operator&=(Image i) { |
56 | 0 | pixAnd(pix_, pix_, i); |
57 | 0 | return *this; |
58 | 0 | } |
59 | | |
60 | | } |