Sha256: 86bbe497409bd04e9d3e55d59a3032409615a657a1ec540ae14ef16b092b66ec

Contents?: true

Size: 762 Bytes

Versions: 8

Compression:

Stored size: 762 Bytes

Contents

class PSD::Image::Mode
  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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
psd-1.0.0 lib/psd/image_modes/cmyk.rb
psd-0.4.2 lib/psd/image_modes/cmyk.rb
psd-0.4.1 lib/psd/image_modes/cmyk.rb
psd-0.4.0 lib/psd/image_modes/cmyk.rb
psd-0.3.5 lib/psd/image_modes/cmyk.rb
psd-0.3.4 lib/psd/image_modes/cmyk.rb
psd-0.3.3 lib/psd/image_modes/cmyk.rb
psd-0.3.2 lib/psd/image_modes/cmyk.rb