@mediapipe/drawing_utils
Advanced tools
Comparing version 0.1.1606863251 to 0.1.1606873488
@@ -6,8 +6,8 @@ (function(){/* | ||
*/ | ||
'use strict';function f(a){var d=0;return function(){return d<a.length?{done:!1,value:a[d++]}:{done:!0}}}function g(a){var d="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return d?d.call(a):{next:f(a)}}var h="function"==typeof Object.defineProperties?Object.defineProperty:function(a,d,b){if(a==Array.prototype||a==Object.prototype)return a;a[d]=b.value;return a}; | ||
function k(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var d=0;d<a.length;++d){var b=a[d];if(b&&b.Math==Math)return b}throw Error("Cannot find global object");}var l=k(this);function n(a,d){if(d)a:{var b=l;a=a.split(".");for(var c=0;c<a.length-1;c++){var e=a[c];if(!(e in b))break a;b=b[e]}a=a[a.length-1];c=b[a];d=d(c);d!=c&&null!=d&&h(b,a,{configurable:!0,writable:!0,value:d})}} | ||
'use strict';function f(a){var d=0;return function(){return d<a.length?{done:!1,value:a[d++]}:{done:!0}}}function h(a){var d="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return d?d.call(a):{next:f(a)}}var k="function"==typeof Object.defineProperties?Object.defineProperty:function(a,d,b){if(a==Array.prototype||a==Object.prototype)return a;a[d]=b.value;return a}; | ||
function l(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var d=0;d<a.length;++d){var b=a[d];if(b&&b.Math==Math)return b}throw Error("Cannot find global object");}var m=l(this);function n(a,d){if(d)a:{var b=m;a=a.split(".");for(var c=0;c<a.length-1;c++){var e=a[c];if(!(e in b))break a;b=b[e]}a=a[a.length-1];c=b[a];d=d(c);d!=c&&null!=d&&k(b,a,{configurable:!0,writable:!0,value:d})}} | ||
var p="function"==typeof Object.assign?Object.assign:function(a,d){for(var b=1;b<arguments.length;b++){var c=arguments[b];if(c)for(var e in c)Object.prototype.hasOwnProperty.call(c,e)&&(a[e]=c[e])}return a};n("Object.assign",function(a){return a||p});n("Array.prototype.fill",function(a){return a?a:function(d,b,c){var e=this.length||0;0>b&&(b=Math.max(0,e+b));if(null==c||c>e)c=e;c=Number(c);0>c&&(c=Math.max(0,e+c));for(b=Number(b||0);b<c;b++)this[b]=d;return this}}); | ||
function q(a){return a?a:Array.prototype.fill}n("Int8Array.prototype.fill",q);n("Uint8Array.prototype.fill",q);n("Uint8ClampedArray.prototype.fill",q);n("Int16Array.prototype.fill",q);n("Uint16Array.prototype.fill",q);n("Int32Array.prototype.fill",q);n("Uint32Array.prototype.fill",q);n("Float32Array.prototype.fill",q);n("Float64Array.prototype.fill",q);var r=this||self; | ||
function t(a,d){a=a.split(".");var b=r;a[0]in b||"undefined"==typeof b.execScript||b.execScript("var "+a[0]);for(var c;a.length&&(c=a.shift());)a.length||void 0===d?b[c]&&b[c]!==Object.prototype[c]?b=b[c]:b=b[c]={}:b[c]=d};var u={color:"white",lineWidth:2};function v(a){return Object.assign(Object.assign({},u),a||{})}t("drawLandmarks",function(a,d,b){if(d){b=v(b);a.save();var c=a.canvas;a.scale(c.width,c.height);a.fillStyle=b.color;d=g(d);for(var e=d.next();!e.done;e=d.next())if(e=e.value,!(void 0!==e.visibility&&.1>e.visibility)){var m=new Path2D;m.arc(e.x,e.y,b.lineWidth/c.width,0,2*Math.PI);a.fill(m)}a.restore()}}); | ||
t("drawConnectors",function(a,d,b,c){if(d&&b){c=v(c);a.save();var e=a.canvas;a.scale(e.width,e.height);a.strokeStyle=c.color;a.lineWidth=c.lineWidth/e.width;b=g(b);for(c=b.next();!c.done;c=b.next())e=c.value,a.beginPath(),c=d[e[0]],e=d[e[1]],c&&e&&(a.moveTo(c.x,c.y),a.lineTo(e.x,e.y),a.stroke());a.restore()}}); | ||
function t(a,d){a=a.split(".");var b=r;a[0]in b||"undefined"==typeof b.execScript||b.execScript("var "+a[0]);for(var c;a.length&&(c=a.shift());)a.length||void 0===d?b[c]&&b[c]!==Object.prototype[c]?b=b[c]:b=b[c]={}:b[c]=d};var u={color:"white",lineWidth:2};function v(a){return Object.assign(Object.assign({},u),a||{})}t("drawLandmarks",function(a,d,b){if(d){b=v(b);a.save();var c=a.canvas;a.scale(c.width,c.height);a.fillStyle=b.color;d=h(d);for(var e=d.next();!e.done;e=d.next())if(e=e.value,!(void 0!==e.visibility&&.1>e.visibility)){var g=new Path2D;g.arc(e.x,e.y,b.lineWidth/c.width,0,2*Math.PI);a.fill(g)}a.restore()}}); | ||
t("drawConnectors",function(a,d,b,c){if(d&&b){var e=v(c);a.save();c=a.canvas;a.strokeStyle=e.color;a.lineWidth=e.lineWidth;b=h(b);for(e=b.next();!e.done;e=b.next()){var g=e.value;a.beginPath();e=d[g[0]];g=d[g[1]];!e||!g||e.visibility&&g.visibility&&(.1>e.visibility||.1>g.visibility)||(a.moveTo(e.x*c.width,e.y*c.height),a.lineTo(g.x*c.width,g.y*c.height),a.stroke())}a.restore()}}); | ||
t("drawRectangle",function(a,d,b){b=v(b);a.save();var c=a.canvas;a.scale(c.width,c.height);a.fillStyle=b.color;a.translate(d.xCenter,d.yCenter);a.rotate(d.rotation*Math.PI/180);a.fillRect(-d.width/2,-d.height/2,d.width,d.height);a.restore()});}).call(this); |
{ | ||
"name": "@mediapipe/drawing_utils", | ||
"description": "Mediapipe Simple Drawing Utilities", | ||
"version": "0.1.1606863251", | ||
"version": "0.1.1606873488", | ||
"author": "mhays@google.com", | ||
@@ -6,0 +6,0 @@ "license": "Apache-2.0", |
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
3415