Comparing version 3.0.0 to 3.0.1
@@ -11,3 +11,4 @@ /* | ||
(function(c){function d(b){if(a[b])return a[b].a;var e=a[b]={m:b,f:!1,a:{}};c[b].call(e.a,e,e.a,d);e.f=!0;return e.a}var a={};d.l=c;d.h=a;d.b=function(a,c){d.c(a)||Object.defineProperty(a,"a",{configurable:!1,enumerable:!0,get:c})};d.i=function(a){var b=a&&a.g?function(){return a["default"]}:function(){return a};d.b(b,b);return b};d.c=function(a){return Object.prototype.hasOwnProperty.call(a,"a")};d.j="";return d(d.o=0)})([function(){var c=new Float32Array(1),d={intToInt:function(a,b){return a=0< | ||
a?parseInt(a/b.oldPositive*b.newPositive,10):parseInt(a/b.oldNegative*b.newNegative,10)},floatToInt:function(a,b){return 0<a?a*b.newPositive:a*b.newNegative},intToFloat:function(a,b){return 0<a?a/b.oldPositive:a/b.oldNegative},floatToFloat:function(a,b){"64"==b.original&&"32f"==b.target&&(c[0]=a,a=c[0]);return a}};window.bitDepth=window.bitDepth||{};window.bitDepth.toBitDepth=function(a,b,c){for(var e=[],g=8;49>g;g++)e.push(g.toString());e.push("32f");e.push("64");if(-1==e.indexOf(b)||-1==e.indexOf(c))throw Error("Invalid bit depth."); | ||
e=["32f","64"].includes(b)?"float":"int";g=["32f","64"].includes(c)?"Float":"Int";e=d[e+"To"+g];g=a.length;for(var f=0;f<g;f++){var h=a[f];"8"==b&&(h-=128);a[f]=h;a[f]=e(a[f],{oldNegative:parseInt(Math.pow(2,parseInt(b,10))/2,10),newNegative:parseInt(Math.pow(2,parseInt(c,10))/2,10),oldPositive:parseInt(Math.pow(2,parseInt(b,10))/2-1,10),newPositive:parseInt(Math.pow(2,parseInt(c,10))/2-1,10),original:b,target:c});h=a[f];"8"==c&&(h+=128);a[f]=h}}}]); | ||
a?parseInt(a/b.oldPositive*b.newPositive,10):parseInt(a/b.oldNegative*b.newNegative,10)},floatToInt:function(a,b){return 0<a?parseInt(a*b.newPositive,10):parseInt(a*b.newNegative,10)},intToFloat:function(a,b){return 0<a?a/b.oldPositive:a/b.oldNegative},floatToFloat:function(a,b){"64"==b.original&&"32f"==b.target&&(c[0]=a,a=c[0]);return a}};window.bitDepth=window.bitDepth||{};window.bitDepth.toBitDepth=function(a,b,c){for(var e=[],g=8;49>g;g++)e.push(g.toString());e.push("32f");e.push("64");if(-1== | ||
e.indexOf(b)||-1==e.indexOf(c))throw Error("Invalid bit depth.");e=["32f","64"].includes(b)?"float":"int";g=["32f","64"].includes(c)?"Float":"Int";e=d[e+"To"+g];g=a.length;for(var f=0;f<g;f++){var h=a[f];"8"==b&&(h-=128);a[f]=h;a[f]=e(a[f],{oldNegative:parseInt(Math.pow(2,parseInt(b,10))/2,10),newNegative:parseInt(Math.pow(2,parseInt(c,10))/2,10),oldPositive:parseInt(Math.pow(2,parseInt(b,10))/2-1,10),newPositive:parseInt(Math.pow(2,parseInt(c,10))/2-1,10),original:b,target:c});h=a[f];"8"==c&&(h+= | ||
128);a[f]=h}}}]); |
@@ -112,3 +112,4 @@ /******/ (function(modules) { // webpackBootstrap | ||
return sample > 0 ? | ||
sample * args["newPositive"] : sample * args["newNegative"]; | ||
parseInt(sample * args["newPositive"], 10) : | ||
parseInt(sample * args["newNegative"], 10); | ||
}, | ||
@@ -115,0 +116,0 @@ |
@@ -43,3 +43,4 @@ /*! | ||
return sample > 0 ? | ||
sample * args["newPositive"] : sample * args["newNegative"]; | ||
parseInt(sample * args["newPositive"], 10) : | ||
parseInt(sample * args["newNegative"], 10); | ||
}, | ||
@@ -46,0 +47,0 @@ |
{ | ||
"name": "bitdepth", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Change the resolution of samples to and from 8, 11, 12, 16, 20, 24, 32, 48 & 64-bit.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/rochars/bitdepth", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77441
1122