Sha256: 9bcabb0b411c1cb1e1fe905fb2d780823a25c1e620669d52592a33b01cf21057

Contents?: true

Size: 599 Bytes

Versions: 18

Compression:

Stored size: 599 Bytes

Contents

require 'psd/layer_info'

class PSD
  class Locked < LayerInfo
    def self.should_parse?(key)
      key == 'lspf'
    end

    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

18 entries across 18 versions & 1 rubygems

Version Path
psd-3.9.0 lib/psd/layer/info/locked.rb
psd-3.8.0 lib/psd/layer/info/locked.rb
psd-3.7.0 lib/psd/layer/info/locked.rb
psd-3.6.0 lib/psd/layer/info/locked.rb
psd-3.5.0 lib/psd/layer/info/locked.rb
psd-3.4.0 lib/psd/layer/info/locked.rb
psd-3.3.3 lib/psd/layer/info/locked.rb
psd-3.3.2 lib/psd/layer/info/locked.rb
psd-3.3.1 lib/psd/layer/info/locked.rb
psd-3.2.4 lib/psd/layer_info/locked.rb
psd-3.2.3 lib/psd/layer_info/locked.rb
psd-3.2.2 lib/psd/layer_info/locked.rb
psd-3.2.1 lib/psd/layer_info/locked.rb
psd-3.2.0 lib/psd/layer_info/locked.rb
psd-3.1.5 lib/psd/layer_info/locked.rb
psd-3.1.4 lib/psd/layer_info/locked.rb
psd-3.1.3 lib/psd/layer_info/locked.rb
psd-3.1.2 lib/psd/layer_info/locked.rb