Use shared_ptr to contain pixel data. Try to support 16bit pixel data.