Sha256: 0e2c927129f4d47c77a1bc0681fa0e3fe9cb6b9900e17bad5ed02e92514ae00a

Contents?: true

Size: 841 Bytes

Versions: 2

Compression:

Stored size: 841 Bytes

Contents

class PSD
  module ImageMode
    module CMYK
      private

      def combine_cmyk_channel
        (0...@num_pixels).step(pixel_step) do |i|
          if channels == 5
            a = @channel_data[i]
            c = @channel_data[i + @channel_length]
            m = @channel_data[i + @channel_length * 2]
            y = @channel_data[i + @channel_length * 3]
            k = @channel_data[i + @channel_length * 4]
          else
            a = 255
            c = @channel_data[i]
            m = @channel_data[i + @channel_length]
            y = @channel_data[i + @channel_length * 2]
            k = @channel_data[i + @channel_length * 3]
          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

2 entries across 2 versions & 1 rubygems

Version Path
psd-1.3.0 lib/psd/image_modes/cmyk.rb
psd-1.2.2 lib/psd/image_modes/cmyk.rb