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

Method copyFrame

src/openni2/ColorStream.cpp:91–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void ColorStream::copyFrame(uint8_t* srcPix, int srcX, int srcY, int srcStride, uint8_t* dstPix, int dstX, int dstY, int dstStride, int width, int height, bool mirroring)
92{
93 srcPix += srcX + srcY * srcStride;
94 dstPix += dstX + dstY * dstStride;
95
96 for (int y = 0; y < height; y++) {
97 uint8_t* dst = dstPix + y * dstStride;
98 uint8_t* src = srcPix + y * srcStride;
99 if (mirroring) {
100 dst += dstStride - 1;
101 for (int x = 0; x < srcStride; ++x)
102 {
103 if (x % 4 != 3)
104 {
105 *dst-- = *src++;
106 }
107 else
108 {
109 ++src;
110 }
111 }
112 } else {
113 for (int x = 0; x < dstStride-2; x += 3)
114 {
115 *dst++ = src[2];
116 *dst++ = src[1];
117 *dst++ = src[0];
118 src += 4;
119 }
120 }
121 }
122}
123
124OniSensorType ColorStream::getSensorType() const { return ONI_SENSOR_COLOR; }
125

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected