The challenge for you is to develop a set of classes that should implement the following functions:
1. Real-time editing of the imaging data from iPhone’s camera and displaying the result on the screen
2. Saving of the edited image when user performs certain actions
To use this framework in an iOS application instance of a certain class of this framework should be created. Name of this class should be “CustomCameraView”.
Edited (distorted) image from the camera should appear, when method “show” of the class “CustomCamera View” is called. The magnitude of distortion depends on the angle of the iphone’s tilt and the value of “maxTopWidthFactor” variable, which is passed as a parameter to the “show” function.
iPhone’s tilt angle Original photo Edited photo
Rectangular image from camera is transformed into a trapezoid, such that the length of the bottom base (bottomLength) is constant and the length of the top base varies in the range from bottomLength to bottomLength*maxTopWidthFactor.
When the phone is positioned vertically (the tilt angle= 0°, perpendicular to the ground), then the length of the top base = bottomLength.
When the phone is positioned horizontally (tilt angle =90°, parallel to the ground), then the length of the top base equals bottomLength* maxTopWidthFactor. The image seen by the user on the screen is changing in real time accordingly to the changes of the tilt angle.
There also should be a button on the view from the camera, that should call the capture delegate method. This method receives a link to the object UIImage, that should be capable of being saved later.