Class: Qrio::VerticalMatch
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/vertical_match.rb', line 3
def self.build(offset, origin, terminus)
new(offset, origin, offset, terminus)
end
|
Instance Method Details
#breadth ⇒ Object
15
16
17
|
# File 'lib/qrio/vertical_match.rb', line 15
def breadth
width
end
|
#left_of?(other) ⇒ Boolean
19
20
21
|
# File 'lib/qrio/vertical_match.rb', line 19
def left_of?(other)
right < other.left
end
|
#length ⇒ Object
11
12
13
|
# File 'lib/qrio/vertical_match.rb', line 11
def length
height
end
|
#offset ⇒ Object
7
|
# File 'lib/qrio/vertical_match.rb', line 7
def offset; left; end
|
#offset_diff(other) ⇒ Object
27
28
29
|
# File 'lib/qrio/vertical_match.rb', line 27
def offset_diff(other)
left_of?(other) ? other.left - right : left - other.right
end
|
#origin ⇒ Object
8
|
# File 'lib/qrio/vertical_match.rb', line 8
def origin; top; end
|
#right_of?(other) ⇒ Boolean
23
24
25
|
# File 'lib/qrio/vertical_match.rb', line 23
def right_of?(other)
left > other.right
end
|
#terminus ⇒ Object
9
|
# File 'lib/qrio/vertical_match.rb', line 9
def terminus; bottom; end
|