Sha256: 4ad3d48f580fac6d1fb0816c968403d4a68ccc9484d62d5ee7df8411e26b4809
Contents?: true
Size: 807 Bytes
Versions: 3
Compression:
Stored size: 807 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 mask = nil @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 * opacity).to_i 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
psd-1.4.2 | lib/psd/image_modes/rgb.rb |
psd-1.4.1 | lib/psd/image_modes/rgb.rb |
psd-1.4.0 | lib/psd/image_modes/rgb.rb |