tesseract  5.0.0
image.cpp
Go to the documentation of this file.
1 // 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.
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 
25  return pix_ ? pixClone(pix_) : nullptr;
26 }
27 
28 Image Image::copy() const {
29  return pixCopy(nullptr, pix_);
30 }
31 
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 
43  return pixOr(nullptr, pix_, i);
44 }
45 
47  pixOr(pix_, pix_, i);
48  return *this;
49 }
50 
52  return pixAnd(nullptr, pix_, i);
53 }
54 
56  pixAnd(pix_, pix_, i);
57  return *this;
58 }
59 
60 }
Pix * pix_
Definition: image.h:27
Image copy() const
Definition: image.cpp:28
Image & operator|=(Image)
Definition: image.cpp:46
Image clone() const
Definition: image.cpp:24
void destroy()
Definition: image.cpp:32
Image & operator&=(Image)
Definition: image.cpp:55
Image operator&(Image) const
Definition: image.cpp:51
bool isZero() const
Definition: image.cpp:36
Image operator|(Image) const
Definition: image.cpp:42