(
imageShape: [number, number, number, number],
fillValue: number|[number, number, number])
| 30 | size = true; |
| 31 | |
| 32 | constructor( |
| 33 | imageShape: [number, number, number, number], |
| 34 | fillValue: number|[number, number, number]) { |
| 35 | this.outputShape = imageShape; |
| 36 | this.dispatchLayout = flatDispatchLayout(this.outputShape); |
| 37 | this.dispatch = computeDispatch( |
| 38 | this.dispatchLayout, this.outputShape, this.workgroupSize); |
| 39 | this.uniforms = `centerX : f32, centerY : f32, sinRadians : f32, |
| 40 | cosRadians : f32,`; |
| 41 | this.shaderKey = 'rotate'; |
| 42 | this.outputShape = imageShape; |
| 43 | |
| 44 | if (typeof fillValue === 'number') { |
| 45 | this.uniforms += ` fillValue : f32,`; |
| 46 | this.fillSnippet = `var outputValue = uniforms.fillValue;`; |
| 47 | this.shaderKey += '_float'; |
| 48 | } else { |
| 49 | this.uniforms += ` fillValue : vec3<f32>,`; |
| 50 | this.fillSnippet = `var outputValue = uniforms.fillValue[coords[3]];`; |
| 51 | this.shaderKey += '_vec3'; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | getUserCode(): string { |
| 56 | const userCode = ` |
nothing calls this directly
no test coverage detected