Sha256: 4d12e16753d88b878862c0fccee3d7ff427ac8a844acf9e521a3425bf6a82c6c

Contents?: true

Size: 769 Bytes

Versions: 9

Compression:

Stored size: 769 Bytes

Contents

class PSD
  module ImageMode
    # Combines the channel data from the image into RGB pixel values
    module RGB
      private

      def combine_rgb_channel
        PSD.logger.debug "Beginning RGB processing"

        (0...@num_pixels).step(pixel_step) do |i|
          r = g = b = 0
          a = 255

          @channels_info.each_with_index do |chan, index|
            next if chan[:id] == -2
            
            val = @channel_data[i + (@channel_length * index)]

            case chan[:id]
            when -1 then  a = val
            when 0 then   r = val
            when 1 then   g = val
            when 2 then   b = val
            end
          end

          @pixel_data.push ChunkyPNG::Color.rgba(r, g, b, a)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/psd.rb/lib/psd/image_modes/rgb.rb
psd-2.1.2 lib/psd/image_modes/rgb.rb
psd-2.1.1 lib/psd/image_modes/rgb.rb
psd-2.1.0 lib/psd/image_modes/rgb.rb
psd-2.0.0 lib/psd/image_modes/rgb.rb
psd-1.5.0 lib/psd/image_modes/rgb.rb
psd-1.4.5 lib/psd/image_modes/rgb.rb
psd-1.4.4 lib/psd/image_modes/rgb.rb
psd-1.4.3 lib/psd/image_modes/rgb.rb