First implementation of support for all bit depths.
I had to create many *_internal templates function to deal with
multiple bit depths.

ColorSpace conversion is not handled yet for 8bits, 16 bits.