Sha256: ed94f06a9d264217c6bf942a9496f9ff4c85e2fd2422d756c59d0fad152d4e64

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

class PSD::Image::Mode
  module Greyscale
    private

    def combine_greyscale_channel
      if channels == 2
        (0...@num_pixels).step(pixel_step) do |i|
          alpha = @channel_data[i]
          grey = @channel_data[@channel_length + i]

          @pixel_data.push grey, grey, grey, alpha
        end
      else
        (0...@num_pixels).step(pixel_step) do |i|
          @pixel_data.push *([@channel_data[i]] * 3), 255
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
psd-1.0.0 lib/psd/image_modes/greyscale.rb