MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / TextureMapSetPixel

Function TextureMapSetPixel

Samples/NiViewer/Draw.cpp:222–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void TextureMapSetPixel(XnTextureMap* pTex, int x, int y, int red, int green, int blue)
223{
224 if (x < 0 || y < 0 || x >= (int)pTex->OrigSize.X || y >= (int)pTex->OrigSize.Y)
225 return;
226
227 unsigned char* pPixel = TextureMapGetLine(pTex, y) + x * pTex->nBytesPerPixel;
228 pPixel[0] = red;
229 pPixel[1] = green;
230 pPixel[2] = blue;
231
232 if (pTex->nBytesPerPixel > 3)
233 pPixel[3] = 255;
234}
235
236void TextureMapDrawCursor(XnTextureMap* pTex, IntPair cursor, int red = 255, int green = 0, int blue = 0)
237{

Callers 1

TextureMapDrawCursorFunction · 0.85

Calls 1

TextureMapGetLineFunction · 0.85

Tested by

no test coverage detected