| 327 | return result.buffer; |
| 328 | } |
| 329 | rotate180(pixels, width, height) { |
| 330 | let buffer = new Uint16Array(pixels); |
| 331 | let result = new Uint16Array(height * width); |
| 332 | let v = 0; |
| 333 | while (v < height) { |
| 334 | let u = 0; |
| 335 | while (u < width) { |
| 336 | let x = width - 1 - u; |
| 337 | let y = height - 1 - v; |
| 338 | let src = ((v * width) + u); |
| 339 | let dst = ((y * width) + x); |
| 340 | result[dst] = buffer[src]; |
| 341 | u++; |
| 342 | } |
| 343 | v++; |
| 344 | } |
| 345 | return result.buffer; |
| 346 | } |
| 347 | rotate270(pixels, width, height) { |
| 348 | let buffer = new Uint16Array(pixels); |
| 349 | let result = new Uint16Array(height * width); |