Sha256: 1b33e3b1a5e41fa1f4badf5773e68286cfaf23bb6b60cf19ee4948e10e568f7f

Contents?: true

Size: 616 Bytes

Versions: 4

Compression:

Stored size: 616 Bytes

Contents

require 'psd/layer_info'

class PSD
  class ChannelBlendingRestrictions < LayerInfo
    def self.should_parse?(key)
      key == 'brst'
    end

    MODES = {
      'RGBColor' => ['R', 'G', 'B'],
      'CMYKColor' => ['C', 'M', 'Y', 'K']
    }

    attr_reader :restricted_channels, :restricted_channels_by_letter

    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
psd-3.9.0 lib/psd/layer/info/channel_blending_restrictions.rb
psd-3.8.0 lib/psd/layer/info/channel_blending_restrictions.rb
psd-3.7.0 lib/psd/layer/info/channel_blending_restrictions.rb
psd-3.6.0 lib/psd/layer/info/channel_blending_restrictions.rb