Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mster committed Jul 5, 2020
1 parent 8c7b432 commit f5da123
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
37 changes: 37 additions & 0 deletions lib/modes/fatcat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
'use strict'

module.exports = function (original) {
const min = Math.min

const bitmapData = original.bitmap.data
const data = Buffer.from(bitmapData)

const bounceMax = [280, 268, 256, 255]

for (let i = 0; i < data.length; i += 4) {
data[i + 0] = min(data[i + 0] * 1.4, bounceMax[0])
data[i + 1] = min(data[i + 1] * 1.4, bounceMax[0])
data[i + 2] = min(data[i + 2] * 1.4, bounceMax[0])
}

for (let i = 0; i < data.length; i += 4) {
data[i + 0] = min(data[i + 0] * 1.4, bounceMax[0])
data[i + 1] = min(data[i + 1] * 1.4, bounceMax[0])
data[i + 2] = min(data[i + 2] * 1.4, bounceMax[0])
}

for (let i = 0; i < data.length; i += 4) {
data[i + 0] = min(data[i + 0] * 1.4, 256)
data[i + 1] = min(data[i + 1] * 1.4, 256)
data[i + 2] = min(data[i + 2] * 1.4, 256)
}

for (let i = 0; i < data.length; i += 4) {
data[i + 0] = min(data[i + 0] * 1.4, 255)
data[i + 1] = min(data[i + 1] * 1.4, 255)
data[i + 2] = min(data[i + 2] * 1.4, 255)
}

original.bitmap.data = data
return original
}
9 changes: 5 additions & 4 deletions lib/mosh.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function mosh (options, cb) {
/^[\w\-. ]+.jpeg$/.test(filename) ||
/^[\w\-. ]+.png$/.test(filename) ||
/^[\w\-. ]+.bmp$/.test(filename) ||
/^[\w\-. ]+*.tiff$/.test(filename) ||
/^[\w\-. ]+.tiff$/.test(filename) ||
/^[\w\-. ]+.gif$/.test(filename))
)
) {
Expand All @@ -40,8 +40,8 @@ function mosh (options, cb) {
const _mode =
mode == null
? Object.keys(mosh.MODES)[
Math.floor(Math.random() * Object.keys(mosh.MODES).length)
]
Math.floor(Math.random() * Object.keys(mosh.MODES).length)
]
: mode
debug(`Mode selected: ${_mode}`)

Expand Down Expand Up @@ -75,5 +75,6 @@ mosh.MODES = {
blurbobb: require('./modes/blurbobb'),
schifty: require('./modes/schifty'),
veneneux: require('./modes/veneneux'),
vana: require('./modes/vana')
vana: require('./modes/vana'),
fatcat: require('./modes/fatcat')
}

0 comments on commit f5da123

Please sign in to comment.