Class: AdbSdkLib::Pixel

Inherits:
Object
  • Object
show all
Defined in:
lib/adb_sdklib/raw_image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#alphaObject

Returns the value of attribute alpha.



6
7
8
# File 'lib/adb_sdklib/raw_image.rb', line 6

def alpha
  @alpha
end

#argbObject

Returns the value of attribute argb.



6
7
8
# File 'lib/adb_sdklib/raw_image.rb', line 6

def argb
  @argb
end

#blueObject

Returns the value of attribute blue.



6
7
8
# File 'lib/adb_sdklib/raw_image.rb', line 6

def blue
  @blue
end

#greenObject

Returns the value of attribute green.



6
7
8
# File 'lib/adb_sdklib/raw_image.rb', line 6

def green
  @green
end

#redObject

Returns the value of attribute red.



6
7
8
# File 'lib/adb_sdklib/raw_image.rb', line 6

def red
  @red
end

#xObject

Returns the value of attribute x.



6
7
8
# File 'lib/adb_sdklib/raw_image.rb', line 6

def x
  @x
end

#yObject

Returns the value of attribute y.



6
7
8
# File 'lib/adb_sdklib/raw_image.rb', line 6

def y
  @y
end