Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Translate/shift ndarrays
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
test
.gitignore
LICENSE
README.md
package.json
translate.js

README.md

ndarray-translate

Shifts an ndarray by some integer shift.

Example

var lena = require("luminance")(require("lena"))
var translate = require("ndarray-translate")

translate(lena, [100, 180])

require("save-pixels")(lena, "png").pipe(process.stdout)

This generates the following image:

Install

npm install ndarray-translate

require("ndarray-translate")(array, shift)

Translates array by shift amount in place.

  • array is an ndarray
  • shift is a vector with length equal to the dimension of the array representing the amount to shfit by. Coordinates for the shift get rounded to nearest integer.

Returns array

Credits

(c) 2013 Mikola Lysenko. MIT License

Something went wrong with that request. Please try again.