Class: PSD::ColorBalance
- Defined in:
- lib/psd/layer/info/color_balance.rb
Instance Attribute Summary collapse
-
#highlights ⇒ Object
readonly
Returns the value of attribute highlights.
-
#midtones ⇒ Object
readonly
Returns the value of attribute midtones.
-
#preserve_luminosity ⇒ Object
readonly
Returns the value of attribute preserve_luminosity.
-
#shadows ⇒ Object
readonly
Returns the value of attribute shadows.
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
#highlights ⇒ Object (readonly)
Returns the value of attribute highlights.
9 10 11 |
# File 'lib/psd/layer/info/color_balance.rb', line 9 def highlights @highlights end |
#midtones ⇒ Object (readonly)
Returns the value of attribute midtones.
9 10 11 |
# File 'lib/psd/layer/info/color_balance.rb', line 9 def midtones @midtones end |
#preserve_luminosity ⇒ Object (readonly)
Returns the value of attribute preserve_luminosity.
9 10 11 |
# File 'lib/psd/layer/info/color_balance.rb', line 9 def preserve_luminosity @preserve_luminosity end |
#shadows ⇒ Object (readonly)
Returns the value of attribute shadows.
9 10 11 |
# File 'lib/psd/layer/info/color_balance.rb', line 9 def shadows @shadows end |
Class Method Details
.should_parse?(key) ⇒ Boolean
5 6 7 |
# File 'lib/psd/layer/info/color_balance.rb', line 5 def self.should_parse?(key) key == 'blnc' end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/psd/layer/info/color_balance.rb', line 11 def parse @shadows, @midtones, @highlights = 3.times.map do { cyan_red: @file.read_short, magenta_green: @file.read_short, yellow_blue: @file.read_short } end @preserve_luminosity = @file.read_short > 0 end |