Given an encoded origin and the width and height of the source data, returns a matrix that transforms the source rectangle with upper left corner at 0, 0 and origin to a correctly oriented destination rectangle of 0, 0, w, h.