CIKeystoneCorrectionVertical/Horizontal: how does it work?

I am playing around with the keystoneCorrection filters. The properties that one can change are inputTopLeft, inputTopRight, inputBottomLeft, inputBottomRight, and inputFocalLength, The problem is that I cannot find any documentation as to how this filter works or any sample code. Would anyone have insights as to how this all works?