Class: PSD::Locked

Inherits:
LayerInfo show all
Defined in:
lib/psd/layer/info/locked.rb

Instance Attribute Summary collapse

Attributes inherited from LayerInfo

#data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LayerInfo

#initialize, #skip

Constructor Details

This class inherits a constructor from PSD::LayerInfo

Instance Attribute Details

#all_lockedObject (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_lockedObject (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_lockedObject (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_lockedObject (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

Returns:

  • (Boolean)


5
6
7
# File 'lib/psd/layer/info/locked.rb', line 5

def self.should_parse?(key)
  key == 'lspf'
end

Instance Method Details

#parseObject



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