UNPKG

@openhps/video

Version:

Open Hybrid Positioning System

2 lines 4.22 kB
import{DataFrame as e,DataObject as t,LengthUnit as r,Matrix3 as s,ProcessingNode as i,SerializableArrayMember as o,SerializableMember as p,SerializableObject as n}from"./openhps-core.es.min.js";function c(e,t,r,s){var i,o=arguments.length,p=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(e,t,r,s);else for(var n=e.length-1;n>=0;n--)(i=e[n])&&(p=(o<3?i(p):o>3?i(t,r,p):i(t,r))||p);return o>3&&p&&Object.defineProperty(t,r,p),p}function a(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;let d=class CameraObject extends t{get focalLength(){if(this.cameraMatrix)return[this.cameraMatrix.elements[0],this.cameraMatrix.elements[4]]}get principalPoint(){if(this.cameraMatrix)return[this.cameraMatrix.elements[6],this.cameraMatrix.elements[7]]}get aspect(){return this.width/this.height}get rows(){return this.height}set rows(e){this.height=e}get cols(){return this.width}set cols(e){this.width=e}constructor(e,t,r,s){var i;super(e,t),this.colorOrder=g.RGB,this.width=r||0,this.height=s||0,this.distortionCoefficients=null!==(i=this.distortionCoefficients)&&void 0!==i?i:[0,0,0,0,0]}};var g;c([p(),a("design:type",Number)],d.prototype,"width",void 0),c([p(),a("design:type",Number)],d.prototype,"height",void 0),c([o(Number),a("design:type",Array)],d.prototype,"distortionCoefficients",void 0),c([p(),a("design:type",s)],d.prototype,"cameraMatrix",void 0),c([p(),a("design:type",Number)],d.prototype,"fps",void 0),c([p(),a("design:type",Number)],d.prototype,"colorOrder",void 0),d=c([n(),a("design:paramtypes",[String,String,Number,Number])],d),function(e){e[e.RGB=0]="RGB",e[e.BGR=1]="BGR",e[e.GRAYSCALE=2]="GRAYSCALE",e[e.RGBA=3]="RGBA",e[e.BGRA=4]="BGRA"}(g||(g={}));let h=class PerspectiveCameraObject extends d{constructor(e,t,r,s,i=50,o=.1,p=2e3){super(e,t,r,s),this.fov=i,this.near=o,this.far=p}};c([p(),a("design:type",Number)],h.prototype,"fov",void 0),c([p(),a("design:type",Number)],h.prototype,"near",void 0),c([p(),a("design:type",Number)],h.prototype,"far",void 0),h=c([n(),a("design:paramtypes",[String,String,Number,Number,Object,Object,Object])],h);let u=class StereoCameraObject extends d{constructor(e,t,r,s){super(e,t),this.eyeSep=.064,this.cameraL=r,this.cameraR=s,void 0!==r&&void 0!==s&&(this.uid=r.uid+s.uid)}};c([p(),a("design:type",h)],u.prototype,"cameraL",void 0),c([p(),a("design:type",h)],u.prototype,"cameraR",void 0),c([p(),a("design:type",Object)],u.prototype,"eyeSep",void 0),u=c([n(),a("design:paramtypes",[String,String,h,h])],u);let m=class ImageFrame extends e{get rows(){return this.height}set rows(e){this.height=e}get cols(){return this.width}set cols(e){this.width=e}get source(){return super.source}set source(e){super.source=e}};c([p(),a("design:type",Object)],m.prototype,"image",void 0),c([p(),a("design:type",Number)],m.prototype,"height",void 0),c([p(),a("design:type",Number)],m.prototype,"width",void 0),c([p(),a("design:type",Number)],m.prototype,"fourcc",void 0),c([p(),a("design:type",Number)],m.prototype,"fps",void 0),m=c([n()],m);let y=class VideoFrame extends m{};y=c([n()],y);let l=class StereoImageFrame extends e{get source(){return super.source}set source(e){super.source=e}};c([p(),a("design:type",m)],l.prototype,"left",void 0),c([p(),a("design:type",m)],l.prototype,"right",void 0),l=c([n()],l);let f=class StereoVideoFrame extends l{};f=c([n()],f);let b=class DepthImageFrame extends m{};c([p(),a("design:type",Object)],b.prototype,"depth",void 0),c([p(),a("design:type",r)],b.prototype,"depthUnit",void 0),b=c([n()],b);let v=class DepthVideoFrame extends b{};v=c([n()],v);class ImageProcessingNode extends i{constructor(e){super(e)}process(e){return new Promise((t,r)=>{e.image?this.processImage(e.image,e).then(r=>{e.image=r,t(e)}).catch(r):t(e)})}}export{d as CameraObject,g as ColorOrder,b as DepthImageFrame,v as DepthVideoFrame,m as ImageFrame,ImageProcessingNode,h as PerspectiveCameraObject,u as StereoCameraObject,l as StereoImageFrame,f as StereoVideoFrame,y as VideoFrame}; //# sourceMappingURL=openhps-video.es.min.js.map