/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import o from"../../Camera.js";import{rad2deg as e,deg2rad as r}from"../../core/mathUtils.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,add as n}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../geometry/Point.js";import a from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as s}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as m}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as p}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as f}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as u}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as d,viewModeDependentUtil as R}from"./support/viewingModeUtils.js";const A={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},g={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_DEPTH:"cutfill-depth",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian-splat",HIGHLIGHTS:"highlight-color",LASERLINES:"laserline-color",MAGNIFIER:"magnifier-color",OCCLUDED:"occluded-color",OPAQUE_ENVIRONMENT:"opaque-environment-color",OPAQUE_TERRAIN:"opaque-terrain-color",SSAO:"ssao",TRANSPARENT_ENVIRONMENT:"transparent-environment-color",VIEWSHED:"viewshed-color"};function j(o,e,r,t,i,n,l){return t=t||o.spatialReference,m(e,t,r,i,o.renderCoordsHelper.spatialReference,n,l)?i:null}function E(o,e,r,t,i,n,l){return n=n||o.spatialReference,m(e,o.renderCoordsHelper.spatialReference,r,t,n,i,l)?t:null}function T(o,e,r,i){return i||(i=t()),r=r||o.spatialReference,s(r,e,i,o.renderCoordsHelper.spatialReference)?i:null}function S(r,t,i){const n=r.renderSpatialReference,l=d(r,t.eye,t.viewForward,t.up,N);let s=r.spatialReference;return f(t.eye,n,I,s)||(s=a.WGS84,f(t.eye,n,I,s)),null==i?i=new o(new c(I,s),l.heading,l.tilt,e(t.fov)):(i.position.x=I[0],i.position.y=I[1],i.position.z=I[2],i.position.spatialReference=s,i.heading=l.heading,i.tilt=l.tilt,i.fov=e(t.fov)),i.layout.row=t.row,i.layout.rows=t.rows,i.layout.column=t.column,i.layout.columns=t.columns,i}function y(o,e){if(!e)return null;const t=o.renderSpatialReference,c=R(o).headingTiltToDirectionUp,a=l();if(!p(e.position,a,t))return null;const s=c(a,e.heading,e.tilt);i(s.direction,s.direction,o.state.camera.distance),n(s.direction,s.direction,a);const m=u(o,a,s.direction,s.up);return m.fov=r(e.fov),m.row=e.layout.row,m.rows=e.layout.rows,m.column=e.layout.column,m.columns=e.layout.columns,m}const I=l(),N={heading:0,tilt:0};export{g as InternalRenderCategory,A as RenderNodeOutput,S as fromRenderCamera,E as fromRenderCoordinates,T as renderCoordinateTransformAt,y as toRenderCamera,j as toRenderCoordinates};
