Commit f5a5bd8c authored by Ryan LeFevre's avatar Ryan LeFevre

RGB shim no longer required

parent 5eda9ee0
......@@ -9,10 +9,9 @@ task 'compile', 'Compile with browserify for the web', ->
.transform('coffeeify')
.require('./shims/png.coffee', expose: './image_exports/png.coffee')
.require('./shims/init.coffee', expose: './psd/init.coffee')
.require('./shims/rgb.coffee', expose: './image_modes/rgb.coffee')
.require('./lib/psd.coffee', expose: 'psd')
.bundle (err, src) ->
return console.log(err) if err?
fs.writeFile './dist/psd.js', src, ->
fs.stat './dist/psd.js', (err, stats) ->
console.log "Compiled to ./dist/psd.js - #{Math.round(stats.size / 1024)}KB"
\ No newline at end of file
console.log "Compiled to ./dist/psd.js - #{Math.round(stats.size / 1024)}KB"
This diff is collapsed.
module.exports =
combineRgbChannel: ->
rgbChannels = @channelsInfo
.map (ch) -> ch.id
.filter (ch) -> ch >= -1
for i in [0...@numPixels]
r = g = b = 0
a = 255
for chan, index in rgbChannels
val = @channelData[i + (@channelLength * index)]
switch chan
when -1 then a = val
when 0 then r = val
when 1 then g = val
when 2 then b = val
@pixelData.push r, g, b, a
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment