Sha256: a25f969e32fa52d94fdc958c884c709dca1b97732662b7533dbf9aca41e174ea

Contents?: true

Size: 745 Bytes

Versions: 12

Compression:

Stored size: 745 Bytes

Contents

class PSD
  module ImageMode
    module CMYK
      private

      def combine_cmyk_channel
        (0...@num_pixels).step(pixel_step) do |i|
          c = m = y = k = 0
          a = 255

          @channels_info.each_with_index do |chan, index|
            next if chan[:id] == -2

            val = @channel_data[i + (@channel_length * index)]

            case chan[:id]
            when -1 then a = val
            when 0 then c = val
            when 1 then m = val
            when 2 then y = val
            when 3 then k = val
            end
          end

          rgb = PSD::Color.cmyk_to_rgb(255 - c, 255 - m, 255 - y, 255 - k)
          @pixel_data.push ChunkyPNG::Color.rgba(*rgb.values, a)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/psd.rb/lib/psd/image_modes/cmyk.rb
psd-3.2.2 lib/psd/image_modes/cmyk.rb
psd-3.2.1 lib/psd/image_modes/cmyk.rb
psd-3.2.0 lib/psd/image_modes/cmyk.rb
psd-3.1.5 lib/psd/image_modes/cmyk.rb
psd-3.1.4 lib/psd/image_modes/cmyk.rb
psd-3.1.3 lib/psd/image_modes/cmyk.rb
psd-3.1.2 lib/psd/image_modes/cmyk.rb
psd-2.1.2 lib/psd/image_modes/cmyk.rb
psd-2.1.1 lib/psd/image_modes/cmyk.rb
psd-2.1.0 lib/psd/image_modes/cmyk.rb
psd-2.0.0 lib/psd/image_modes/cmyk.rb