Class: PSD::Locked
Instance Attribute Summary collapse
-
#all_locked ⇒ Object
readonly
Returns the value of attribute all_locked.
-
#composite_locked ⇒ Object
readonly
Returns the value of attribute composite_locked.
-
#position_locked ⇒ Object
readonly
Returns the value of attribute position_locked.
-
#transparency_locked ⇒ Object
readonly
Returns the value of attribute transparency_locked.
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
#all_locked ⇒ Object (readonly)
Returns the value of attribute all_locked.
9 10 11 |
# File 'lib/psd/layer/info/locked.rb', line 9 def all_locked @all_locked end |
#composite_locked ⇒ Object (readonly)
Returns the value of attribute composite_locked.
9 10 11 |
# File 'lib/psd/layer/info/locked.rb', line 9 def composite_locked @composite_locked end |
#position_locked ⇒ Object (readonly)
Returns the value of attribute position_locked.
9 10 11 |
# File 'lib/psd/layer/info/locked.rb', line 9 def position_locked @position_locked end |
#transparency_locked ⇒ Object (readonly)
Returns the value of attribute transparency_locked.
9 10 11 |
# File 'lib/psd/layer/info/locked.rb', line 9 def transparency_locked @transparency_locked end |
Class Method Details
.should_parse?(key) ⇒ Boolean
5 6 7 |
# File 'lib/psd/layer/info/locked.rb', line 5 def self.should_parse?(key) key == 'lspf' end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/psd/layer/info/locked.rb', line 11 def parse locked = @file.read_int @transparency_locked = (locked & (0x01 << 0)) > 0 || locked == -2147483648 @composite_locked = (locked & (0x01 << 1)) > 0 || locked == -2147483648 @position_locked = (locked & (0x01 << 2)) > 0 || locked == -2147483648 @all_locked = @transparency_locked && @composite_locked && @position_locked end |