Originally Posted by
matsp
Going back to the original question.
If you have a base class with a member variable X, and want to REPLACE that member variable in a derived class with one that is of a different, then you are effectively hiding the original X. It would then be better to have an "empty" base-class (abstract base class) that doesn't have ANY X member, and implement two classes that derive from the base-class, one with X of type 1, and the other with X of type 2.
In the case of a camera, you may have completely different formats of the camera buffer. To implement a common functionality, you probably would have to TRANSLATE, or provide a function to read out individual pixels in a common format, since you may have one camera that packs 12 bits per pixel per plane into a buffer of 48 bits (6 bytes), and another than puts 8 bits per pixel per plane into 24 bits (3 bytes), yet another uses 8 bits per pixel, but for efficient memory handling stores it in 32 bits (4 bytes). The order of R, G, B may differ, etc, etc. In this case, you can't just have a function to fetch the buffer, but you need a function that retrieves the pixels in a uniform way.
--
Mats