Default Magnification gesture android source code


I am looking for some help in Android Magnification gesture. Recently a year back Samsung launch S4 and Nexus also launched 4 & 5. All these devices are having one very good feature called Magnification in Accessibility settings. I would like to get the code of Magnification from the Android open source project for one of my project.

Also I would like to know that if I get the code and implement it, does the device need to be ROOTED for that or normal device can run that code of magnification as currently there is no API available for magnification gesture in android.