Export Module

Export plug-in modules are used to output an image from an open Photoshop document. More...

Data Structures

struct  ExportRecord
 This structure is passed to the Export plug-in module main() through the pluginParamBlock. More...

Typedefs

typedef struct ExportRecord ExportRecord
 This structure is passed to the Export plug-in module main() through the pluginParamBlock.
typedef struct ExportRecordExportRecordPtr

Export Module Selectors

#define exportSelectorAbout   0
 Allows the plug-in to display an about box for the Export Module.
#define exportSelectorStart   1
 Allows the plug-in to open a dialog box and set up the initial image rectangle to process.
#define exportSelectorContinue   2
 Allows the plug-in module to process the image data pointed to by data, and then indicate what area of the image it will process next.
#define exportSelectorFinish   3
 Allows the plug-in module to clean up after an image export.
#define exportSelectorPrepare   4
 Allows the plug-in module to adjust the Photoshop memory allocation algorithm.

Export Module Error Codes

#define exportBadParameters   -30200
 Indicates a problem with the export module interface.
#define exportBadMode   -30201
 Indicates that the export module does not support <mode> images.

Detailed Description

Export plug-in modules are used to output an image from an open Photoshop document.

Export modules can be used to print to printers that do not have Mac OS Chooser-level driver support.

They can also be used to save images in unsupported or compressed file formats, although File Format modules often are better suited for this purpose. File Format modules are accessed directly from the Save and Save As commands, whereas Export modules use the Export sub-menu.

The file type for export modules for Mac OS is 8BEM, the extension for Windows is .8BE.

Please also see Writing Export Plug-ins.


Define Documentation

#define exportSelectorAbout   0

Allows the plug-in to display an about box for the Export Module.

For this selector, the host does not pass the standard parameter block into the plug-in main routine. Instead it passes an AboutRecord.

See About Boxes for more information.

#define exportBadParameters   -30200

Indicates a problem with the export module interface.

#define exportSelectorStart   1

Allows the plug-in to open a dialog box and set up the initial image rectangle to process.

During this call, the plug-in module should set theRect or ExportRecord::theRect32, loPlane and hiPlane to let Photoshop know what area of the image it wishes to process. The total number of bytes requested should be less than maxData. If the image is larger than maxData, the plug-in must process the image in pieces. There are no restrictions on how the pieces tile the image: horizontal strips, vertical strips, or a grid of tiles.

The plug-in can call AdvanceStateProc during exportSelectorStart. See Advance State and Export Modules for more information.

#define exportSelectorContinue   2

Allows the plug-in module to process the image data pointed to by data, and then indicate what area of the image it will process next.

To indicate the next area of the image to process, adjust ExportRecord::theRect or ExportRecord::theRect32, loPlane and hiPlane. If the entire image has been processed, set ExportRecord::theRect or ExportRecord::theRect32 to an empty rectangle.

The requested image data is pointed to by data. If more than one plane has been requested (see loPlane and hiPlane), the data is interleaved. The offset from one row to the next is indicated by rowBytes. This is not necessarily equal to the width of theRect or ExportRecord::theRect32; there may be additional pad bytes at the end of each row.

The plug-in can call AdvanceStateProc during exportSelectorContinue. See Advance State and Export Modules for more information.

Note:
Be careful processing user-cancel events during exportSelectorContinue. Normally your plug-in would be expecting another exportSelectorContinue call. If the user cancels, the next call is exportSelectorFinish, not exportSelectorContinue!
#define exportSelectorFinish   3

Allows the plug-in module to clean up after an image export.

This call is made if and only if the exportSelectorStart routine returns without error, even if the exportSelectorContinue routine returns an error. If exportSelectorStart succeeds, Photoshop guarantees that exportSelectorFinish is called.

If Photoshop detects Command-period in the Mac OS or Escape in Windows between calls to the exportSelectorContinue routine, it calls the exportSelectorFinish routine.

See Export Modules and Scripting for information about scripting at the exportSelectorFinish selector.

Note:
Photoshop may call exportSelectorFinish instead of exportSelectorContinue if it detects a need to terminate while building the requested buffer.

#define exportSelectorPrepare   4

Allows the plug-in module to adjust the Photoshop memory allocation algorithm.

Photoshop sets maxData to the maximum number of bytes it can allocate to your plug-in. You may want to reduce maxData for increased efficiency. See Memory Management Strategies for more information.

#define exportBadMode   -30201

Indicates that the export module does not support <mode> images.


Typedef Documentation

typedef struct ExportRecord ExportRecord

This structure is passed to the Export plug-in module main() through the pluginParamBlock.

See Plug-in Entry Point for an explanation of how the host calls a plug-in.

typedef struct ExportRecord * ExportRecordPtr