Class: Qrio::HorizontalMatch
Constant Summary
FinderPatternSlice::ENDPOINT_TOLERANCE, FinderPatternSlice::LENGTH_TOLERANCE, FinderPatternSlice::OFFSET_TOLERANCE, FinderPatternSlice::ONE, FinderPatternSlice::THREE, FinderPatternSlice::WIDTH_TOLERANCE
Instance Attribute Summary
#neighbors
Attributes inherited from Region
#orientation, #x1, #x2, #y1, #y2
Class Method Summary
collapse
Instance Method Summary
collapse
#<=>, #adjacent?, #aspect_ratio, #breadth_diff, #breadth_matches?, build_matching, #class_name_prefix, #endpoints_match?, #initialize, #intersects?, #length_diff, #length_matches?, #matches_aspect_ratio?, matches_ratio?, #normalized_offset_diff, normalized_ratio, #offset_matches?, #origin_diff, #origin_matches?, #terminus_diff, #terminus_matches?, #to_s
Methods inherited from Region
#==, #bottom, #bottom_right, #center, #eql?, #hash, #height, #horizontal?, #initialize, #left, #orientation_matches?, #right, #rotate, #to_coordinates, #to_point_size, #to_s, #top, #top_left, #translate, #union, #vertical?, #width
Class Method Details
.build(offset, origin, terminus) ⇒ Object
3
4
5
|
# File 'lib/qrio/horizontal_match.rb', line 3
def self.build(offset, origin, terminus)
new(origin, offset, terminus, offset)
end
|
Instance Method Details
#above?(other) ⇒ Boolean
19
20
21
|
# File 'lib/qrio/horizontal_match.rb', line 19
def above?(other)
other.top > bottom
end
|
#below?(other) ⇒ Boolean
23
24
25
|
# File 'lib/qrio/horizontal_match.rb', line 23
def below?(other)
other.bottom < top
end
|
#breadth ⇒ Object
15
16
17
|
# File 'lib/qrio/horizontal_match.rb', line 15
def breadth
height
end
|
#length ⇒ Object
11
12
13
|
# File 'lib/qrio/horizontal_match.rb', line 11
def length
width
end
|
#offset ⇒ Object
7
|
# File 'lib/qrio/horizontal_match.rb', line 7
def offset; top; end
|
#offset_diff(other) ⇒ Object
27
28
29
|
# File 'lib/qrio/horizontal_match.rb', line 27
def offset_diff(other)
above?(other) ? other.top - bottom : top - other.bottom
end
|
#origin ⇒ Object
8
|
# File 'lib/qrio/horizontal_match.rb', line 8
def origin; left; end
|
#terminus ⇒ Object
9
|
# File 'lib/qrio/horizontal_match.rb', line 9
def terminus; right; end
|