MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / rotate270

Method rotate270

tools/image2cs.js:347–364  ·  view source on GitHub ↗
(pixels, width, height)

Source from the content-addressed store, hash-verified

345 return result.buffer;
346 }
347 rotate270(pixels, width, height) {
348 let buffer = new Uint16Array(pixels);
349 let result = new Uint16Array(height * width);
350 let v = 0;
351 while (v < height) {
352 let u = 0;
353 while (u < width) {
354 let x = v;
355 let y = width - 1 - u;
356 let src = ((v * width) + u);
357 let dst = ((y * height) + x);
358 result[dst] = buffer[src];
359 u++;
360 }
361 v++;
362 }
363 return result.buffer;
364 }
365 run() {
366 var fps_numerator;
367 var fps_denominator;

Callers 2

readPNGMethod · 0.45
runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected