You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
424 B
32 lines
424 B
4 years ago
|
'use strict'
|
||
|
|
||
|
var clip = require('./')
|
||
|
var a = require('assert')
|
||
|
|
||
|
|
||
|
var pixels = [
|
||
|
0, 1, 0,
|
||
|
1, 1, 1,
|
||
|
0, 1, 0
|
||
|
]
|
||
|
a.deepEqual(clip(pixels, [3, 3, 1], [1, 0, 2, 3]),
|
||
|
[
|
||
|
1, 0,
|
||
|
1, 1,
|
||
|
1, 0
|
||
|
])
|
||
|
|
||
|
|
||
|
// short args
|
||
|
var pixels = [
|
||
|
0,0,0,0, 1,1,1,1, 0,0,0,0,
|
||
|
1,1,1,1, 1,1,1,1, 1,1,1,1,
|
||
|
0,0,0,0, 1,1,1,1, 0,0,0,0
|
||
|
]
|
||
|
a.deepEqual(clip(pixels, [3], [1, 0]),
|
||
|
[
|
||
|
1,1,1,1, 0,0,0,0,
|
||
|
1,1,1,1, 1,1,1,1,
|
||
|
1,1,1,1, 0,0,0,0
|
||
|
])
|