convert function to use cached getHeight/Width
convert doTransform to use cached functions