Class: PSD::HueSaturation
- Defined in:
- lib/psd/layer/info/hue_saturation.rb
Instance Attribute Summary collapse
-
#colorization ⇒ Object
readonly
Returns the value of attribute colorization.
-
#master ⇒ Object
readonly
Returns the value of attribute master.
-
#range_values ⇒ Object
readonly
Returns the value of attribute range_values.
-
#setting_values ⇒ Object
readonly
Returns the value of attribute setting_values.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from LayerInfo
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from LayerInfo
Constructor Details
This class inherits a constructor from PSD::LayerInfo
Instance Attribute Details
#colorization ⇒ Object (readonly)
Returns the value of attribute colorization.
9 10 11 |
# File 'lib/psd/layer/info/hue_saturation.rb', line 9 def colorization @colorization end |
#master ⇒ Object (readonly)
Returns the value of attribute master.
9 10 11 |
# File 'lib/psd/layer/info/hue_saturation.rb', line 9 def master @master end |
#range_values ⇒ Object (readonly)
Returns the value of attribute range_values.
9 10 11 |
# File 'lib/psd/layer/info/hue_saturation.rb', line 9 def range_values @range_values end |
#setting_values ⇒ Object (readonly)
Returns the value of attribute setting_values.
9 10 11 |
# File 'lib/psd/layer/info/hue_saturation.rb', line 9 def setting_values @setting_values end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/psd/layer/info/hue_saturation.rb', line 9 def type @type end |
Class Method Details
.should_parse?(key) ⇒ Boolean
5 6 7 |
# File 'lib/psd/layer/info/hue_saturation.rb', line 5 def self.should_parse?(key) key == 'hue2' end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/psd/layer/info/hue_saturation.rb', line 11 def parse # Version @file.seek 2, IO::SEEK_CUR @type = @file.read_byte == 0 ? :hue : :colorization # Padding byte @file.seek 1, IO::SEEK_CUR @colorization = { hue: @file.read_short, saturation: @file.read_short, lightness: @file.read_short } @master = { hue: @file.read_short, saturation: @file.read_short, lightness: @file.read_short } @range_values = [] @setting_values = [] 6.times do @range_values << 4.times.map { @file.read_short } @setting_values << 3.times.map { @file.read_short } end end |