Sha256: 75c16a71ab69ebd5393cf64c2a7997b3043691e0b0e5c08863c54f47e951101c

Contents?: true

Size: 818 Bytes

Versions: 2

Compression:

Stored size: 818 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 *rgb.values, a
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
psd-1.1.1 lib/psd/image_modes/cmyk.rb
psd-1.1.0 lib/psd/image_modes/cmyk.rb