Class: PSD::VectorMask
- Defined in:
- lib/psd/layer/info/vector_mask.rb
Instance Attribute Summary collapse
-
#disable ⇒ Object
readonly
Returns the value of attribute disable.
-
#invert ⇒ Object
readonly
Returns the value of attribute invert.
-
#not_link ⇒ Object
readonly
Returns the value of attribute not_link.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
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
#disable ⇒ Object (readonly)
Returns the value of attribute disable.
9 10 11 |
# File 'lib/psd/layer/info/vector_mask.rb', line 9 def disable @disable end |
#invert ⇒ Object (readonly)
Returns the value of attribute invert.
9 10 11 |
# File 'lib/psd/layer/info/vector_mask.rb', line 9 def invert @invert end |
#not_link ⇒ Object (readonly)
Returns the value of attribute not_link.
9 10 11 |
# File 'lib/psd/layer/info/vector_mask.rb', line 9 def not_link @not_link end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
9 10 11 |
# File 'lib/psd/layer/info/vector_mask.rb', line 9 def paths @paths end |
Class Method Details
.should_parse?(key) ⇒ Boolean
5 6 7 |
# File 'lib/psd/layer/info/vector_mask.rb', line 5 def self.should_parse?(key) ['vmsk', 'vsms'].include?(key) end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/psd/layer/info/vector_mask.rb', line 11 def parse version = @file.read_int tag = @file.read_int @invert = tag & 0x01 @not_link = (tag & (0x01 << 1)) > 0 @disable = (tag & (0x01 << 2)) > 0 # I haven't figured out yet why this is 10 and not 8. num_records = (@length - 10) / 26 @paths = [] num_records.times do @paths << PathRecord.new(@file) end end |