home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / 第1特集Plug-in / Photoshop / Plug-in_Kit_2.5.1.sit / Plug-in_Kit_2.5.1 / Code / PIAcquire.h < prev    next >
Text File  |  1994-03-22  |  6KB  |  151 lines

  1. /*
  2.     File: PIAcquire.h
  3.  
  4.     Copyright 1990-91 by Thomas Knoll.    Copyright 1992 by Adobe Systems, Inc.
  5.     All rights reserved.
  6.  
  7.     This file describes version 4.0 of Photoshop's Acquisition module interface.
  8. */
  9.  
  10. #ifndef __PIAcquire__
  11. #define __PIAcquire__
  12.  
  13. #include "PIGeneral.h"
  14.  
  15. /* Operation selectors */
  16.  
  17. #define acquireSelectorAbout    0
  18. #define acquireSelectorStart    1
  19. #define acquireSelectorContinue 2
  20. #define acquireSelectorFinish    3
  21. #define acquireSelectorPrepare    4
  22.  
  23. /*    Error return values. The plug-in module may also return standard Macintosh
  24.     operating system error codes, or report its own errors, in which case it
  25.     can return any positive integer. */
  26.  
  27. #define acquireBadParameters    -30000    /* "a problem with the acquisition module interface" */
  28. #define acquireNoScanner        -30001    /* "there is no scanner installed" */
  29. #define acquireScannerProblem    -30002    /* "a problem with the scanner" */
  30.  
  31. #pragma options align=mac68k
  32.  
  33. typedef struct AcquireRecord
  34.     {
  35.  
  36.     int32                serialNumber;    /* Host's serial number, to allow
  37.                                            copy protected plug-in modules. */
  38.  
  39.     TestAbortProc        abortProc;        /* The plug-in module may call this no-argument
  40.                                            Boolean valued function (using Pascal calling
  41.                                            conventions) several times a second during long
  42.                                            operations to allow the user to abort the operation.
  43.                                            If it returns TRUE, the operation should be aborted
  44.                                            (and a positive error code returned). */
  45.  
  46.     ProgressProc        progressProc;    /* The plug-in module may call this two-argument
  47.                                            procedure (using Pascal calling conventions)
  48.                                            periodically to update a progress indicator.
  49.                                            The first parameter  of operations completed;
  50.                                            the second is the total number of operations. */
  51.  
  52.     int32                maxData;        /* Maximum number of bytes that should be
  53.                                            passed back at once, plus the size of any
  54.                                            interal buffers. The plug-in may reduce this
  55.                                            value in the acquireSelectorPrepare routine. */
  56.  
  57.     int16                imageMode;        /* Image mode */
  58.     Point                imageSize;        /* Size of image */
  59.     int16                depth;            /* Bits per sample, currently must be 1 or 8 */
  60.     int16                planes;         /* Samples per pixel */
  61.  
  62.     Fixed                imageHRes;        /* Pixels per inch */
  63.     Fixed                imageVRes;        /* Pixels per inch */
  64.  
  65.     LookUpTable            redLUT;         /* Red LUT, only used for Indexed Color images */
  66.     LookUpTable            greenLUT;        /* Green LUT, only used for Indexed Color images */
  67.     LookUpTable            blueLUT;        /* Blue LUT, only used for Indexed Color images */
  68.  
  69.     void *                data;            /* A pointer to the returned image data. The
  70.                                            plug-in module is now responsible for freeing
  71.                                            this buffer (this is a change from previous
  72.                                            versions). Should be set to NIL when
  73.                                            all the image data has been returned. */
  74.  
  75.     Rect                theRect;        /* Rectangle being returned */
  76.     int16                loPlane;        /* First plane being returned */
  77.     int16                hiPlane;        /* Last plane being returned */
  78.     int16                colBytes;        /* Spacing between columns */
  79.     int32                rowBytes;        /* Spacing between rows */
  80.     int32                planeBytes;     /* Spacing between planes (ignored if only one
  81.                                            plane is returned at a time) */
  82.  
  83.     Str255                 filename;        /* Document file name */
  84.     int16                vRefNum;        /* Volume reference number, or zero if none */
  85.     Boolean             dirty;            /* Changes since last saved flag. The plug-in may clear
  86.                                            this field to prevent prompting the user when
  87.                                            closing the document. */
  88.  
  89.     OSType                hostSig;        /* Creator code for host application */
  90.     HostProc            hostProc;        /* Host specific callback procedure */
  91.  
  92.     int32                hostModes;        /* Used by the host to inform the plug-in which
  93.                                            imageMode values it supports.  If the corresponding
  94.                                            bit (LSB = bit 0) is 1, the mode is supported. */
  95.  
  96.     PlaneMap            planeMap;        /* Maps plug-in plane numbers to host plane
  97.                                            numbers.  The host initializes this is a linear
  98.                                            mapping.  The plug-in may change this mapping if
  99.                                            it sees the data in a different order. */
  100.  
  101.     Boolean             canTranspose;    /* Is the host able to transpose the image? */
  102.     Boolean             needTranspose;    /* Does the plug-in need the image transposed? */
  103.  
  104.     Handle                duotoneInfo;    /* Handle to duotone information, if returning a
  105.                                               duotone mode image.    The plug-in is responsible
  106.                                             for freeing this buffer. */
  107.  
  108.     int32                diskSpace;        /* Free disk space on the host's scratch disk or
  109.                                            disks.  Set to a negative number if host does
  110.                                            not use a scratch disk. */
  111.  
  112.     SpaceProc            spaceProc;        /* If not NIL, a pointer to a no-argument
  113.                                            int32 values function (using Pascal calling
  114.                                            conventions) which uses the current settings of
  115.                                            the imageMode, imageSize, depth, and planes
  116.                                            fields to compute the amount of scratch disk
  117.                                            space required to hold the image.  Returns -1
  118.                                            if the settings are not valid. */
  119.  
  120.     PlugInMonitor        monitor;        /* Information on current monitor */
  121.  
  122.     void *                platformData;    /* Platform specific information. */
  123.  
  124.     BufferProcs            *bufferProcs;    /* The buffer procedures.          */
  125.     
  126.     ResourceProcs        *resourceProcs;    /* The plug-in resource procedures. */
  127.     
  128.     ProcessEventProc    processEvent;    /* Pass events to the application. */
  129.  
  130.     Boolean             canReadBack;    /* Can we return data for filtering? */
  131.  
  132.     Boolean             wantReadBack;    /* Does the plug-in want to read the data back? */
  133.  
  134.     Boolean             acquireAgain;    /* If true at finish, call the plug-in again.
  135.                                            Not all hosts may pay attention to this flag. */
  136.  
  137.     Boolean             reservedFlag;    /* Padding set to zero. */
  138.     
  139.     DisplayPixelsProc    displayPixels;    /* Display dithered pixels. */
  140.     
  141.     HandleProcs            *handleProcs;    /* Platform independent handle manipulation. */
  142.  
  143.     char                reserved [228]; /* Set to zero */
  144.  
  145.     }
  146. AcquireRecord, *AcquireRecordPtr;
  147.  
  148. #pragma options align=reset
  149.  
  150. #endif
  151.