Class: Handle

Inherits:
Object
  • Object
show all
Includes:
BinData
Defined in:
lib/handle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Handle

Returns a new instance of Handle.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/handle.rb', line 10

def initialize(data)
  @transformation_matrix = Matrix.build(3,3) do
    DoubleLe.read(data)
  end
  LOGGER.debug "matrix is #{@transformation_matrix.inspect}"
  @parameterized_location = ParameterizedLocation.new(
    BinData::Uint32le.read(data),
    DoubleLe.read(data)
  )
  LOGGER.debug "parameterized location is #{@parameterized_location.inspect}"

  # pixel location
  @pixel_location = Point.new(
    DoubleLe.read(data),
    DoubleLe.read(data)
  )
  LOGGER.debug "pixel_location is #{@pixel_location.inspect}"

  @type = BinData::Int16le.read(data)
  LOGGER.debug "handle type is #{@type}"
end

Instance Attribute Details

#parameterized_locationObject (readonly)

Returns the value of attribute parameterized_location.



4
5
6
# File 'lib/handle.rb', line 4

def parameterized_location
  @parameterized_location
end

#pixel_locationObject (readonly)

Returns the value of attribute pixel_location.



4
5
6
# File 'lib/handle.rb', line 4

def pixel_location
  @pixel_location
end

#transformation_matrixObject (readonly)

Returns the value of attribute transformation_matrix.



4
5
6
# File 'lib/handle.rb', line 4

def transformation_matrix
  @transformation_matrix
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/handle.rb', line 4

def type
  @type
end