Sha256: 4d687fc759b9a013d24bf42f8950adfaa7abd8d35347f215b731c31b17ae197e

Contents?: true

Size: 835 Bytes

Versions: 2

Compression:

Stored size: 835 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::rgba(*rgb.values, a)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
psd-1.2.1 lib/psd/image_modes/cmyk.rb
psd-1.2.0 lib/psd/image_modes/cmyk.rb