(
gl: WebGL2RenderingContext, texture: WebGLTexture, size: Size,
flipHorizontal = true, rotation: Rotation = 0)
| 238 | * @doc {heading: 'Media', subheading: 'Camera'} |
| 239 | */ |
| 240 | export function renderToGLView( |
| 241 | gl: WebGL2RenderingContext, texture: WebGLTexture, size: Size, |
| 242 | flipHorizontal = true, rotation: Rotation = 0) { |
| 243 | tf.util.assert( |
| 244 | [0, 90, 180, 270, 360, -90, -180, -270].includes(rotation), |
| 245 | () => 'renderToGLView Error: rotation must be ' + |
| 246 | '0, +/- 90, +/- 180, +/- 270 or 360'); |
| 247 | |
| 248 | size = { |
| 249 | width: Math.floor(size.width), |
| 250 | height: Math.floor(size.height), |
| 251 | }; |
| 252 | drawTexture(gl, texture, size, flipHorizontal, rotation); |
| 253 | } |
no test coverage detected
searching dependent graphs…