Class: PSD::ChannelBlendingRestrictions
- Defined in:
- lib/psd/layer/info/channel_blending_restrictions.rb
Constant Summary collapse
- MODES =
{ 'RGBColor' => ['R', 'G', 'B'], 'CMYKColor' => ['C', 'M', 'Y', 'K'] }
Instance Attribute Summary collapse
-
#restricted_channels ⇒ Object
readonly
Returns the value of attribute restricted_channels.
-
#restricted_channels_by_letter ⇒ Object
readonly
Returns the value of attribute restricted_channels_by_letter.
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
#restricted_channels ⇒ Object (readonly)
Returns the value of attribute restricted_channels.
14 15 16 |
# File 'lib/psd/layer/info/channel_blending_restrictions.rb', line 14 def restricted_channels @restricted_channels end |
#restricted_channels_by_letter ⇒ Object (readonly)
Returns the value of attribute restricted_channels_by_letter.
14 15 16 |
# File 'lib/psd/layer/info/channel_blending_restrictions.rb', line 14 def restricted_channels_by_letter @restricted_channels_by_letter end |
Class Method Details
.should_parse?(key) ⇒ Boolean
5 6 7 |
# File 'lib/psd/layer/info/channel_blending_restrictions.rb', line 5 def self.should_parse?(key) key == 'brst' end |
Instance Method Details
#parse ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/psd/layer/info/channel_blending_restrictions.rb', line 16 def parse @restricted_channels = [] @restricted_channels_by_letter = [] (@length / 4).times do channel = @file.read_int @restricted_channels << channel @restricted_channels_by_letter << MODES[@layer.header.mode_name][channel] end end |