MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / flipYBuffer

Method flipYBuffer

src/opengl_depth_packet_processor.cpp:367–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365 }
366
367 void flipYBuffer(unsigned char *data)
368 {
369 typedef unsigned char type;
370
371 size_t linestep = width * bytes_per_pixel / sizeof(type);
372
373 type *first_line = reinterpret_cast<type *>(data), *last_line = reinterpret_cast<type *>(data) + (height - 1) * linestep;
374
375 for(size_t y = 0; y < height / 2; ++y)
376 {
377 for(size_t x = 0; x < linestep; ++x, ++first_line, ++last_line)
378 {
379 std::swap(*first_line, *last_line);
380 }
381 last_line -= 2 * linestep;
382 }
383 }
384
385 Frame *downloadToNewFrame()
386 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected