Class: PSD::VectorMask

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

Instance Attribute Summary collapse

Attributes inherited from LayerInfo

#data

Instance Method Summary collapse

Methods inherited from LayerInfo

#initialize

Constructor Details

This class inherits a constructor from PSD::LayerInfo

Instance Attribute Details

#disableObject (readonly)

Returns the value of attribute disable.



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

def disable
  @disable
end

#invertObject (readonly)

Returns the value of attribute invert.



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

def invert
  @invert
end

Returns the value of attribute not_link.



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

def not_link
  @not_link
end

#pathsObject (readonly)

Returns the value of attribute paths.



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

def paths
  @paths
end

Instance Method Details

#parseObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/psd/layer_info/vector_mask.rb', line 9

def parse
  version = @file.read_int
  tag = @file.read_int

  @invert = tag & 0x01
  @not_link = (tag & (0x01 << 1)) > 0
  @disable = (tag & (0x01 << 2)) > 0

  num_records = (@length - 8) / 26
  
  @paths = []
  num_records.times do
    @paths << PathRecord.new(@file)
  end
end