Added convenience function for setting the pixel format.