MCPcopy Create free account
hub / github.com/davisking/dlib / rectangle

Class rectangle

dlib/geometry/rectangle.h:19–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17// ----------------------------------------------------------------------------------------
18
19 class rectangle
20 {
21 /*!
22 INITIAL VALUE
23 The initial value of this object is defined by its constructor.
24
25 CONVENTION
26 left() == l
27 top() == t
28 right() == r
29 bottom() == b
30 !*/
31
32 public:
33
34 rectangle (
35 long l_,
36 long t_,
37 long r_,
38 long b_
39 ) :
40 l(l_),
41 t(t_),
42 r(r_),
43 b(b_)
44 {}
45
46 rectangle (
47 unsigned long w,
48 unsigned long h
49 ) :
50 l(0),
51 t(0),
52 r(static_cast<long>(w)-1),
53 b(static_cast<long>(h)-1)
54 {
55 DLIB_ASSERT((w > 0 && h > 0) || (w == 0 && h == 0),
56 "\trectangle(width,height)"
57 << "\n\twidth and height must be > 0 or both == 0"
58 << "\n\twidth: " << w
59 << "\n\theight: " << h
60 << "\n\tthis: " << this
61 );
62 }
63
64 rectangle (
65 const point& p
66 ) :
67 l(p.x()),
68 t(p.y()),
69 r(p.x()),
70 b(p.y())
71 {
72 }
73
74 rectangle (
75 const point& p1,
76 const point& p2

Callers 15

drectangleClass · 0.70
rectangleMethod · 0.70
operator +Method · 0.70
intersectMethod · 0.70
rectangle.hFile · 0.70
shrink_rectFunction · 0.70
scale_rectFunction · 0.70
resize_rectFunction · 0.70
resize_rect_widthFunction · 0.70
resize_rect_heightFunction · 0.70
move_rectFunction · 0.70
get_rectFunction · 0.70

Calls

no outgoing calls

Tested by 11

run_test2Function · 0.40
geometry_testFunction · 0.40
test_border_enumeratorFunction · 0.40
matrix_testFunction · 0.40
image_testFunction · 0.40
test_integral_imageFunction · 0.40
image_potts_problemMethod · 0.40
color_boxMethod · 0.40
winMethod · 0.40
mainFunction · 0.40