Class: Kracker::Zooka::Image
- Inherits:
-
Object
- Object
- Kracker::Zooka::Image
- Defined in:
- lib/kracker/zooka/image.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#blue ⇒ Object
Returns the value of attribute blue.
-
#blue_total ⇒ Object
Returns the value of attribute blue_total.
-
#brightness ⇒ Object
Returns the value of attribute brightness.
-
#brightness_total ⇒ Object
Returns the value of attribute brightness_total.
-
#data ⇒ Object
Returns the value of attribute data.
-
#green ⇒ Object
Returns the value of attribute green.
-
#green_total ⇒ Object
Returns the value of attribute green_total.
-
#pixels ⇒ Object
Returns the value of attribute pixels.
-
#red ⇒ Object
Returns the value of attribute red.
-
#red_total ⇒ Object
Returns the value of attribute red_total.
Instance Method Summary collapse
- #display_image_info ⇒ Object
-
#initialize(data) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(data) ⇒ Image
Returns a new instance of Image.
8 9 10 11 |
# File 'lib/kracker/zooka/image.rb', line 8 def initialize(data) @data = data compute_image_summary end |
Instance Attribute Details
#alpha ⇒ Object
Returns the value of attribute alpha.
5 6 7 |
# File 'lib/kracker/zooka/image.rb', line 5 def alpha @alpha end |
#blue ⇒ Object
Returns the value of attribute blue.
5 6 7 |
# File 'lib/kracker/zooka/image.rb', line 5 def blue @blue end |
#blue_total ⇒ Object
Returns the value of attribute blue_total.
6 7 8 |
# File 'lib/kracker/zooka/image.rb', line 6 def blue_total @blue_total end |
#brightness ⇒ Object
Returns the value of attribute brightness.
5 6 7 |
# File 'lib/kracker/zooka/image.rb', line 5 def brightness @brightness end |
#brightness_total ⇒ Object
Returns the value of attribute brightness_total.
6 7 8 |
# File 'lib/kracker/zooka/image.rb', line 6 def brightness_total @brightness_total end |
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/kracker/zooka/image.rb', line 4 def data @data end |
#green ⇒ Object
Returns the value of attribute green.
5 6 7 |
# File 'lib/kracker/zooka/image.rb', line 5 def green @green end |
#green_total ⇒ Object
Returns the value of attribute green_total.
6 7 8 |
# File 'lib/kracker/zooka/image.rb', line 6 def green_total @green_total end |
#pixels ⇒ Object
Returns the value of attribute pixels.
4 5 6 |
# File 'lib/kracker/zooka/image.rb', line 4 def pixels @pixels end |
#red ⇒ Object
Returns the value of attribute red.
5 6 7 |
# File 'lib/kracker/zooka/image.rb', line 5 def red @red end |
#red_total ⇒ Object
Returns the value of attribute red_total.
6 7 8 |
# File 'lib/kracker/zooka/image.rb', line 6 def red_total @red_total end |
Instance Method Details
#display_image_info ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/kracker/zooka/image.rb', line 13 def display_image_info puts '-'*22 puts " Width: #{@data.width}" puts " Height: #{@data.height}" puts " Avg. Red: #{@red}" puts " Avg. Green: #{@green}" puts " Avg. Blue: #{@blue}" puts " Total Red: #{@red_total}" puts " Total Green: #{@green_total}" puts " Total Blue: #{@blue_total}" puts '-'*22 end |