I am making a three dimensional array for image manipulation – X and Y dimensions and then a third dimension because each pixel has not one value but (bitsPerPixel/8) values.
I am frankly not very well versed in C++ but the API for the camera is strictly C++ and so I want to check up with somebody more skilled before I set out and ask “is this right?”:
vector<vector<vector<int>>> mask(m_nSizeX, vector<vector<int>>(m_nSizeY, vector<int>(m_nBitsPerPixel / 8)));
If you have C++11 support, then yes.
If not, you need some extra spaces in your templates:
instead of
and so on…
Although I personally wouldn’t use a
vectorfor the last value, but rather a structure.