private void firstPass(Octree tree, BitmapData data, int width, int height) { byte* srcRow = (byte*)data.Scan0.ToPointer(); Int32* srcPxl; for (int row = 0; row < height; ++row) { srcPxl = (Int32*)srcRow; for (int col = 0; col < width; ++col, ++srcPxl) tree.addColor((Color32*)srcPxl); srcRow += data.Stride; } }