use memcpy to copy color image instead of nested for-loops

To speed up streaming of color image, this PR uses `std::memcpy` to copy array instead of for-loops.