Jump to content

[How to] Make Photoshop Plugin

programming c++

  • Please log in to reply
2 replies to this topic

#1
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,193 posts
  • Gender:Male
  • Location:Moscow

I did this and I want to share my achievements.
 
I speak about Photoshop CS4 because it allows to use smart plugins. CS6 has reduced plugins system.
CS4 works fine under 10.6 - 10.9.2 as well. The application is 32bits and so it accepts plugins only 32bits.
 
For the development you need XCode from 3.1 up to modern 5.0.2 but you need to take somewhere MacOS10.6SDK.
Only this SDK is good for the purpose! Take here or extract official way

If it cannot be found there you will need to extract and copy it from Xcode 4.3. To do this:


  • Download the XCode 4.3 .dmg file from the Apple Developer portal (you'll need an Apple Developer account).
  • Download the utility Pacifist and use it to extract the 10.6 SDK from the XCode 4.3 .dmg file. Click on the "Extract Package" button, find the SDK by searching for 10.6 in the search box, then Ctrl + click on the MacOSX10.6.sdk directory and Extract it to a suitable location.
  • Add a symlink from the 10.6 SDK location to the/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ directory. 

 
Next you have to download adobe_photoshop_cs4_sdk_mac.zip. It is available for free.
The SDK is written for Carbon and contains PowerPC technologies and code  B)  We should cleanup this to do it compilable.
Adobe Photoshop CS4 SDK/photoshopapi/photoshop/PIActions.h:

-#include "AERegistry.h"
+//#include "AERegistry.h"

In many places make a replace

-#include <Carbon.h>
+#include <Carbon/Carbon.h>

Adobe Photoshop CS4 SDK/photoshopapi/photoshop/PITypes.h


-typedef unsigned32	uint32;
+//typedef unsigned32	uint32;

Adobe Photoshop CS4 SDK/samplecode/common/includes/DialogUtilities.h


 #else // Macintosh and others
-	#include <Dialogs.h>			// Macintosh standard dialogs
-	#include <Types.h>				// Macintosh standard types
-	#include <Gestalt.h>			// Macintosh gestalt routines
-	#include <TextUtils.h>			// Macintosh text utilities (GetString())
-	#include <OSUtils.h>			// Macintosh OS Utilities (Delay())
-	#include <Menus.h>				// Macintosh Menu Manager routines (DelMenuItem())
+//	#include <Dialogs.h>			// Macintosh standard dialogs
+//	#include <Types.h>				// Macintosh standard types
+//	#include <Gestalt.h>			// Macintosh gestalt routines
+//	#include <TextUtils.h>			// Macintosh text utilities (GetString())
+//	#include <OSUtils.h>			// Macintosh OS Utilities (Delay())
+//	#include <Menus.h>				// Macintosh Menu Manager routines (DelMenuItem())
 #endif

Adobe Photoshop CS4 SDK/samplecode/common/includes/PIUFile.h


-#include <Folders.h>
+//#include <Folders.h>

Adobe Photoshop CS4 SDK/samplecode/common/includes/PIUI.h


-	#include "Lists.h"
+//	#include "Lists.h"

Adobe Photoshop CS4 SDK/samplecode/common/includes/PIUtilities.h


- 	#include <LowMem.h>
-	#include <ToolUtils.h>
-	#include <FixMath.h>
+// 	#include <LowMem.h>
+//	#include <ToolUtils.h>
+//	#include <FixMath.h>

After that you can compile sample projects and see how it works.
In XCode you have to set
BaseSDK = OS10.6
arch=i386
Other CC flags = -DMAC_ENV
 
Now I wish to show you my sample: OpenEXR format plugin. CS4 already contain it but with some differences.
And my version is customizable.
Sources of the format is available at official site http://www.openexr.com/
There is also photoshop plugin version 1.2.1 but it is intended for very old SDK and PowerPC Mac. I spend some time to rewrite it for new SDK CS4 and new OpenEXR 2.1.0.
How it works.
Initial view. You see overexposure in window
Attached File  Screen Shot 2014-04-10 at 14.03.32.png   273.98KB   2 downloads
Tuning exposure you can take a view in the window but dark in the room.
Attached File  Screen Shot 2014-04-10 at 14.03.58.png   162.85KB   2 downloads
Tuning Gamma you can compress brightness range
Attached File  Screen Shot 2014-04-10 at 14.04.29.png   218.06KB   2 downloads
The final image can be saved with different compressions
Attached File  Screen Shot 2014-04-10 at 15.35.12.png   62.35KB   3 downloads
 
This is the plugin. For sources ask in PM.
Attached File  MyExr2.plugin.zip   544.31KB   0 downloads



#2
eʍwe

eʍwe

    InsanelyMac Protégé

  • Members
  • PipPip
  • 78 posts
  • Gender:Male
  • Location:Jongen
  • Interests:Respect to the others

Wow.. great guide. what kind of basic coding to apply/create with xcode? really.. i'm noob about coding world.

Nice share slice..!

 

:thumbsup_anim:  :thumbsup_anim:



#3
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,193 posts
  • Gender:Male
  • Location:Moscow

After XCode update to 5.1.1 it became impossible. Apple decided to not support 32 bit developement.  :thumbsdown_anim:

 

 

EDITED.

So I had to install XCode 4.4.1 on Maverics  :P . It works. Apple, you may run forward.







Also tagged with one or more of these keywords: programming, c++


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy