New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fisheyegl

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fisheyegl - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

example/images/grid-fixed.png

24

dist/fisheyegl.js

@@ -5,3 +5,3 @@ (function(exports){

exports = FisheyeGl;
else
else
module.exports = FisheyeGl;

@@ -43,3 +43,4 @@

b : 1.0,
F : 1.0,
Fx : 0.0,
Fy : 0.0,
scale : 1.5

@@ -57,3 +58,3 @@ };

var vertexSrc = loadFile(options.vertexSrc || "../shaders/vertex.glvs");
var fragmentSrc = loadFile(options.fragmentSrc || "../shaders/fragment.glfs");
var fragmentSrc = loadFile(options.fragmentSrc || "../shaders/fragment3.glfs");

@@ -66,3 +67,4 @@ var program = compileShader(gl, vertexSrc, fragmentSrc)

var uSampler = gl.getUniformLocation(program, "uSampler");
var uLens = gl.getUniformLocation(program, "uLens");
var uLensS = gl.getUniformLocation(program, "uLensS");
var uLensF = gl.getUniformLocation(program, "uLensF");
var uFov = gl.getUniformLocation(program, "uFov");

@@ -208,3 +210,3 @@

function run(animate){
function run(animate, callback){
var f = window.requestAnimationFrame || window.mozRequestAnimationFrame ||

@@ -230,2 +232,3 @@ window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;

options.runner(dt);
if (callback) callback();
if (animate === true) f(on);

@@ -242,3 +245,3 @@ }

options.runner = options.runner|| function runner(dt){
gl.clearColor(0.0, 0.0, 0.0, 1.0);

@@ -248,3 +251,3 @@ gl.enable(gl.DEPTH_TEST);

gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.enableVertexAttribArray(aVertexPosition);

@@ -264,3 +267,4 @@

gl.uniform4fv(uLens, [lens.a, lens.b, lens.F, lens.scale]);
gl.uniform3fv(uLensS, [lens.a, lens.b, lens.scale]);
gl.uniform2fv(uLensF, [lens.Fx, lens.Fy]);
gl.uniform2fv(uFov, [fov.x, fov.y]);

@@ -274,6 +278,6 @@

function setImage(imageUrl) {
function setImage(imageUrl, callback) {
texture = loadImageFromUrl(gl, imageUrl, function onImageLoad() {
run(options.animate);
run(options.animate, callback);

@@ -280,0 +284,0 @@ });

@@ -15,3 +15,4 @@ var distorter;

distorter.lens.b = $("#b_label")[0].innerHTML = $("#b").val();
distorter.lens.F = $("#F_label")[0].innerHTML = $("#F").val();
distorter.lens.Fx = $("#Fx_label")[0].innerHTML = $("#Fx").val();
distorter.lens.Fy = $("#Fy_label")[0].innerHTML = $("#Fy").val();
distorter.lens.scale = $("#scale_label")[0].innerHTML = $("#scale").val();

@@ -23,3 +24,4 @@ distorter.fov.x = $("#fovx").val();

$("#display .b")[0].innerHTML = distorter.lens.b;
$("#display .F")[0].innerHTML = distorter.lens.F;
$("#display .Fx")[0].innerHTML = distorter.lens.Fx;
$("#display .Fy")[0].innerHTML = distorter.lens.Fy;
$("#display .scale")[0].innerHTML = distorter.lens.scale;

@@ -34,4 +36,6 @@ $("#display .x")[0].innerHTML = distorter.fov.x;

$("#b_label")[0].innerHTML = distorter.lens.b;
$("#F").val(distorter.lens.F);
$("#F_label")[0].innerHTML = distorter.lens.F;
$("#Fx").val(distorter.lens.Fx);
$("#Fx_label")[0].innerHTML = distorter.lens.Fx;
$("#Fy").val(distorter.lens.Fy);
$("#Fy_label")[0].innerHTML = distorter.lens.Fy;
$("#scale").val(distorter.lens.scale);

@@ -65,6 +69,9 @@ $("#scale_label")[0].innerHTML = distorter.lens.scale;

$('#previous').prepend(distorter.getImage());
distorter.setImage(event.target.result);
distorter.setImage(event.target.result, function callback() {
$('#grid').height($('#canvas').height());
$('#grid').width($('#canvas').width());
});
}
reader.readAsDataURL(f);
}

@@ -82,2 +89,7 @@ }

setTimeout(function() {
$('#grid').height($('#canvas').height());
$('#grid').width($('#canvas').width());
}, 0);
});
{
"name": "fisheyegl",
"version": "0.0.1",
"version": "0.0.2",
"description": "A JavaScript library for correcting fisheye, or barrel distortion, in images in the browser with WebGL -- adapted from fisheye-correction-webgl by @bluemir.",

@@ -5,0 +5,0 @@ "main": "dist/fisheyegl.js",

@@ -16,5 +16,14 @@ FisheyeGl

If you can manually correct a particular lens or camera, please [file an issue](https://github.com/jywarren/fisheyegl/issues) or email jeff@publiclab.org to get a preset made; we can save up some presets and add a feature for quick correction of known cameras.
If you can manually correct a particular lens or camera, please [file an issue](https://github.com/jywarren/fisheyegl/issues) or email jeff@publiclab.org to get a preset made; we can save up some presets and add a feature for quick correction of known cameras. Please include the `a`, `b`, `Fx`, `Fy`, and `fov` parameters and the make/model of your camera with a before/after image pair, so we can add them to a presets listing.
## Example before/after images:
Before correcting lens (barrel) distortion:
![grid.png](https://raw.githubusercontent.com/jywarren/fisheyegl/master/example/images/grid.png)
After:
![grid-fixed.png](https://raw.githubusercontent.com/jywarren/fisheyegl/master/example/images/grid-fixed.png)
## Using it in your code

@@ -31,4 +40,5 @@

b: 1, // 0 to 4; default 1
F: 1, // 0 to 4; default 1
scale: 1.5 // 0 to 20; default 1.5
Fx: 0.0, // 0 to 4; default 0.0
Fy: 0.0, // 0 to 4; default 0.0
scale: 1.5 // 0 to 20; default 1.5
},

@@ -35,0 +45,0 @@ fov: {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc