// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/layers/vectorTiles/views/vectorTiles/SchemaHelper",["require","exports"],function(r,t){return function(){function b(a,c){this.lockedSchemaPixelSize=a;this.isWGS84=c}b.prototype.getCompatibleLevelRowCol=function(a){var c=a[0],d=a[1];a=a[2];this.isWGS84?(d>>=1,a>>=1):256===this.lockedSchemaPixelSize&&0<c&&(c--,d>>=1,a>>=1);return[c,d,a]};b.prototype.getSchemaShift=function(a,c){var d=0,b=0;if(256===this.lockedSchemaPixelSize||this.isWGS84)a[2]%2&&(d=2*c),a[1]%2&&(b=2*c);return[d,b]};b.prototype.adjustLevel=
function(a){return this.isWGS84?a:256===this.lockedSchemaPixelSize?0<a?a-1:0:a};b.create256x256CompatibleTileInfo=function(a){if(!a)return null;if(256===a.rows&&256===a.cols)return a;for(var c=a.format,d=a.compressionQuality,b=a.dpi,p=a.origin,k=a.spatialReference,l=4326===k.wkid,f=[],g,m,h=a.lods.length,e=0;e<h;e++){var n=a.lods[e];g=n.scale;m=l?n.resolution:2*n.resolution;f.push({level:n.level,scale:g,resolution:m})}return{rows:256,cols:256,dpi:b,format:c,compressionQuality:d,origin:p,spatialReference:k,
lods:f}};b.create512x512CompatibleTileInfo=function(a){if(!a||256===a.rows||256===a.cols)return null;for(var c=a.format,b=a.compressionQuality,q=a.dpi,p=a.origin,k=a.spatialReference,l=[],f,g,m=a.lods.length,h=0;h<m;h++){var e=a.lods[h];f=e.scale;g=.5*e.resolution;l.push({level:e.level,scale:f,resolution:g})}return{rows:512,cols:512,dpi:q,format:c,compressionQuality:b,origin:p,spatialReference:k,lods:l}};return b}()});