use std::fill() (it’s C++!)
use std::copy (it’s C++!)
more logical code layout
Buffer size is now in number of elements instead of bytes

also:
- BitDepth -> DataType
- use new/delete/std::copy/std::fill instead of
malloc/free/memcpy/memset when possible
add quotes around warning messages
use size_t instead of U64 for sizes