PIFormat.h File Reference

This file describes version 1 of Photoshop's plug-in image format interface. More...

#include "PIActions.h"
#include "PIGeneral.h"
#include "SPBasic.h"
#include "SPFiles.h"

Go to the source code of this file.


Data Structures

struct  FormatInfo
 Information about this Format Plug-in. More...
struct  FormatRecord
 This structure is passed to the plug-in module through the parameter block. More...

Format Module Selectors

#define formatSelectorAbout   0
 Allows the plug-in to display an about box for the Format Module.
#define formatSelectorReadPrepare   1
 Allows a plug-in module to adjust the Photoshop memory allocation algorithm.
#define formatSelectorReadStart   2
 Allows the plug-in module to begin its interaction with the host.
#define formatSelectorReadContinue   3
 Processes a sequence of areas within the image.
#define formatSelectorReadFinish   4
 Allows the plug-in to cleanup from the read operation just performed.
#define formatSelectorOptionsPrepare   5
 Allows a plug-in module to adjust the Photoshop memory allocation algorithm.
#define formatSelectorOptionsStart   6
 Allows a plug-in to determine whether the current document can be saved in the required file format, and if necessary, get any file options from the user.
#define formatSelectorOptionsContinue   7
 Allows a plug-in to request parts of the image, from which it determines whether it can store the file.
#define formatSelectorOptionsFinish   8
 Allows the plug-in to perform any necessary clean up.
#define formatSelectorEstimatePrepare   9
 Allows a plug-in module to adjust the Photoshop memory allocation algorithm.
#define formatSelectorEstimateStart   10
 Allows a plug-in to calculate the disk space needed to save the file.
#define formatSelectorEstimateContinue   11
 Allows a plug-in to request parts of the image from which it can compute the minimum and maximum bytes to store the file.
#define formatSelectorEstimateFinish   12
 Allows the plug-in to perform any necessary clean up.
#define formatSelectorWritePrepare   13
 Allows a plug-in module to adjust the Photoshop memory allocation algorithm.
#define formatSelectorWriteStart   14
 Allows a plug-in module to begin writing the file.
#define formatSelectorWriteContinue   15
 Provides the plug-in module some or all of the image data; the plug-in module should write this data to file.
#define formatSelectorWriteFinish   16
 Allows the plug-in to cleanup from the write operation just performed.
#define formatSelectorFilterFile   17
 Determines whether a plug-in can process a given file type.
#define formatSelectorGetFilePropertyValue   18
 Gets a file property value from the format plug-in.
#define formatSelectorLosslessRotate   19
 Requests the format plug-in to rotate a file losslessly.
#define formatSelectorBulkSettings   20
 Sets parameters for multiple files.
#define formatSelectorXMPRead   21
 Reads the XMP data from your file.
#define formatSelectorXMPWrite   22
 Writes the XMP data to your file.
#define formatSelectorBulkOpen   23
#define formatSelectorLoad   24
#define formatSelectorUnload   25
#define formatSelectorPreferences   26
#define formatSelectorSettingsCopy   27
#define formatSelectorSettingsPaste   28
#define formatSelectorSettingsClear   29
#define formatSelectorSettingsDefault   30
#define formatSelectorSettingsPrevious   31
#define formatSelectorSettingsPresetList   32
#define formatSelectorSettingsChecksum   33
#define formatSelectorXMPAppend   34
#define formatSelectorReadLayerStart   35
#define formatSelectorReadLayerContinue   36
#define formatSelectorReadLayerFinish   37
#define formatSelectorWriteLayerStart   38
#define formatSelectorWriteLayerContinue   39
#define formatSelectorWriteLayerFinish   40

PiPL Format Keys

#define PIFmtFileTypeProperty   0x666d5443
 Default type and creator code used for files newly created with this format plug-in; key value is 'fmTC'.
#define PIReadTypesProperty   0x52645479
 List of type and creator pairs that the format plug-in can read; key value is 'RdTy'.
#define PIFilteredTypesProperty   0x66667454
 List of type and creator pairs for which the file format plug-in should be called to determine if the file can be read; key value is 'fftT'.
#define PIReadExtProperty   0x52644578
 List of extensions which the format plug-in can read; key value is 'RdEx'.
#define PIFilteredExtProperty   0x66667445
 List of extensions for which the file format plug-in should be called to determine if the file can be read; key value is 'fftE'.
#define PIFmtFlagsProperty   0x666d7466
 A set of flags which control the operation of file format plug-ins; key value is 'fmtf'.
#define PIFmtHiddenFlagsProperty   0x666D6869
 Hidden read/write flags; key value is 'fmhi'.
#define PIFmtICCFlagsProperty   0x666D6970
 ICC profile flags; key value is 'fmip'.
#define PIFmtICCRequiredFlagsProperty   0x666D6972
 ICC required profile flags; key value is 'fmir'.
#define PIFmtMaxSizeProperty   0x6d78737a
 The maximum number of rows and columns that can be in an image saved in this format; key value is 'mxsz'.
#define PIFmtMaxChannelsProperty   0x6d786368
 An array of counts of the maximum number of channels which can/will be saved for a given image mode; key value is 'mxch'.
#define PIFmtFilePropertiesProperty   0x66667073
 Supports formatSelectorGetFilePropertyValue selector; key value is 'ffps'.
#define PIFmtLosslessRotateProperty   0x666C6C72
 Supports formatSelectorLosslessRotate selector; key value is 'fllr'.
#define PIFmtBulkSettingsProperty   0x66666273
 Supports formatSelectorBulkSettings selector; key value is 'ffbs'.
#define PIFmtPrimaryMetadataProperty   0x6666706d
 File format is primary metadata source; key value is 'ffpm'.
#define PIFmtPrimaryThumbnailProperty   0x66667074
 File format is primary thumbnail source; key value is 'ffpt'.
#define PIFmtXMPReadProperty   0x786D7072
 Supports formatSelectorXMPRead selector; key value is 'xmpr'.
#define PIFmtXMPWriteProperty   0x786D7077
 Supports formatSelectorXMPWrite selector; key value is 'xmpw'.
#define PIFmtQuickThumbExtractProperty   0x7174686D
 Supports extractQuickThumbnail field; key value is 'qthm'.
#define PIFmtBulkOpenProperty   'ffbo'
 Supports formatSelectorBulkOpen selector; key value is 'ffbo'.
#define PIFmtRawSettingsProperty   'rscp'
 Supports settings copy/paste/etc selector; key value is 'rscp'.
#define PIFmtOpenWriteAccessProperty   'fowa'
 Plug-in prefers write access when opening; key value is 'fowa'.
#define PIFmtWarnIfOverriddenProperty   'fwio'
 Warning if this plug-in is override by another; key value is 'fwio'.
#define PIFmtResourceThreadSafeProperty   'frts'
 Plug-in is resource fork thread safe; key value is 'frts'.
#define PIFmtSupportsLayersProperty   'fmsl'
#define PIFmtSupportsLayersReadOnlyProperty   'slRO'
#define PIFmtSupportsBackgroundSaveProperty   'fbgs'
 Plug-in can save a file out on a separate background thread.

Format Hidden Flags for PIFmtHiddenFlagsProperty

#define PIFmtShowReadFlag   0
#define PIFmtShowWriteFlag   1

Format Flags for PIFmtFlagsProperty

#define PIFmtReadsAllTypesFlag   0
 DEPRECATED.
#define PIFmtSavesImageResourcesFlag   1
 Controls whether Photoshop adds the image resources to the file’s Mac OS resource fork.
#define PIFmtCanReadFlag   2
 Indicates that the plug-in can read files, when the flag is TRUE.
#define PIFmtCanWriteFlag   3
 Indicates that the plug-in can write files, when the flag is TRUE.
#define PIFmtCanWriteIfReadFlag   4
 Indicates that plug-in can write the file if the plug-in originally read the file, when the flag is TRUE.
#define PIFmtCanWriteTransparency   5
 Indicates that the plug-in supports saving the transparency index of indexed color image or saving transparency as a first alpha channel for other color modes, when the flag is TRUE.
#define PIFmtCanCreateThumbnail   6
 Indicates that the plug-in can create a Thumbnail, when the flag is TRUE.
#define PIFmtCanWriteSpotChannel   7
 Indicates that the plug-in can save spot channels when the flag is TRUE.

Format Flags ICC Profile Flags for PIFmtICCFlagsProperty

#define PIFmtICCEmbedGrayFlag   0
 Can embed profiles in gray scale images, when bit is set.
#define PIFmtICCEmbedIndexedFlag   1
 Can embed profiles in indexed color images, when bit is set.
#define PIFmtICCEmbedRGBFlag   2
 Can embed profiles in RGB images, when bit is set.
#define PIFmtICCEmbedCMYKFlag   3
 Can embed profiles in CMYK images, when bit is set.

Required Format ICC Profile Flags for PIFmtICCRequiredFlagsProperty

#define PIFmtICCRequireGrayFlag   0
 Requires embedding profiles in gray scale images, when bit is set.
#define PIFmtICCRequireIndexedFlag   1
 Requires embedding profiles in indexed color images, when bit is set.
#define PIFmtICCRequireRGBFlag   2
 Requires embedding profiles in RGB images, when bit is set.
#define PIFmtICCRequireCMYKFlag   3
 Requires embedding profiles in CMYK images, when bit is set.

Bit masks for the browserRotation field

#define PIFmtBrowserRotationFlipFlag   2
 Flip horizontal.
#define PIFmtBrowserRotationDisableFlag   3
 The FormatRecord::browserRotation field is disabled.
#define PIFmtBrowserRotationEnableFlag   4
 The FormatRecord::browserRotation field is enabled, and is read-write.

Bit masks for bulkMask and bulkFlags fields

#define PIFmtBulkOpenMask   1
#define PIFmtBulkInvalPreviewMask   2
#define PIFmtBulkInvalMetaMask   4
#define PIFmtBulkDeleteMask   8

Format Error Return Values

#define formatBadParameters   -30500
 An error with the interface.
#define formatCannotRead   -30501
 No scanner installed.
#define formatSkipFile   -30502
 The host should skip processing this file.
#define formatPasswordProtected   -30503
 For PDF files.
#define formatUnsupportedRaw   -30504
 The file appears to be a raw file from a camera model which is not supported by the installed version of Camera Raw.
#define formatUnsupportedDNG   -30505
 The DNG file is not supported by the installed version of Camera Raw.

Defines

#define formatSelectorLaunchExternalEditor   41
#define PIFmtPRotate   0x66726F74
 Indicates how the file can be rotated in this format; key value is 'fro'.
#define PIFmtPVNotSupported   0
 The requested property is not supported by this format plug-in.
#define PIFmtPVRotateNo   2
 This file should not be rotated.
#define PIFmtPVRotateIsLossy   3
 This file can be rotated, but it will be loss.
#define PIFmtPVRotateIsLossless   4
 This file can be rotated and it will be losses.
#define PIFmtPVRotateIsLosslessWithCallback   5
 This file can be only be rotated losses by using the callback, otherwise it will be loss.

Typedefs

typedef FormatRecordFormatRecordPtr
 This structure is passed to the plug-in module through the parameter block.

Detailed Description

This file describes version 1 of Photoshop's plug-in image format interface.

Distribution: PUBLIC


Define Documentation

#define formatSelectorLaunchExternalEditor   41

#define PIFmtPRotate   0x66726F74

Indicates how the file can be rotated in this format; key value is 'fro'.

The FormatRecord::browserRotation field needs to be filled out.

#define PIFmtPVNotSupported   0

The requested property is not supported by this format plug-in.

#define PIFmtPVRotateNo   2

This file should not be rotated.

#define PIFmtPVRotateIsLossy   3

This file can be rotated, but it will be loss.

#define PIFmtPVRotateIsLossless   4

This file can be rotated and it will be losses.

#define PIFmtPVRotateIsLosslessWithCallback   5

This file can be only be rotated losses by using the callback, otherwise it will be loss.