npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

libnoise

v0.2.1

Published

This is a haxe port of [libnoise](http://libnoise.sourceforge.net), the coherent noise library. The port is almost complete, only the gradient and noise2D utilities are missing.

Downloads

14

Readme

#Libnoise

This is a haxe port of libnoise, the coherent noise library. The port is almost complete, only the gradient and noise2D utilities are missing.

Examples usages in the test folder, require the format library to generate images.

#JS Example

var ctx = document
    .querySelector('#c')
    .getContext('2d');

//enums are a bit weird in js, so you have to use the actual reference, instead of an int.
var quality = libnoise.QualityMode.MEDIUM;
var noise = new libnoise.generator.Perlin(.01, 2.0, 0.5, 8, 42, quality);

var size = 512;
var img = ctx.createImageData(size, size);

function getColor(val) {
    var color = (128 * ((val + 1)));
    return color > 255 ? 255 : color < 0 ? 0 : color;
}

var z = 0;

for (var i = 0; i < size * size * 4; i += 4) {

    var x = (i / 4) % size; //Math.floor(i / width);
    var y = Math.floor((i / 4) / size); //i % height;:w

    var val = noise.getValue(x, y, z);

    var color = getColor(val);

    //console.log('pixel at: ', x ,y, val, color);
    //r
    img.data[i] = color;
    //g
    img.data[i + 1] = color;
    //b
    img.data[i + 2] = color;
    //a
    img.data[i + 3] = 255;
}

ctx.putImageData(img, 0, 0);

#License This port is released under the LGPL licence, see LICENSE and LICENSE.lesser for details. #About Libnoise was originaly created by Jason Bevins. The library was later ported to Xna by Marc André Ueberall, and moved to Unity by Tim Speltz. This haxe version was mainly ported with Libnoise.unity as reference.