Class: OpenCVColor::Colors
- Inherits:
-
Object
- Object
- OpenCVColor::Colors
- Includes:
- Enumerable
- Defined in:
- lib/opencv-color.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(image) ⇒ Colors
constructor
A new instance of Colors.
- #size ⇒ Object
Constructor Details
#initialize(image) ⇒ Colors
Returns a new instance of Colors.
9 10 11 |
# File 'lib/opencv-color.rb', line 9 def initialize(image) @image = image end |
Instance Method Details
#each(&block) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/opencv-color.rb', line 17 def each(&block) @image.height.times do |i| @image.width.times do |j| yield(@image[i, j]) end end end |
#size ⇒ Object
13 14 15 |
# File 'lib/opencv-color.rb', line 13 def size @image.height * @image.width end |