Class: PSD::Resource::Section::LayerComps
- Inherits:
-
Base
- Object
- Base
- PSD::Resource::Section::LayerComps
show all
- Defined in:
- lib/psd/resources/layer_comps.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize, name, #name, #resource_id, resource_id
Class Method Details
.appearance_captured?(comp) ⇒ Boolean
18
19
20
|
# File 'lib/psd/resources/layer_comps.rb', line 18
def self.appearance_captured?(comp)
comp[:captured_info] & 0b100 > 0
end
|
.position_captured?(comp) ⇒ Boolean
14
15
16
|
# File 'lib/psd/resources/layer_comps.rb', line 14
def self.position_captured?(comp)
comp[:captured_info] & 0b010 > 0
end
|
.visibility_captured?(comp) ⇒ Boolean
10
11
12
|
# File 'lib/psd/resources/layer_comps.rb', line 10
def self.visibility_captured?(comp)
comp[:captured_info] & 0b001 > 0
end
|
Instance Method Details
#[](val) ⇒ Object
34
35
36
|
# File 'lib/psd/resources/layer_comps.rb', line 34
def [](val)
@data[val]
end
|
#names ⇒ Object
30
31
32
|
# File 'lib/psd/resources/layer_comps.rb', line 30
def names
@data['list'].map { |c| c['Nm '] }
end
|
#parse ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/psd/resources/layer_comps.rb', line 22
def parse
@file.seek 4, IO::SEEK_CUR
@data = Descriptor.new(@file).parse
@resource.data = self
end
|
#to_a ⇒ Object
38
39
40
|
# File 'lib/psd/resources/layer_comps.rb', line 38
def to_a
@data['list'].map { |c| {id: c['compID'], name: c['Nm '], captured_info: c['capturedInfo']} }
end
|