since you need x and y coordinates, anyway, I would prefer:
```c++
for (int y = 0; y < height; ++y) {
    USHORT *line = data + y * width;
    for (int x = 0; x < width; ++x) {
        NuiTransformDepthImageToSkeleton(x, y, line[x]);
```