tesseract  5.0.0-alpha-619-ge9db
rect.cpp File Reference
#include "rect.h"
#include <tesseract/strngs.h>

Go to the source code of this file.

Functions

DLLSYM TBOXoperator+= (TBOX &op1, const TBOX &op2)
 
TBOXoperator&= (TBOX &op1, const TBOX &op2)
 

Function Documentation

◆ operator&=()

TBOX& operator&= ( TBOX op1,
const TBOX op2 
)

Definition at line 222 of file rect.cpp.

230  {
231  if (op1.overlap (op2)) {
232  if (op2.bot_left.x () > op1.bot_left.x ())
233  op1.bot_left.set_x (op2.bot_left.x ());
234 
235  if (op2.top_right.x () < op1.top_right.x ())
236  op1.top_right.set_x (op2.top_right.x ());
237 
238  if (op2.bot_left.y () > op1.bot_left.y ())
239  op1.bot_left.set_y (op2.bot_left.y ());
240 
241  if (op2.top_right.y () < op1.top_right.y ())
242  op1.top_right.set_y (op2.top_right.y ());
243  }

◆ operator+=()

DLLSYM TBOX& operator+= ( TBOX op1,
const TBOX op2 
)

Definition at line 198 of file rect.cpp.

207  {
208  if (op2.bot_left.x () < op1.bot_left.x ())
209  op1.bot_left.set_x (op2.bot_left.x ());
210 
211  if (op2.top_right.x () > op1.top_right.x ())
212  op1.top_right.set_x (op2.top_right.x ());
213 
214  if (op2.bot_left.y () < op1.bot_left.y ())
ICOORD::set_x
void set_x(int16_t xin)
rewrite function
Definition: points.h:60
TBOX::overlap
bool overlap(const TBOX &box) const
Definition: rect.h:350
ICOORD::x
int16_t x() const
access function
Definition: points.h:51
ICOORD::set_y
void set_y(int16_t yin)
rewrite function
Definition: points.h:64
ICOORD::y
int16_t y() const
access_function
Definition: points.h:55