Class: PSD::Locked

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

Instance Attribute Summary collapse

Attributes inherited from LayerInfo

#data

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.



7
8
9
# File 'lib/psd/layer_info/locked.rb', line 7

def all_locked
  @all_locked
end

#composite_lockedObject (readonly)

Returns the value of attribute composite_locked.



7
8
9
# File 'lib/psd/layer_info/locked.rb', line 7

def composite_locked
  @composite_locked
end

#position_lockedObject (readonly)

Returns the value of attribute position_locked.



7
8
9
# File 'lib/psd/layer_info/locked.rb', line 7

def position_locked
  @position_locked
end

#transparency_lockedObject (readonly)

Returns the value of attribute transparency_locked.



7
8
9
# File 'lib/psd/layer_info/locked.rb', line 7

def transparency_locked
  @transparency_locked
end

Instance Method Details

#parseObject



9
10
11
12
13
14
15
16
17
# File 'lib/psd/layer_info/locked.rb', line 9

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