MCPcopy Index your code
hub / github.com/gpujs/gpu.js / getPixelsFlipped

Function getPixelsFlipped

test/features/get-pixels.js:167–192  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

165
166
167function getPixelsFlipped(mode) {
168 const gpu = new GPU({ mode });
169 const kernel = gpu.createKernel(function(v) {
170 this.color(
171 v[this.thread.y][this.thread.x][0],
172 v[this.thread.y][this.thread.x][1],
173 v[this.thread.y][this.thread.x][2]
174 );
175 }, {
176 output: [2,2],
177 graphical: true,
178 });
179 kernel([
180 [
181 [.02,.04,.06,.08],
182 [.10,.12,.14,.16]
183 ],
184 [
185 [.18,.20,.22,.24],
186 [.26,.28,.30,.32]
187 ]
188 ]);
189 const pixels = Array.from(kernel.getPixels(true));
190 gpu.destroy();
191 return pixels;
192}
193
194
195test('flipped auto', () => {

Callers 1

get-pixels.jsFile · 0.85

Calls 5

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
colorMethod · 0.65
getPixelsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…