Class: BMFF::Box::ColourInformation

Inherits:
Base
  • Object
show all
Defined in:
lib/bmff/box/colour_information.rb

Overview

vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:

Instance Attribute Summary collapse

Attributes inherited from Base

#io, #largesize, #offset, #parent, #size, #type, #usertype

Instance Method Summary collapse

Methods inherited from Base

#actual_size, #container?, #eob?, #parse, register_box, register_uuid_box, #remaining_size, #root, #seek_to_end

Instance Attribute Details

#colour_primariesObject

Returns the value of attribute colour_primaries.



5
6
7
# File 'lib/bmff/box/colour_information.rb', line 5

def colour_primaries
  @colour_primaries
end

#colour_typeObject

Returns the value of attribute colour_type.



5
6
7
# File 'lib/bmff/box/colour_information.rb', line 5

def colour_type
  @colour_type
end

#full_range_flagObject

Returns the value of attribute full_range_flag.



5
6
7
# File 'lib/bmff/box/colour_information.rb', line 5

def full_range_flag
  @full_range_flag
end

#icc_profileObject

Returns the value of attribute icc_profile.



5
6
7
# File 'lib/bmff/box/colour_information.rb', line 5

def icc_profile
  @icc_profile
end

#matrix_coefficientsObject

Returns the value of attribute matrix_coefficients.



5
6
7
# File 'lib/bmff/box/colour_information.rb', line 5

def matrix_coefficients
  @matrix_coefficients
end

#reserved1Object

Returns the value of attribute reserved1.



5
6
7
# File 'lib/bmff/box/colour_information.rb', line 5

def reserved1
  @reserved1
end

#transfer_characteristicsObject

Returns the value of attribute transfer_characteristics.



5
6
7
# File 'lib/bmff/box/colour_information.rb', line 5

def transfer_characteristics
  @transfer_characteristics
end

Instance Method Details

#parse_dataObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/bmff/box/colour_information.rb', line 10

def parse_data
  super
  @colour_type = io.get_ascii(4)
  case @colour_type
  when "nclx"
    @colour_primaries = io.get_uint16
    @transfer_characteristics = io.get_uint16
    @matrix_coefficients = io.get_uint16
    tmp = io.get_uint8
    @full_range_flag = (tmp & 0x80) > 0
    @reserved1 = tmp & 0x7F
  when "rICC"
    @icc_profile = :restricted
  when "prof"
    @icc_profile = :unrestricted
  end
end