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

Function TextureMapDrawCursor

Samples/NiViewer/Draw.cpp:236–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void TextureMapDrawCursor(XnTextureMap* pTex, IntPair cursor, int red = 255, int green = 0, int blue = 0)
237{
238 // marked pixel
239 TextureMapSetPixel(pTex, cursor.X, cursor.Y, red, green, 0);
240
241 // top left marker
242 TextureMapSetPixel(pTex, cursor.X-2, cursor.Y-2, red, green, blue);
243 TextureMapSetPixel(pTex, cursor.X-2, cursor.Y-1, red, green, blue);
244 TextureMapSetPixel(pTex, cursor.X-1, cursor.Y-2, red, green, blue);
245
246 // top right marker
247 TextureMapSetPixel(pTex, cursor.X+2, cursor.Y-2, red, green, blue);
248 TextureMapSetPixel(pTex, cursor.X+2, cursor.Y-1, red, green, blue);
249 TextureMapSetPixel(pTex, cursor.X+1, cursor.Y-2, red, green, blue);
250
251 // bottom left marker
252 TextureMapSetPixel(pTex, cursor.X-2, cursor.Y+2, red, green, blue);
253 TextureMapSetPixel(pTex, cursor.X-2, cursor.Y+1, red, green, blue);
254 TextureMapSetPixel(pTex, cursor.X-1, cursor.Y+2, red, green, blue);
255
256 // bottom right marker
257 TextureMapSetPixel(pTex, cursor.X+2, cursor.Y+2, red, green, blue);
258 TextureMapSetPixel(pTex, cursor.X+2, cursor.Y+1, red, green, blue);
259 TextureMapSetPixel(pTex, cursor.X+1, cursor.Y+2, red, green, blue);
260}
261
262void TextureMapUpdate(XnTextureMap* pTex)
263{

Callers 2

drawColorImageFunction · 0.85
drawDepthFunction · 0.85

Calls 1

TextureMapSetPixelFunction · 0.85

Tested by

no test coverage detected