/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{spritePadding as t}from"../definitions.js";import{createPlayer as i,updateIfNeeded as a}from"./utils.js";class e{constructor(t,a,e,h){this._animation=t,this._frameData=null;const s=t=>{this._frameData=t,a.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._player=i(this._animation,e,h,s)}destroy(){}loadFrame(i){const a=this._frameData;if(null==a)return;const e="width"in a?a.width:a.codedWidth,h="height"in a?a.height:a.codedHeight;i.updateData(0,t,t,e,h,a),this._frameData=null}get hasFrameData(){return null!=this._frameData}update(t){a(t,this._player)}}export{e as AnimatableTextureResource};
