/* File: FilterInterface.h Copyright 1990-91 by Thomas Knoll. This file describes version 4.0 of Photoshop's Filter module interface. */ /* Operation selectors */ #define filterSelectorAbout 0 #define filterSelectorParameters 1 #define filterSelectorPrepare 2 #define filterSelectorStart 3 #define filterSelectorContinue 4 #define filterSelectorFinish 5 /* Image modes */ #define filterModeGrayScale 1 #define filterModeRGBColor 3 #define filterModeCMYKColor 4 #define filterModeHSLColor 5 #define filterModeHSBColor 6 #define filterModeMultichannel 7 /* Error return values. The plug-in module may also return standard Macintosh operating system error codes, or report its own errors, in which case it can return any positive integer. */ #define filterBadParameters -30100 /* "a problem with the filter module interface" */ #define filterBadMode -30101 /* "the filter module does not support images" */ typedef unsigned char FilterColor [4]; typedef struct FilterMonitor { Fixed gamma; /* Gamma value */ Fixed redX; /* Red phosphor */ Fixed redY; Fixed greenX; /* Green phosphor */ Fixed greenY; Fixed blueX; /* Blue phosphor */ Fixed blueY; Fixed whiteX; /* White point */ Fixed whiteY; Fixed ambient; /* 0.0 = Low, 0.5 = Medium, 1.0 = High */ } FilterMonitor; typedef struct FilterRecord { long serialNumber; /* Host's serial number, to allow copy protected plug-in modules. */ ProcPtr abortProc; /* The plug-in module may call this no-argument BOOLEAN function (using Pascal calling conventions) several times a second during long operations to allow the user to abort the operation. If it returns TRUE, the operation should be aborted (and a positive error code returned). */ ProcPtr progressProc; /* The plug-in module may call this two-argument procedure (using Pascal calling conventions) periodically to update a progress indicator. The first parameter (type LONGINT) is the number of operations completed; the second (type LONGINT) is the total number of operations. */ Handle parameters; /* A handle, initialized to NIL by Photoshop. This should be used to hold the filter's current parameters. */ Point imageSize; /* Size of image */ short planes; /* Samples per pixel */ Rect filterRect; /* Rectangle to filter */ RGBColor background; /* Current background color */ RGBColor foreground; /* Current foreground color */ long maxSpace; /* Maximum possible total of data and buffer space */ long bufferSpace; /* If the plug-in filter needs to allocate large internal buffers, the filterSelectorPrepare routine should set this field to the number of bytes the filterSelectorStart routine is planning to allocate. Relocatable blocks should be used if possible. */ Rect inRect; /* Requested input rectangle. Must be a subset of the image's bounding rectangle. */ short inLoPlane; /* First requested input plane */ short inHiPlane; /* Last requested input plane */ Rect outRect; /* Requested output rectangle. Must be a subset of filterRect. */ short outLoPlane; /* First requested output plane */ short outHiPlane; /* Last requested output plane */ Ptr inData; /* Pointer to input rectangle. If more than one plane was requested, the data is interleaved. */ long inRowBytes; /* Offset between input rows */ Ptr outData; /* Pointer to output rectangle. If more than one plane was requested, the data is interleaved. */ long outRowBytes; /* Offset between output rows */ Boolean isFloating; /* Set to true if the selection is floating */ Boolean haveMask; /* Set to true if there is a selection mask */ Boolean autoMask; /* If there is a mask, and the selection is not floating, the plug-in can change this field to false to turn off auto-masking. */ Rect maskRect; /* Requested mask rectangle. Must be a subset of filterRect. Should only be used if haveMask is true. */ Ptr maskData; /* Pointer to (read only) mask data. */ long maskRowBytes; /* Offset between mask rows */ FilterColor backColor; /* Background color in native color space */ FilterColor foreColor; /* Foreground color in native color space */ OSType hostSig; /* Creator code for host application */ ProcPtr hostProc; /* Host specific callback procedure */ short imageMode; /* Image mode */ Fixed imageHRes; /* Pixels per inch */ Fixed imageVRes; /* Pixels per inch */ Point floatCoord; /* Top left coordinate of selection */ Point wholeSize; /* Size of image selection is floating over */ FilterMonitor monitor; /* Information on current monitor */ char reserved [256]; /* Set to zero */ } FilterRecord, *FilterRecordPtr;