PIGeneral.h File Reference

This file contains the public definitions and structures used by all plug-ins. More...

#include "PITypes.h"
#include "PIResDefines.h"
#include "SPFiles.h"

Go to the source code of this file.

Data Structures

struct  TypeCreatorPair
 Mac OS structure for file formats comprised of { 'type', 'crea' }. More...
struct  PlugInInfo
 Information about the Plug-in. More...
struct  PIBlendMode
 Blend Mode Information. More...
struct  PlugInMonitor
 Monitor setup information. More...
struct  PSPixelMask
 Pixel mask Information. More...
struct  PSPixelOverlay
 Pixel Overlay Information. More...
struct  PSPixelMap
 Describes a block of pixels for display purposes. More...
struct  PSPlatformContext
 Describes the platformContext used in DisplayPixeldProc. More...
struct  ColorServicesInfo
 This data structure is used in the ColorServicesProc callback function. More...
struct  PSImagePlane
 Describes the 8-bit plane of pixel data used by the image services callback functions. More...
struct  PSImageMultiPlane
 Describes multiple 8-bit planes of pixel data used by the image services callback functions. More...
struct  PSImageMultiPlane32
 Describes multiple planes of pixel data used by the image services callback functions. More...
struct  PixelMemoryDesc
 Describes an area of memory as pixels. More...
struct  PSScaling
 Provide a scaling through a rectangle in source space and a corresponding rectangle in destination space. More...
struct  WriteChannelDesc
 The channel to write a selection to. More...
struct  ReadChannelDesc
 A channel to read from. More...
struct  ReadLayerDesc
 A layer to read. More...
struct  ReadImageDocumentDesc
 The document information, used by the Export, Filter, and Selection module parameter blocks. More...
struct  BufferProcs
 The set of routines available in the Buffer Procs. More...
struct  ResourceProcs
 The set of routines available in the Resource suite. More...
struct  HandleProcs
struct  ImageServicesProcs
 The set of routines available in the Image Services suite. More...
struct  PropertyProcs
 The set of routines available in the Property Suite. More...
struct  ChannelPortProcs
 The set of routines available for teh Channel Ports Suite. More...
struct  PSMatrixMathProcs
 The set of routines available for the Matrix Math Suite. More...
struct  PIInterfaceColor
 Interface color definition used with Property Suite property propInterfaceColor. More...

Defines

#define kPhotoshopSignature   0x3842494d
 The Photoshop signature, '8BIM'.
#define PIVersionProperty   0x76657273L
 Major and minor version number indicating which revision of the plug-in interface this plug-in was written for; key value is 'vers'.
#define PIPriorityProperty   0x70727479L
 Plug-in load order; key value is 'prty'.
#define PIComponentProperty   0x636d7074L
 Component and Version ids; key value is 'cmpt'.
#define PIImageModesProperty   0x6d6f6465L
 Image modes that the plug-in supports; key value is 'mode'.
#define PIEnableInfoProperty   0x656e626cL
 A string of modula-like expressions that, upon evaluation, must all be true for the plug-in to be enabled in the menu; key value is 'enbl'.
#define PIWantsScrapProperty   0x776E7363L
 The plug-in wants the host to export image scrap; key value is 'wnsc'.
#define PICocoaProperty   0x636F636FL
 The plug-in wants the host to keep it loaded as unloading Cocoa plug-ins could result in objective-c messages going to no where This property key reflects the Cocoa property in the PiPL resource file.
#define PIFileBrowserAwareProperty   0x66626177L
 The plug-in wants in the File Browser menu; key value is 'fbaw'.
#define PINoAboutBoxProperty   0x6E61626FL
 The plug-in does not want an about box menu entry; key value is 'nabo'.
#define PILegacyFilterGalleryMenuItemProperty   0x6C46476DL
 The plug-in is a Filter Gallery plugin and its menu should be hidden by the preference.
#define PIFilterLayerSupport   0x666c6c79L
 Plug-in filter layer properties; key value is 'flly'.
#define PIRequiredHostProperty   0x686f7374L
 Creator code of required host; key value is 'host'.
#define PICategoryProperty   0x63617467L
 In the Filter menu, what sub-menu to list this plug-in; key value is 'catg'.
#define PIZCategoryProperty   0x7A636174L
 In the Filter menu, what sub-menu to list this plug-in; key value is 'zcat'.
#define PINameProperty   0x6e616d65L
 Plug-in menu name for module in PICategoryProperty sub-menu; key value is 'name'.
#define PIZNameProperty   0x7A6E616DL
 Plug-in menu name for module in PICategoryProperty sub-menu; key value is 'znam'.
#define PIProgressTextProperty   0x70726f67
 Plug-in handles all progress bar updates.
#define PIZProgressTextProperty   0x7A70726F
 Plug-in handles all progress bar updates.
#define PIPickerIDProperty   0x706e6d65L
 A unique string (UUID or your own TM string) that differentiates one color picker from another; key value is 'pnme'.
#define PILoadUnloadProperty   0x70694c55
 Plug-in supports load/unload selectors; key is 'piLU'.
#define PIPreferencesProperty   0x70695046
 Plug-in supports preferences dialog selectors; key is 'piPF'.
#define PIFeatureEnabledProperty   0x6665656e
#define PIPositionDependentProperty   0x706f7364
#define PIPerMonitorScalingAware   0x706d7361
#define kPIGeneralInfoSize   16
#define kPIHostBlendModeSignature   '8BIM'
#define plugIncolorServicesForegroundColor   0
 Selects foreground color when ColorServices operation is plugIncolorServicesGetSpecialColor.
#define plugIncolorServicesBackgroundColor   1
 Selects background color when ColorServices operation is plugIncolorServicesGetSpecialColor.
#define PIFilteryLayersSupported   0
#define kCurrentMinVersWriteChannelDesc   0
 Current minimum version of WriteChannelDesc.
#define kCurrentMaxVersWriteChannelDesc   1
 Current maximum version of WriteChannelDesc.
#define kCurrentMinVersReadChannelDesc   0
 Current minimum version of ReadChannelDesc.
#define kCurrentMaxVersReadChannelDesc   5
 Current maximum version of ReadChannelDesc.
#define kCurrentMinVersReadLayerDesc   0
 Current minimum version of ReadLayerDesc.
#define kCurrentMaxVersReadLayerDesc   3
 Current maximum version of ReadLayerDesc.
#define kCurrentMinVersReadImageDocDesc   0
 Current minimum version of the ReadImageDocumentDesc.
#define kCurrentMaxVersReadImageDocDesc   6
 Current maximum version of the ReadImageDocumentDesc.
#define kCurrentBufferProcsVersion   2
 Current version of the Buffer Procs.
#define kPIBufferSuite   "Photoshop Buffer Procs for Plug-ins"
 Unique identifier for the buffer procs.
#define kPIBufferSuiteVersion   kCurrentBufferProcsVersion
 The version of the Buffer Procs.
#define kCurrentBufferProcsCount   ((sizeof(BufferProcs) - offsetof(BufferProcs, allocateProc)) / sizeof(void *))
 Current number of routines in the Buffer Procs.
#define kCurrentResourceProcsVersion   3
 The current version of the resource suite.
#define kPIResourceSuite   "Photoshop Resource Suite for Plug-ins"
 Unique identifier for the Resource suite.
#define kPIResourceSuiteVersion   kCurrentResourceProcsVersion
 Version number for the Resource suite.
#define kCurrentResourceProcsCount   ((sizeof(ResourceProcs) - offsetof(ResourceProcs, countProc)) / sizeof(void *))
 Current number of routines in the Resource Suite.
#define kDayStarColorMatchingResource   'DCSR'
#define kPhotoDeluxeResource   'PHUT'
#define kCurrentHandleProcsVersion   1
 The current version of the handle suite.
#define kPIHandleSuite   "Photoshop Handle Suite for Plug-ins"
 Unique identifier for the Handle suite.
#define kPIHandleSuiteVersion   kCurrentHandleProcsVersion
 The version of the Handle suite.
#define kCurrentHandleProcsCount   ((sizeof(HandleProcs) - offsetof(HandleProcs, newProc)) / sizeof(void *))
 Current number of routines in the Handle Suite.
#define kCurrentImageServicesProcsVersion   1
 Current version for the Image Services Suite.
#define kPIImageServicesSuite   "Photoshop Image Services Suite for Plug-ins"
 Unique identifier for the Image Services suite.
#define kPIImageServicesSuiteVersion   kCurrentImageServicesProcsVersion
 Version of the Image Services suite.
#define kCurrentImageServicesProcsCount   ((sizeof(ImageServicesProcs) - offsetof(ImageServicesProcs, interpolate1DProc)) / sizeof(void *))
 Current number of routines in the Images Services Suite.
#define kCurrentPropertyProcsVersion   1
 Current version of the Property Suite.
#define kPIPropertySuite   "Photoshop Property Suite for Plug-ins"
#define kPIPropertySuiteVersion   kCurrentPropertyProcsVersion
#define kCurrentPropertyProcsCount   ((sizeof(PropertyProcs) - offsetof(PropertyProcs, getPropertyProc)) / sizeof(void *))
 Current number of routines in the Property Suite.
#define kCurrentChannelPortProcsVersion   1
 Current version of the Channel Ports Suite.
#define kPIChannelPortSuite   "Photoshop Channel Ports Suite for Plug-ins"
#define kPIChannelPortSuiteVersion   kCurrentChannelPortProcsVersion
#define kCurrentChannelPortProcsCount   ((sizeof(ChannelPortProcs) - offsetof(ChannelPortProcs, readPixelsProc)) / sizeof(void *))
 Current number of routines in the Channel Ports Suite.
#define kPSMatrixMathSuite   "9cfaa249-e6f1-11d2-b8eb-0060b0c1f95d"
 Unique identifier for the Matrix Math suite.
#define kPSMatrixMathSuiteVersion   1
 Current version of the Matrix Math Suite.
#define PIPersistentProperty   0x70727374L
 Indicates whether the plug-in should always stay loaded; key value is 'prst'.
#define PIReentrantProperty   0x7265656EL
 Indicates whether the plug-in can be reentrant; key value is 'reen'.
#define PILoadWithAlteredSearchPath   0x61646C6CL
 Indicates whether the plug-in loader should use the altered search path when loading the plug-in.
#define kPIAnnotMajorVersion   0x0002
#define kPIAnnotMinorVersion   0x0001
#define PIAnnotTextPopup   'txtA' /* text with popup annotation */
#define PIAnnotSound   'sndA' /* sound annotation */
#define PIAnnotTextContent   'txtC' /* text as content */
#define PIAnnotSoundFile   'sndF' /* content as a sound file */
#define PIAnnotSoundMem   'sndM' /* content as a sound in memory */
#define PIFilterFlate   'fltD' /* default parameters */
#define PIFilterLZW   'lzwD' /* default parameters */
#define PIFilterNone   'none' /* no compression */
#define PIFilterUndef   ' ' /* treated as 'none' */
#define PIMaxSize32Property   'ms32' /* <VPoint> Max rows and cols supported by this plug-in. */
#define PIMinSize32Property   'mn32' /* <VPoint> Min rows and cols supported by this plug-in. */
#define PIStackRendererProperty   'sRnd'
 Identifies the plug-in as a Stack Renderer.
#define PIEditInPluginProperty   'ediP'
 Indicates whether the plug-in edits files or stacks.
#define PIPluginLaunchesEditorProperty   'piLe'
 Indicates whether the plug-in launches an editor.
General Error Codes
#define errPlugInHostInsufficient   -30900
 Indicates that the plug-in requires services not provided by this host.
#define errPlugInPropertyUndefined   -30901
 Indicates that a requested property could not be found.
#define errHostDoesNotSupportColStep   -30902
 Indicates that an image processing operation does not support colBytes values other than 1.
#define errInvalidSamplePoint   -30903
 For the Color Services callback, during the operation plugIncolorServicesSamplePoint, indicates that the is not in the image window.
#define errReportString   -30904
 When a plug-in returns with result=errReportString, the host reports the errorString value from the plug-in's parameter block.
#define errHostVersionIncompatible   -30905
 Indicates that the plug-in is not compatible with this version of Photoshop.
Channel Port Error Codes
#define errUnknownPort   -30910
 Unknown Channel Port.
#define errUnsupportedRowBits   -30911
 Host does not support value provided in PixelMemoryDesc::rowBits.
#define errUnsupportedColBits   -30912
 Host does not support value provided in PixelMemoryDesc::colBits.
#define errUnsupportedBitOffset   -30913
 Host does not support value provided in PixelMemoryDesc::bitOffset.
#define errUnsupportedDepth   -30914
 Host does not support value provided in PixelMemoryDesc::depth.
#define errUnsupportedDepthConversion   -30915
 Host does not provide conversion for the depth provided in PixelMemoryDesc::depth.
Scripting System Error Code
#define errWrongPlatformFilePath   -30916
 Alias Handle is invalid.
#define errIllegalCharInID   -30917
 Non-alphanum in key, class, etc.
#define errMissingParameter   -1715
 A requierd parameter is missing, same as errAEParamMissed.
Image Modes
#define plugInModeBitmap   0
#define plugInModeGrayScale   1
#define plugInModeIndexedColor   2
#define plugInModeRGBColor   3
#define plugInModeCMYKColor   4
#define plugInModeHSLColor   5
#define plugInModeHSBColor   6
#define plugInModeMultichannel   7
#define plugInModeDuotone   8
#define plugInModeLabColor   9
#define plugInModeGray16   10
#define plugInModeRGB48   11
#define plugInModeLab48   12
#define plugInModeCMYK64   13
#define plugInModeDeepMultichannel   14
#define plugInModeDuotone16   15
#define plugInModeRGB96   16
#define plugInModeGray32   17
Blend Modes
#define PIBlendNormal   'norm'
#define PIBlendDarken   'dark'
#define PIBlendLighten   'lite'
#define PIBlendHue   'hue '
#define PIBlendSaturation   'sat '
#define PIBlendColor   'colr'
#define PIBlendLuminosity   'lum '
#define PIBlendMultiply   'mul '
#define PIBlendScreen   'scrn'
#define PIBlendDissolve   'diss'
#define PIBlendOverlay   'over'
#define PIBlendHardLight   'hLit'
#define PIBlendSoftLight   'sLit'
#define PIBlendDifference   'diff'
#define PIBlendExclusion   'smud'
#define PIBlendColorDodge   'div '
#define PIBlendColorBurn   'idiv'
#define PIBlendLinearDodge   'lddg'
#define PIBlendLinearBurn   'lbrn'
#define PIBlendLinearLight   'lLit'
#define PIBlendVividLight   'vLit'
#define PIBlendPinLight   'pLit'
#define PIBlendHardMix   'hMix'
Mask Description Constants

#define kSimplePSMask   0
#define kBlackMatPSMask   1
#define kGrayMatPSMask   2
#define kWhiteMatPSMask   3
#define kInvertPSMask   4
Overlay Algorithms

#define kStandardAlphaOverlay   0
 Alpha overlay algorithm.
#define kInvertedAlphaOverlay   1
 Inverted alpha overlay algorithm.
Color Management Options

#define kViewAsMask   0xF
 Low 4 bits are only used.
#define kViewAsStandardRGB   0
 View with the Photoshop default color handling.
#define kViewAsMacRGB   1
 View as if using AppleRGB.
#define kViewAsWindowsRGB   2
 View as if using sRGB.
#define kViewAsUncompensated   3
 Perform no compensation.
Color Service Selectors
#define plugIncolorServicesChooseColor   0
 Choose a color using the user's preferred color picker.
#define plugIncolorServicesConvertColor   1
 Convert color values fro one color space to another.
#define plugIncolorServicesSamplePoint   2
 Return the current sample point.
#define plugIncolorServicesGetSpecialColor   3
 Return either the foreground or background color.
Color Space Constants
#define plugIncolorServicesRGBSpace   0
 RGB color space.
#define plugIncolorServicesHSBSpace   1
 HSB color space.
#define plugIncolorServicesCMYKSpace   2
 CMYK color space.
#define plugIncolorServicesLabSpace   3
 Lab color space.
#define plugIncolorServicesGraySpace   4
 Gray color space.
#define plugIncolorServicesHSLSpace   5
 HSL color space.
#define plugIncolorServicesXYZSpace   6
 XYZ color space.
#define plugIncolorServicesChosenSpace   -1
 Leaves the color in the space the user chose, returning resultSpace as the user chosen space.
Channel Types

#define ctUnspecified   0
 Unspecified channel.
#define ctRed   1
 Red of RGB.
#define ctGreen   2
 Green of RGB.
#define ctBlue   3
 Blue of RGB.
#define ctCyan   4
 Cyan of CMYK.
#define ctMagenta   5
 Magenta of CMYK.
#define ctYellow   6
 Yellow of CMYK.
#define ctBlack   7
 Black of CMYK.
#define ctL   8
 L of LAB.
#define ctA   9
 A of LAB.
#define ctB   10
 B of LAB.
#define ctDuotone   11
 Duotone.
#define ctIndex   12
 Index.
#define ctBitmap   13
 Bitmap.
#define ctColorSelected   14
 Selected color.
#define ctColorProtected   15
 Protected color.
#define ctTransparency   16
 Transparent color.
#define ctLayerMask   17
 Layer mask (alpha channel).
#define ctInvertedLayerMask   18
 Inverted layer mask (inverted alpha channel).
#define ctSelectionMask   19
 Mask/alpha for selection.
#define ctSpotColor   20
 Spot Color.
#define ctVectorMask   21
#define ctSmartFilterMask   22
Document Types

#define dtImageDocument   0
 Standard image document.
#define dtImageScrap   1
 Scrap or clipboard document.
Filter Padding Constants

#define plugInWantsEdgeReplication   -1
#define plugInDoesNotWantPadding   -2
 Data should be left random.
#define plugInWantsErrorOnBoundsException   -3
 Error should be signaled for out-of-bounds request.
Sampling Flag Constants
#define hostDoesNotSupportSampling   0
 Host does not support sampling.
#define hostSupportsIntegralSampling   1
 Host supports integral sampling.
#define hostSupportsFractionalSampling   2
 Host supports non-integral sampling steps.
Layout Constants for filters and export modules

#define piLayoutTraditional   0
#define piLayoutRowsColumnsPlanes   1
#define piLayoutRowsPlanesColumns   2
#define piLayoutColumnsRowsPlanes   3
#define piLayoutColumnsPlanesRows   4
#define piLayoutPlanesRowsColumns   5
#define piLayoutPlanesColumnsRows   6
Interface Color Index for propInterfaceColor

#define kPIInterfaceButtonUpFill   1
#define kPIInterfaceBevelShadow   2
#define kPIInterfaceIconFillActive   3
#define kPIInterfaceIconFillDimmed   4
#define kPIInterfacePaletteFill   5
#define kPIInterfaceIconFrameDimmed   6
#define kPIInterfaceIconFrameActive   7
#define kPIInterfaceBevelHighlight   8
#define kPIInterfaceButtonDownFill   9
#define kPIInterfaceIconFillSelected   10
#define kPIInterfaceBorder   11
#define kPIInterfaceButtonDarkShadow   12
#define kPIInterfaceIconFrameSelected   13
#define kPIInterfaceRed   14
Automation Module Caller and Selector
#define kPSPhotoshopCaller   "PS Photoshop"
 Caller portion of message action sent to an Automation plug-in entry point.
#define kPSDoIt   "Do It"
 Selector portion of message action sent to an Automation plug-in entry point.

Typedefs

typedef PIPropertyList ** PIPropertyListHandle
 Even though PICA may define PIPropertyList, it does not define the handle form of it.
typedef struct TypeCreatorPair TypeCreatorPair
 Mac OS structure for file formats comprised of { 'type', 'crea' }.
typedef struct PlugInInfo PlugInInfo
 Information about the Plug-in.
typedef struct PSBuffer * BufferID
typedef struct PIBlendMode PIBlendMode
 Blend Mode Information.
typedef int16 PlaneMap [16]
 For transposing one plane location to another on pre- or post-processing.
typedef struct PlugInMonitor PlugInMonitor
 Monitor setup information.
typedef struct PSPixelMask PSPixelMask
 Pixel mask Information.
typedef struct PSPixelOverlay PSPixelOverlay
 Pixel Overlay Information.
typedef struct PSPixelMap PSPixelMap
 Describes a block of pixels for display purposes.
typedef struct PSPlatformContext PSPlatformContext
 Describes the platformContext used in DisplayPixeldProc.
typedef struct ColorServicesInfo ColorServicesInfo
 This data structure is used in the ColorServicesProc callback function.
typedef struct PSImagePlane PSImagePlane
 Describes the 8-bit plane of pixel data used by the image services callback functions.
typedef struct PSImageMultiPlane PSImageMultiPlane
 Describes multiple 8-bit planes of pixel data used by the image services callback functions.
typedef struct PSImageMultiPlane32 PSImageMultiPlane32
 Describes multiple planes of pixel data used by the image services callback functions.
typedef struct PixelMemoryDesc PixelMemoryDesc
 Describes an area of memory as pixels.
typedef struct PSScaling PSScaling
 Provide a scaling through a rectangle in source space and a corresponding rectangle in destination space.
typedef struct _PIChannelPortDesc * PIChannelPort
 Access to internal channels though abstract types.
typedef PIChannelPort ChannelReadPort
 Channel read port.
typedef PIChannelPort ChannelWritePort
 Channel write port.
typedef struct WriteChannelDesc WriteChannelDesc
 The channel to write a selection to.
typedef struct ReadChannelDesc ReadChannelDesc
 A channel to read from.
typedef struct ReadLayerDesc ReadLayerDesc
 A layer to read.
typedef struct
ReadImageDocumentDesc 
ReadImageDocumentDesc
 The document information, used by the Export, Filter, and Selection module parameter blocks.
typedef struct BufferProcs BufferProcs
 The set of routines available in the Buffer Procs.
typedef struct ResourceProcs ResourceProcs
 The set of routines available in the Resource suite.
typedef struct HandleProcs HandleProcs
typedef struct ImageServicesProcs ImageServicesProcs
 The set of routines available in the Image Services suite.
typedef struct PropertyProcs PropertyProcs
 The set of routines available in the Property Suite.
typedef struct ChannelPortProcs ChannelPortProcs
 The set of routines available for teh Channel Ports Suite.
typedef struct PSMatrixMathProcs PSMatrixMathProcs
 The set of routines available for the Matrix Math Suite.
typedef struct PIInterfaceColor PIInterfaceColor
 Interface color definition used with Property Suite property propInterfaceColor.
Non-Suite Callbacks
typedef MACPASCAL Boolean(* TestAbortProc )(void)
 Provides a mechanism to allow the user to abort the operation of the plug-in.
typedef MACPASCAL void(* ProgressProc )(int32 done, int32 total)
 Provides a mechanism for the plug-in to update progress indicators.
typedef MACPASCAL void(* HostProc )(int16 selector, intptr_t *data)
 Contains a pointer to a host-defined function.
typedef MACPASCAL int32(* SpaceProc )(void)
 Examines imageMode, imageSize, depth, and planes and determines the number of bytes required to hold the image.
typedef MACPASCAL void(* ProcessEventProc )(void *event)
 Allows Mac OS plug-in modules to pass standard EventRecord pointers to Photoshop.
typedef MACPASCAL OSErr(* DisplayPixelsProc )(const PSPixelMap *source, const VRect *srcRect, int32 dstRow, int32 dstCol, void *platformContext)
 Displays pixels in various image modes given a block of pixels to display.
typedef MACPASCAL OSErr(* AdvanceStateProc )(void)
 Allows the plug-in to ask the host to update, i.e., "advance the state of", the various data structures used for communicating between the host and the plug-in.
typedef MACPASCAL OSErr(* ColorServicesProc )(ColorServicesInfo *info)
 Provides a plug-in module with access to common color services within Photoshop.
Handle Suite Callbacks
typedef MACPASCAL Handle(* NewPIHandleProc )(int32 size)
 Allocates a handle of the indicated size.
typedef MACPASCAL void(* DisposePIHandleProc )(Handle h)
 Disposes of the indicated handle.
typedef MACPASCAL void(* DisposeRegularHandlePIHandleProc )(Handle h)
 Disposes of the indicated handle.
typedef MACPASCAL int32(* GetPIHandleSizeProc )(Handle h)
 Gets the size of the indicated handle.
typedef MACPASCAL OSErr(* SetPIHandleSizeProc )(Handle h, int32 newSize)
 Attempts to resize the indicated handle.
typedef MACPASCAL Ptr(* LockPIHandleProc )(Handle h, Boolean moveHigh)
 Locks and dereferences the handle.
typedef MACPASCAL void(* UnlockPIHandleProc )(Handle h)
 Unlocks the handle.
typedef MACPASCAL void(* RecoverSpaceProc )(int32 size)
 Recovers space from disposed handles not disposed of by invoking the DisposePIHandleProc callback.
Buffer Suite Callbacks

//end defgroup

typedef MACPASCAL OSErr(* AllocateBufferProc )(int32 size, BufferID *bufferID)
 Sets bufferID to be the ID for a buffer of the requested size.
typedef MACPASCAL OSErr(* AllocateBufferProc64 )(int64 size, BufferID *bufferID)
 Sets bufferID to be the ID for a buffer of the requested size.
typedef MACPASCAL Ptr(* LockBufferProc )(BufferID bufferID, Boolean moveHigh)
 Returns a pointer to the beginning of the buffer.
typedef MACPASCAL void(* UnlockBufferProc )(BufferID bufferID)
 Has no effect.
typedef MACPASCAL void(* FreeBufferProc )(BufferID bufferID)
 Releases the storage associated with a buffer.
typedef MACPASCAL int32(* BufferSpaceProc )(void)
 Returns the amount of space available for buffers.
typedef MACPASCAL int64(* BufferSpaceProc64 )(void)
 Returns the amount of space available for buffers.
typedef MACPASCAL OSErr(* ReserveSpaceProc )(int32 size)
 Attempts to insure that the requested amount of space is available as a single contiguous block in the address space.
Pseudo-Resource Suite Callbacks
typedef MACPASCAL int16(* CountPIResourcesProc )(ResType type)
 Counts the number of resources of a given type.
typedef MACPASCAL Handle(* GetPIResourceProc )(ResType type, int16 index)
 Gets the indicated resource for the current document.
typedef MACPASCAL void(* DeletePIResourceProc )(ResType type, int16 index)
 Deletes the indicated resource in the current document.
typedef MACPASCAL OSErr(* AddPIResourceProc )(ResType type, Handle data)
 Adds a resource of the given type at the end of the list for that type.
Property Suite Callbacks
typedef MACPASCAL OSErr(* GetPropertyProc )(PIType signature, PIType key, int32 index, intptr_t *simpleProperty, Handle *complexProperty)
 Gets information about the document currently being processed.
typedef MACPASCAL OSErr(* SetPropertyProc )(PIType signature, PIType key, int32 index, intptr_t simpleProperty, Handle complexProperty)
 Updates information in the plug-in host about the document currently being processed.
Image Services Suite Callbacks
typedef MACPASCAL OSErr(* PIResampleProc )(PSImagePlane *source, PSImagePlane *destination, Rect *area, Fixed *coords, int16 method)
 Provides 1D or 2D image interpolation, depending on the value passed in the coords parameter.
typedef MACPASCAL OSErr(* PIResampleMultiProc )(PSImageMultiPlane *source, PSImageMultiPlane *destination, Rect *area, Fixed *coords, int16 method)
typedef MACPASCAL OSErr(* PIResampleMulti32Proc )(PSImageMultiPlane32 *source, PSImageMultiPlane32 *destination, VRect *area, int64 *coords, int16 method)
Channel Ports Suite Callbacks
typedef MACPASCAL OSErr(* ReadPixelsProc )(ChannelReadPort port, const PSScaling *scaling, const VRect *writeRect, const PixelMemoryDesc *destination, VRect *wroteRect)
 Reads a rectangular area (tile) of pixels from a read port, and writes them to a destination buffer, based on a scaling and a description of the memory to write.
typedef MACPASCAL OSErr(* WriteBasePixelsProc )(ChannelWritePort port, const VRect *writeRect, const PixelMemoryDesc *source)
 Writes a rectangular area (tile) of pixels to a given port based on a memory description.
typedef MACPASCAL OSErr(* ReadPortForWritePortProc )(ChannelReadPort *readPort, ChannelWritePort writePort)
 Returns the read port corresponding to a write port.

Detailed Description

This file contains the public definitions and structures used by all plug-ins.

Distribution: PUBLIC

This file must be included to correctly compile resources on Windows; it is included by all the plug-in headers.


Define Documentation

#define kPhotoshopSignature   0x3842494d

The Photoshop signature, '8BIM'.

#define errPlugInHostInsufficient   -30900

Indicates that the plug-in requires services not provided by this host.

#define errPlugInPropertyUndefined   -30901

Indicates that a requested property could not be found.

#define errHostDoesNotSupportColStep   -30902

Indicates that an image processing operation does not support colBytes values other than 1.

Message is "The plug-in requires services not provided by this host."

#define errInvalidSamplePoint   -30903

For the Color Services callback, during the operation plugIncolorServicesSamplePoint, indicates that the is not in the image window.

#define errReportString   -30904

When a plug-in returns with result=errReportString, the host reports the errorString value from the plug-in's parameter block.

#define errHostVersionIncompatible   -30905

Indicates that the plug-in is not compatible with this version of Photoshop.

(Version 8.0+)

#define errUnknownPort   -30910

Unknown Channel Port.

#define errUnsupportedRowBits   -30911

Host does not support value provided in PixelMemoryDesc::rowBits.

#define errUnsupportedColBits   -30912

Host does not support value provided in PixelMemoryDesc::colBits.

#define errUnsupportedBitOffset   -30913

Host does not support value provided in PixelMemoryDesc::bitOffset.

#define errUnsupportedDepth   -30914

Host does not support value provided in PixelMemoryDesc::depth.

#define errUnsupportedDepthConversion   -30915

Host does not provide conversion for the depth provided in PixelMemoryDesc::depth.

#define errWrongPlatformFilePath   -30916

Alias Handle is invalid.

#define errIllegalCharInID   -30917

Non-alphanum in key, class, etc.

#define errMissingParameter   -1715

A requierd parameter is missing, same as errAEParamMissed.

#define PIVersionProperty   0x76657273L

Major and minor version number indicating which revision of the plug-in interface this plug-in was written for; key value is 'vers'.

This property key reflects the Version property in the PiPL resource file. The major version number indicates incompatible changes while the minor version number indicates incremental enhancements.

The data for the property has type int32. The major version number is encoded in the most significant 16 bits of the 32 bit version number, the minor version number is encoded in the least significant 16 bits.

There are separate version numbers for each kind of plug-in. The current version for a given kind of plug-in is defined by a preprocessor macro in the header file defining the interface for that plug-in type.

#define PIPriorityProperty   0x70727479L

Plug-in load order; key value is 'prty'.

This property key reflects the Priority property in the PiPL resource file. The data for the property has type int32. Also used to control the order in which items with the same name show up in menus. Lower numbers (including negative ones) load first. If NULL, the default is zero.

#define PIComponentProperty   0x636d7074L

Component and Version ids; key value is 'cmpt'.

This property key reflects the Component property in the PiPL resource file.

#define PIImageModesProperty   0x6d6f6465L

Image modes that the plug-in supports; key value is 'mode'.

This property key reflects the SupportedModes property in the PiPL resource file. The data for the property has type FlagSet; a variable length bitstring in which the first member is represented by the most significant bit of the first byte, the eighth member is in the least significant bit of the first byte, etc. The length of the set is in the property's length field.

Adobe Photoshop, has 18 modes, see Image Modes.

This property determines whether your plug-in will be active (black) or inactive (gray) in Photoshops menus based on the current documents image mode.

#define PIEnableInfoProperty   0x656e626cL

A string of modula-like expressions that, upon evaluation, must all be true for the plug-in to be enabled in the menu; key value is 'enbl'.

This property key reflects the EnableInfo property in the PiPL resource file. It is a superset of the SupportedModes PiPL property. (See PIImageModesProperty). One set of modes required in SupportedModes and a different set required in EnableInfo, produces unknown results. EnableInfo and SupportedModes should always match, in regards to mode requests.

See EnableInfo Property Grammar.

#define PIWantsScrapProperty   0x776E7363L

The plug-in wants the host to export image scrap; key value is 'wnsc'.

This property key reflects the WantsScrap property in the PiPL resource file.

#define PICocoaProperty   0x636F636FL

The plug-in wants the host to keep it loaded as unloading Cocoa plug-ins could result in objective-c messages going to no where This property key reflects the Cocoa property in the PiPL resource file.

#define PIFileBrowserAwareProperty   0x66626177L

The plug-in wants in the File Browser menu; key value is 'fbaw'.

This property key reflects the FileBrowserAware property in the PiPL resource file.

#define PINoAboutBoxProperty   0x6E61626FL

The plug-in does not want an about box menu entry; key value is 'nabo'.

This property key reflects the NoAboutBox property in the PiPL resource file.

#define PILegacyFilterGalleryMenuItemProperty   0x6C46476DL

The plug-in is a Filter Gallery plugin and its menu should be hidden by the preference.

key value is 'lFGm'. This property relfects the LegacyFilterGalleryMenuItem property in the PiPL resource file.

#define PIFilterLayerSupport   0x666c6c79L

Plug-in filter layer properties; key value is 'flly'.

This property key reflects the FilterLayerSupport property in the PiPL resource file. ]

#define PIRequiredHostProperty   0x686f7374L

Creator code of required host; key value is 'host'.

This property key reflects the RequiredHost property in the PiPL resource file. The data for the property has type PIType, with a value such as '8BIM' for Adobe Photoshop.

#define PICategoryProperty   0x63617467L

In the Filter menu, what sub-menu to list this plug-in; key value is 'catg'.

This property key reflects the Category property in the PiPL resource file. The data for the property has type PString; a Str255 except that storage may not be present for all 255 characters. The initial length byte is present in the property..

#define PIZCategoryProperty   0x7A636174L

In the Filter menu, what sub-menu to list this plug-in; key value is 'zcat'.

This property key reflects the ZStringCategory property in the PiPL resource file. The data for the property has type ZString; a Str255 except that storage may not be present for all 255 characters. The initial length byte is present in the property..

#define PINameProperty   0x6e616d65L

Plug-in menu name for module in PICategoryProperty sub-menu; key value is 'name'.

This property key reflects the Name property in the PiPL resource file. The data for the property has type PString; a Str255 except that storage may not be present for all 255 characters. The initial length byte is present in the property.

#define PIZNameProperty   0x7A6E616DL

Plug-in menu name for module in PICategoryProperty sub-menu; key value is 'znam'.

This property key reflects the ZStringName property in the PiPL resource file. The data for the property has type PString; a Str255 except that storage may not be present for all 255 characters. The initial length byte is present in the property.

#define PIProgressTextProperty   0x70726f67

Plug-in handles all progress bar updates.

**No-progress** Key value is 'prog'. This property key reflects the ProgressText property in the PiPL resource file. The data for the property has type PString; a Str255 except that storage may not be present for all 255 characters. The initial length byte is present in the property.

#define PIZProgressTextProperty   0x7A70726F

Plug-in handles all progress bar updates.

**No-progress** Key value is 'zpro'. This property key reflects the ZStringProgressText property in the PiPL resource file. The data for the property has type PString; a Str255 except that storage may not be present for all 255 characters. The initial length byte is present in the property.

#define PIPickerIDProperty   0x706e6d65L

A unique string (UUID or your own TM string) that differentiates one color picker from another; key value is 'pnme'.

This property key reflects the PickerID property in the PiPL resource file. The data for the property has type CString. All color pickers must have a unique ID so that they may be accessed correctly by the host. Menu entries are not sufficient to differentiate color pickers.

Note:
If a color picker does not have a unique ID, or two loaded color pickers have the same ID, then the first color picker in is always executed, despite what appears in the pop-up menu.
#define PILoadUnloadProperty   0x70694c55

Plug-in supports load/unload selectors; key is 'piLU'.

This property key reflects the LoadUnload property in the PiPL resource file.

#define PIPreferencesProperty   0x70695046

Plug-in supports preferences dialog selectors; key is 'piPF'.

This property key reflects the Preferences property in the PiPL resource file.

#define PIFeatureEnabledProperty   0x6665656e
#define PIPositionDependentProperty   0x706f7364
#define PIPerMonitorScalingAware   0x706d7361
#define kPIGeneralInfoSize   16
#define kPIHostBlendModeSignature   '8BIM'
#define PIBlendNormal   'norm'
#define PIBlendDarken   'dark'
#define PIBlendLighten   'lite'
#define PIBlendHue   'hue '
#define PIBlendSaturation   'sat '
#define PIBlendColor   'colr'
#define PIBlendLuminosity   'lum '
#define PIBlendMultiply   'mul '
#define PIBlendScreen   'scrn'
#define PIBlendDissolve   'diss'
#define PIBlendOverlay   'over'
#define PIBlendHardLight   'hLit'
#define PIBlendSoftLight   'sLit'
#define PIBlendDifference   'diff'
#define PIBlendExclusion   'smud'
#define PIBlendColorDodge   'div '
#define PIBlendColorBurn   'idiv'
#define PIBlendLinearDodge   'lddg'
#define PIBlendLinearBurn   'lbrn'
#define PIBlendLinearLight   'lLit'
#define PIBlendVividLight   'vLit'
#define PIBlendPinLight   'pLit'
#define PIBlendHardMix   'hMix'
#define kSimplePSMask   0
#define kBlackMatPSMask   1
#define kGrayMatPSMask   2
#define kWhiteMatPSMask   3
#define kInvertPSMask   4
#define kStandardAlphaOverlay   0

Alpha overlay algorithm.

#define kInvertedAlphaOverlay   1

Inverted alpha overlay algorithm.

#define kViewAsMask   0xF

Low 4 bits are only used.

#define kViewAsStandardRGB   0

View with the Photoshop default color handling.

#define kViewAsMacRGB   1

View as if using AppleRGB.

#define kViewAsWindowsRGB   2

View as if using sRGB.

#define kViewAsUncompensated   3

Perform no compensation.

Selects foreground color when ColorServices operation is plugIncolorServicesGetSpecialColor.

Selects background color when ColorServices operation is plugIncolorServicesGetSpecialColor.

#define PIFilteryLayersSupported   0
#define ctUnspecified   0

Unspecified channel.

#define ctRed   1

Red of RGB.

#define ctGreen   2

Green of RGB.

#define ctBlue   3

Blue of RGB.

#define ctCyan   4

Cyan of CMYK.

#define ctMagenta   5

Magenta of CMYK.

#define ctYellow   6

Yellow of CMYK.

#define ctBlack   7

Black of CMYK.

#define ctL   8

L of LAB.

#define ctA   9

A of LAB.

#define ctB   10

B of LAB.

#define ctDuotone   11

Duotone.

#define ctIndex   12

Index.

#define ctBitmap   13

Bitmap.

#define ctColorSelected   14

Selected color.

#define ctColorProtected   15

Protected color.

#define ctTransparency   16

Transparent color.

#define ctLayerMask   17

Layer mask (alpha channel).

White = transparent, Black = mask.

#define ctInvertedLayerMask   18

Inverted layer mask (inverted alpha channel).

#define ctSelectionMask   19

Mask/alpha for selection.

#define ctSpotColor   20

Spot Color.

#define ctVectorMask   21
#define ctSmartFilterMask   22
#define dtImageDocument   0

Standard image document.

#define dtImageScrap   1

Scrap or clipboard document.

Current version of the Buffer Procs.

#define kPIBufferSuite   "Photoshop Buffer Procs for Plug-ins"

Unique identifier for the buffer procs.

The version of the Buffer Procs.

#define kCurrentBufferProcsCount   ((sizeof(BufferProcs) - offsetof(BufferProcs, allocateProc)) / sizeof(void *))

Current number of routines in the Buffer Procs.

#define kPIResourceSuite   "Photoshop Resource Suite for Plug-ins"

Unique identifier for the Resource suite.

Version number for the Resource suite.

#define kDayStarColorMatchingResource   'DCSR'
#define kPhotoDeluxeResource   'PHUT'
#define kPIHandleSuite   "Photoshop Handle Suite for Plug-ins"

Unique identifier for the Handle suite.

The version of the Handle suite.

#define kPIImageServicesSuite   "Photoshop Image Services Suite for Plug-ins"

Unique identifier for the Image Services suite.

Version of the Image Services suite.

#define plugInWantsEdgeReplication   -1
#define plugInDoesNotWantPadding   -2

Data should be left random.

Error should be signaled for out-of-bounds request.

Host does not support sampling.

Host supports integral sampling.

Host supports non-integral sampling steps.

#define piLayoutTraditional   0
#define piLayoutRowsColumnsPlanes   1
#define piLayoutRowsPlanesColumns   2
#define piLayoutColumnsRowsPlanes   3
#define piLayoutColumnsPlanesRows   4
#define piLayoutPlanesRowsColumns   5
#define piLayoutPlanesColumnsRows   6
#define kPIInterfaceButtonUpFill   1
#define kPIInterfaceBevelShadow   2
#define kPIInterfacePaletteFill   5
#define kPIInterfaceBorder   11
#define kPIInterfaceRed   14
#define PIPersistentProperty   0x70727374L

Indicates whether the plug-in should always stay loaded; key value is 'prst'.

This property key reflects the Persistent property in the PiPL resource file. The data for the property has type

#define PIReentrantProperty   0x7265656EL

Indicates whether the plug-in can be reentrant; key value is 'reen'.

This property key reflects the Reentrant property in the PiPL resource file. The data for the property has type

#define PILoadWithAlteredSearchPath   0x61646C6CL

Indicates whether the plug-in loader should use the altered search path when loading the plug-in.

This property key reflects the LoadWithAlteredSearchPath property in the PiPL resource file. The data for the property has type bool

#define kPIAnnotMajorVersion   0x0002
#define kPIAnnotMinorVersion   0x0001
#define PIAnnotTextPopup   'txtA' /* text with popup annotation */
#define PIAnnotSound   'sndA' /* sound annotation */
#define PIAnnotTextContent   'txtC' /* text as content */
#define PIAnnotSoundFile   'sndF' /* content as a sound file */
#define PIAnnotSoundMem   'sndM' /* content as a sound in memory */
#define PIFilterFlate   'fltD' /* default parameters */
#define PIFilterLZW   'lzwD' /* default parameters */
#define PIFilterNone   'none' /* no compression */
#define PIFilterUndef   ' ' /* treated as 'none' */
#define PIMaxSize32Property   'ms32' /* <VPoint> Max rows and cols supported by this plug-in. */
#define PIMinSize32Property   'mn32' /* <VPoint> Min rows and cols supported by this plug-in. */

Typedef Documentation

typedef PIPropertyList** PIPropertyListHandle

Even though PICA may define PIPropertyList, it does not define the handle form of it.

Mac OS structure for file formats comprised of { 'type', 'crea' }.

typedef struct PlugInInfo PlugInInfo

Information about the Plug-in.

typedef struct PSBuffer* BufferID
typedef struct PIBlendMode PIBlendMode

Blend Mode Information.

typedef int16 PlaneMap[16]

For transposing one plane location to another on pre- or post-processing.

typedef struct PlugInMonitor PlugInMonitor

Monitor setup information.

A number of the plug-in module types get passed monitor descriptions through the this structure. These descriptions detail the information recorded in the Photoshop "Monitor Setup" dialog.

typedef struct PSPixelMask PSPixelMask

Pixel mask Information.

Note that the depth of the mask data must match the depth of the color data in the PSPixelMap

Pixel Overlay Information.

Note that the depth of the overlay data must match the depth of the color data in the PSPixelMap

typedef struct PSPixelMap PSPixelMap

Describes a block of pixels for display purposes.

Used in DisplayPixelsProc. Version 1 10/14/1997 Version 2 03/22/1999 Version 3 05/2012

Describes the platformContext used in DisplayPixeldProc.

Used in DisplayPixelsProc. Version 1 02/26/2009 - new for Photoshop CS5 On Mac Cocoa systems, platFormContext parameter is a pointer to the following structure On 32bit Mac Cocoa platrorm, if platForm context is not NULL, Photoshop will cast platformContext to *PSPlatformContext. On 64 bit Mac systems, platformContext cannot be NULL, since QuickDraw is not supported on 64bit Mac systems. On 32 bit Mac systems (Photoshop CS5 and above), if platformContext is NULL, Photoshop will draw to the global QuickDraw port (as in earlier versions). On Carbon systems (photoshop CS4 and earlier), platFormContext parameter is ignored On Windows systems, platFormContext is an HDC. Photoshop will figure out the global rectangle through WindowFromDC ( ) and GetWindowRect ( ) on that HWND. If a memory DC is passed in platformContext, since Photoshop cannot determine the screen bounds through HDC, primary monitor's color profile will be used for color management.

This data structure is used in the ColorServicesProc callback function.

typedef struct PSImagePlane PSImagePlane

Describes the 8-bit plane of pixel data used by the image services callback functions.

You can calculate the address of a pixel by using the following algorithm:

    unsigned8 * GetPixelAddress(PSImagePlane * plane, Point pt)
    {
        // should do some bounds checking here!
        return (unsigned8 *)    (((int32) plane->data +
            (pt.v - plane->bounds.top ) * plane->rowBytes +
            (pt.h - plane->bounds.left) * plane->colBytes);
    }

Describes multiple 8-bit planes of pixel data used by the image services callback functions.

Using a Rect to define the bounds.

Describes multiple planes of pixel data used by the image services callback functions.

Using a VRect to define the bounds.

typedef struct BufferProcs BufferProcs

The set of routines available in the Buffer Procs.

Interface color definition used with Property Suite property propInterfaceColor.