added rotation support and bgr module argument