Sha256: ba74061269789d2b8f9047ba710b4986975d153b306404d933d9289534faf8be

Contents?: true

Size: 565 Bytes

Versions: 6

Compression:

Stored size: 565 Bytes

Contents

require_relative '../layer_info'

class PSD
  class Locked < LayerInfo
    @key = 'lspf'

    attr_reader :all_locked, :transparency_locked, :composite_locked, :position_locked

    def parse
      locked = @file.read_int

      @transparency_locked = (locked & (0x01 << 0)) > 0 || locked == -2147483648
      @composite_locked = (locked & (0x01 << 1)) > 0 || locked == -2147483648
      @position_locked = (locked & (0x01 << 2)) > 0 || locked == -2147483648
      
      @all_locked = @transparency_locked && @composite_locked && @position_locked
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/psd.rb/lib/psd/layer_info/locked.rb
psd-2.1.2 lib/psd/layer_info/locked.rb
psd-2.1.1 lib/psd/layer_info/locked.rb
psd-2.1.0 lib/psd/layer_info/locked.rb
psd-2.0.0 lib/psd/layer_info/locked.rb
psd-1.5.0 lib/psd/layer_info/locked.rb