Sha256: abdc6b09c6f667b5d8b38f8ab8e9c0235e107416474a9f7c77bc3ce1dfc38fef

Contents?: true

Size: 618 Bytes

Versions: 15

Compression:

Stored size: 618 Bytes

Contents

require_relative '../layer_info'

class PSD
  class LayerSectionDivider < LayerInfo
    @key = 'lsct'

    attr_reader :layer_type, :is_folder, :is_hidden

    SECTION_DIVIDER_TYPES = [
      "other",
      "open folder",
      "closed folder",
      "bounding section divider"
    ]

    def initialize(file, length)
      super

      @is_folder = false
      @is_hidden = false
    end

    def parse
      code = @file.read_int
      @layer_type = SECTION_DIVIDER_TYPES[code]

      case code
      when 1, 2 then @is_folder = true
      when 3 then @is_hidden = true
      end

      return self
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
psd-1.3.2 lib/psd/layer_info/layer_section_divider.rb
psd-1.3.0 lib/psd/layer_info/layer_section_divider.rb
psd-1.2.2 lib/psd/layer_info/layer_section_divider.rb
psd-1.2.1 lib/psd/layer_info/layer_section_divider.rb
psd-1.2.0 lib/psd/layer_info/layer_section_divider.rb
psd-1.1.1 lib/psd/layer_info/layer_section_divider.rb
psd-1.1.0 lib/psd/layer_info/layer_section_divider.rb
psd-1.0.0 lib/psd/layer_info/layer_section_divider.rb
psd-0.4.2 lib/psd/layer_info/layer_section_divider.rb
psd-0.4.1 lib/psd/layer_info/layer_section_divider.rb
psd-0.4.0 lib/psd/layer_info/layer_section_divider.rb
psd-0.3.5 lib/psd/layer_info/layer_section_divider.rb
psd-0.3.4 lib/psd/layer_info/layer_section_divider.rb
psd-0.3.3 lib/psd/layer_info/layer_section_divider.rb
psd-0.3.2 lib/psd/layer_info/layer_section_divider.rb