Class: PSD::BlackWhite
- Defined in:
- lib/psd/layer/info/black_white.rb
Instance Attribute Summary collapse
-
#blue ⇒ Object
readonly
Returns the value of attribute blue.
-
#cyan ⇒ Object
readonly
Returns the value of attribute cyan.
-
#green ⇒ Object
readonly
Returns the value of attribute green.
-
#magenta ⇒ Object
readonly
Returns the value of attribute magenta.
-
#preset_id ⇒ Object
readonly
Returns the value of attribute preset_id.
-
#preset_name ⇒ Object
readonly
Returns the value of attribute preset_name.
-
#red ⇒ Object
readonly
Returns the value of attribute red.
-
#tint ⇒ Object
readonly
Returns the value of attribute tint.
-
#tint_color ⇒ Object
readonly
Returns the value of attribute tint_color.
-
#yellow ⇒ Object
readonly
Returns the value of attribute yellow.
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
#blue ⇒ Object (readonly)
Returns the value of attribute blue.
9 10 11 |
# File 'lib/psd/layer/info/black_white.rb', line 9 def blue @blue end |
#cyan ⇒ Object (readonly)
Returns the value of attribute cyan.
9 10 11 |
# File 'lib/psd/layer/info/black_white.rb', line 9 def cyan @cyan end |
#green ⇒ Object (readonly)
Returns the value of attribute green.
9 10 11 |
# File 'lib/psd/layer/info/black_white.rb', line 9 def green @green end |
#magenta ⇒ Object (readonly)
Returns the value of attribute magenta.
9 10 11 |
# File 'lib/psd/layer/info/black_white.rb', line 9 def magenta @magenta end |
#preset_id ⇒ Object (readonly)
Returns the value of attribute preset_id.
10 11 12 |
# File 'lib/psd/layer/info/black_white.rb', line 10 def preset_id @preset_id end |
#preset_name ⇒ Object (readonly)
Returns the value of attribute preset_name.
10 11 12 |
# File 'lib/psd/layer/info/black_white.rb', line 10 def preset_name @preset_name end |
#red ⇒ Object (readonly)
Returns the value of attribute red.
9 10 11 |
# File 'lib/psd/layer/info/black_white.rb', line 9 def red @red end |
#tint ⇒ Object (readonly)
Returns the value of attribute tint.
10 11 12 |
# File 'lib/psd/layer/info/black_white.rb', line 10 def tint @tint end |
#tint_color ⇒ Object (readonly)
Returns the value of attribute tint_color.
10 11 12 |
# File 'lib/psd/layer/info/black_white.rb', line 10 def tint_color @tint_color end |
#yellow ⇒ Object (readonly)
Returns the value of attribute yellow.
9 10 11 |
# File 'lib/psd/layer/info/black_white.rb', line 9 def yellow @yellow end |
Class Method Details
.should_parse?(key) ⇒ Boolean
5 6 7 |
# File 'lib/psd/layer/info/black_white.rb', line 5 def self.should_parse?(key) key == 'blwh' end |
Instance Method Details
#parse ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/psd/layer/info/black_white.rb', line 12 def parse @file.seek 4, IO::SEEK_CUR @data = Descriptor.new(@file).parse @red = @data['Rd '] @yellow = @data['Yllw'] @green = @data['Grn '] @cyan = @data['Cyn '] @blue = @data['Bl '] @magenta = @data['Mgnt'] @tint = @data['useTint'] @tint_color = { red: @data['tintColor']['Rd '], green: @data['tintColor']['Grn '], blue: @data['tintColor']['Bl '] } @preset_id = @data['bwPresetKind'] @preset_name = @data['blackAndWhitePresetFileName'] end |