Class: AdbSdkLib::Pixel
- Inherits:
-
Object
- Object
- AdbSdkLib::Pixel
- Defined in:
- lib/adb_sdklib/raw_image.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#argb ⇒ Object
Returns the value of attribute argb.
-
#blue ⇒ Object
Returns the value of attribute blue.
-
#green ⇒ Object
Returns the value of attribute green.
-
#red ⇒ Object
Returns the value of attribute red.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, argb) ⇒ Pixel
constructor
A new instance of Pixel.
Constructor Details
#initialize(x, y, argb) ⇒ Pixel
Returns a new instance of Pixel.
8 9 10 11 12 13 14 15 16 |
# File 'lib/adb_sdklib/raw_image.rb', line 8 def initialize(x,y, argb) @x = x @y = y @argb = argb @alpha = (argb >> 8*3) & 0xFF @red = (argb >> 8*2) & 0xFF @green = (argb >> 8*1) & 0xFF @blue = (argb >> 8*0) & 0xFF end |
Instance Attribute Details
#alpha ⇒ Object
Returns the value of attribute alpha.
6 7 8 |
# File 'lib/adb_sdklib/raw_image.rb', line 6 def alpha @alpha end |
#argb ⇒ Object
Returns the value of attribute argb.
6 7 8 |
# File 'lib/adb_sdklib/raw_image.rb', line 6 def argb @argb end |
#blue ⇒ Object
Returns the value of attribute blue.
6 7 8 |
# File 'lib/adb_sdklib/raw_image.rb', line 6 def blue @blue end |
#green ⇒ Object
Returns the value of attribute green.
6 7 8 |
# File 'lib/adb_sdklib/raw_image.rb', line 6 def green @green end |
#red ⇒ Object
Returns the value of attribute red.
6 7 8 |
# File 'lib/adb_sdklib/raw_image.rb', line 6 def red @red end |
#x ⇒ Object
Returns the value of attribute x.
6 7 8 |
# File 'lib/adb_sdklib/raw_image.rb', line 6 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
6 7 8 |
# File 'lib/adb_sdklib/raw_image.rb', line 6 def y @y end |