Sha256: 1c35167051580a221a56a491d447c6a576bda3b4a5146798cad73b68f2229468

Contents?: true

Size: 688 Bytes

Versions: 12

Compression:

Stored size: 688 Bytes

Contents

class PSD
  class Layer
    module BlendModes
      attr_reader :blend_mode, :opacity

      def blending_mode
        if !info[:section_divider].nil? && info[:section_divider].blend_mode
          BlendMode::BLEND_MODES[info[:section_divider].blend_mode.strip.to_sym]
        else
          @blending_mode
        end
      end

      # Is the layer below this one a clipping mask?
      def clipped?
        @blend_mode.clipping == 1
      end

      private
      
      def parse_blend_modes
        @blend_mode = BlendMode.read(@file)

        @blending_mode = @blend_mode.mode
        @opacity = @blend_mode.opacity
        @visible = @blend_mode.visible
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/psd.rb/lib/psd/layer/blend_modes.rb
psd-2.1.2 lib/psd/layer/blend_modes.rb
psd-2.1.1 lib/psd/layer/blend_modes.rb
psd-2.1.0 lib/psd/layer/blend_modes.rb
psd-2.0.0 lib/psd/layer/blend_modes.rb
psd-1.5.0 lib/psd/layer/blend_modes.rb
psd-1.4.5 lib/psd/layer/blend_modes.rb
psd-1.4.4 lib/psd/layer/blend_modes.rb
psd-1.4.3 lib/psd/layer/blend_modes.rb
psd-1.4.2 lib/psd/layer/blend_modes.rb
psd-1.4.1 lib/psd/layer/blend_modes.rb
psd-1.4.0 lib/psd/layer/blend_modes.rb