Lens Correct - (c Copyright 2009 Adobe Systems Incorporated All rights reserved Lens Correct automation in JavaScript Copy the.jsx file to Adobe

Lens Correct - (c Copyright 2009 Adobe Systems Incorporated...

This preview shows page 1 - 3 out of 13 pages.

// (c) Copyright 2009. Adobe Systems, Incorporated. All rights reserved. // // Lens Correct automation in JavaScript // // // Copy the .jsx file to Adobe Photoshop CS5/Presets/Scripts and // .eve file to Adobe Photoshop CS5/Presets/Scripts/Stack Scripts Only/ // /* @@@[email protected]@@ Lens Correct.jsx 1.0.0.2 */ /* // BEGIN__HARVEST_EXCEPTION_ZSTRING <javascriptresource> <name>$$$/JavaScripts/LensCorrect/Menu=Lens Correction...</name> <menu>automate</menu> </javascriptresource> // END__HARVEST_EXCEPTION_ZSTRING */ // on localized builds we pull the $$$/Strings from a .dat file $.localize = true; // Put header files in a "Stack Scripts Only" folder. The "...Only" tells // PS not to place it in the menu. For that reason, we do -not- localize that // portion of the folder name. var g_StackScriptFolderPath = app.path + "/"+ localize("$$ $/ScriptingSupport/InstalledScripts=Presets/Scripts") + "/" + localize("$$ $/private/Exposuremerge/StackScriptOnly=Stack Scripts Only/"); $.evalFile(g_StackScriptFolderPath + "LatteUI.jsx"); $.evalFile(g_StackScriptFolderPath + "StackSupport.jsx"); $.evalFile(g_StackScriptFolderPath + "CreateImageStack.jsx"); // Keeps the settings of the script dialog function LensCorrect( ) { this.jpegTypeItem = "JPG"; this.pngTypeItem = "PNG"; this.psdTypeItem = "PSD"; this.tiffTypeItem = "TIFF"; this.edgeExtension = localize("$$ $/LensCorrect/Dialog/FillType/Popup/EdgeExtension=Edge Extension"); this.edgeTransparency = localize("$$ $/LensCorrect/Dialog/FillType/Popup/Transparency=Transparency"); this.edgeBlackColor = localize("$$ $/LensCorrect/Dialog/FillType/Popup/BlackColor=Black Color"); this.edgeWhiteColor = localize("$$ $/LensCorrect/Dialog/FillType/Popup/WhiteColor=White Color"); this.outFolder = null; this.lcpFile = null; this.saveType = this.psdTypeItem; this.edgeType = this.edgeTransparency; this.correctGD = true; this.correctCA = false; this.correctVg = false;
Image of page 1
this.autoScale = true; this.autoMatch = true; //This is an example descriptor code //IT IS NOT USED IN THIS EXAMPLE, HERE FOR DOCUMENTATION PURPOSES //If it's not defined/passed in, plugin will use default values /* var lcpDesc = new ActionDescriptor(); //Auto Correct Geometric Distortion var idLnAg = charIDToTypeID( "LnAg" ); lcpDesc.putBoolean( idLnAg, true ); //Auto Correct Chromatic Aberration var idLnAc = charIDToTypeID( "LnAc" ); lcpDesc.putBoolean( idLnAc, true ); //Auto Vignette Removal var idLnAv = charIDToTypeID( "LnAv" ); lcpDesc.putBoolean( idLnAv, true ); //Auto Scale Image var idLnAs = charIDToTypeID( "LnAs" ); lcpDesc.putBoolean( idLnAs, true ); //Auto Profile Interpolation var idLnIp = charIDToTypeID( "LnIp" ); lcpDesc.putBoolean( idLnIp, false ); //Focus Distance var idLnFo = charIDToTypeID( "LnFo" ); lcpDesc.putDouble( idLnFo, 0.000000 ); //LCP Path (this descriptor is used in this code, so below is another example) var idLnPp = charIDToTypeID( "LnPp" ); lcpDesc.putString( idLnPp, "" ); //Applied Lens Profile var idLnPr = charIDToTypeID( "LnPr" ); lcpDesc.putString( idLnPr, "" ); // setup null profile //CUSTOM SETTINGS //Distortion Amount var idLnIa = charIDToTypeID( "LnIa" ); lcpDesc.putDouble( idLnIa, 0.000000 ); //Distortion Coefficient 0 var idLnIzero = charIDToTypeID( "LnI0" ); lcpDesc.putDouble( idLnIzero, 0.000000 ); //Distortion Coefficient 1 var idLnIone = charIDToTypeID( "LnI1" ); lcpDesc.putDouble( idLnIone, 0.000000 ); //Distortion Coefficient 2 var idLnItwo = charIDToTypeID( "LnI2" ); lcpDesc.putDouble( idLnItwo, 0.000000 ); //Distortion Coefficient 3
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 13 pages?

  • Summer '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes