home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / misc / imagefx_sdk / include / scan / drawinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-18  |  8.6 KB  |  198 lines

  1. /*
  2.  * ImageFX Development Header File
  3.  * Copyright © 1991-1995 Nova Design, Inc.
  4.  * Written by Thomas Krehbiel
  5.  *
  6.  * XDrawModes and XDrawStyles (2.0)
  7.  *
  8.  */
  9.  
  10. #ifndef SCAN_DRAWINFO_H
  11.  
  12.  
  13. /*
  14.  * IDrawInfo:
  15.  *
  16.  * This structure is used throughout the new drawing mode functions
  17.  * to pass information back and forth.
  18.  *
  19.  */
  20.  
  21. struct IDrawInfo
  22. {
  23.  
  24.    UBYTE    Tool;       /* Current drawing tool */
  25.    UBYTE    Flags;      /* Flags - see below */
  26.    UBYTE    DIteration; /* Drawmode iteration count (0 .. N-1) */
  27.    UBYTE    SIteration; /* Drawstyle iteration count (0 .. N-1) */
  28.                         /* Drawmodes and drawstyles may be called
  29.                            multiple times for each spot that is
  30.                            drawn - these Iteration fields indicate
  31.                            the current iteration of the mode or
  32.                            style.  */
  33.  
  34.    UBYTE    R, G, B,    /* Current drawing color */
  35.             pad1;
  36.  
  37.    short    X, Y, Z;    /* Current X, Y, and Pressure values,
  38.                            relative to upper-left corner of the image.
  39.                            X & Y represent the CENTER of the pen. */
  40.  
  41.    short    LE, TE;     /* Current LeftEdge, TopEdge of the block of
  42.                            pixels.  Represents the upper left corner
  43.                            of the pen.  */
  44.  
  45.    short    Width,      /* Size of the region to affect, in pixels */
  46.             Height,
  47.             Bytes;      /* Bytes per row of image data in Red,Green,Blue
  48.                            below */
  49.  
  50.    short    PenHX,      /* Pen "handle", offset from plotting point to */
  51.             PenHY;      /* upper left corner of the pen */
  52.  
  53.    UBYTE   *PenR,       /* Information that will be written to the image */
  54.            *PenG,       /* READ ONLY */
  55.            *PenB;
  56.  
  57.    UBYTE   *BufR,       /* What's at the current location already */
  58.            *BufG,       /* READ ONLY! */
  59.            *BufB;
  60.  
  61.    UBYTE   *OutR,       /* Results of the drawing mode are stored here */
  62.            *OutG,       /* ImageFX will then stuff this information back */
  63.            *OutB;       /* into the buffer with blending/transparency/etc */
  64.  
  65.    UBYTE   *Mask;       /* Mask of pixels to affect (if non-NULL).
  66.                            This can be used to limit the pixels
  67.                            that the drawing mode affects so as
  68.                            to speed up the operation (for time consuming
  69.                            drawing modes).  Optionally, you can ignore
  70.                            this but only the pixels inside the mask
  71.                            will be stuffed into the buffer.  Each
  72.                            byte represents a pixel, if non-zero, the
  73.                            pixel is to be affected. */
  74.  
  75.    APTR     DPrivate,   /* Internal use only!  Do not touch! */
  76.             SPrivate;
  77.  
  78.    APTR     UserData1,  /* For the drawmode/style.  Untouched by IFX. */
  79.             UserData2,
  80.             UserData3,
  81.             UserData4;
  82.  
  83.    ULONG    DAttr,      /* Drawing mode attributes */
  84.             SAttr;      /* Drawing style attributes */
  85.  
  86.    ULONG    BufXO,      /* Offset from the actual edge of the BufR */
  87.             BufYO;      /* buffers to the BufR pointers.  That is,
  88.                            the size of the borders around the BufR
  89.                            buffers.  Used for convolve-type drawmodes */
  90.    WORD     BufW,       /* Actual size of the BufR,BufG,BufB buffer */
  91.             BufH;
  92.  
  93.    ULONG    BufOffs;    /* Offset from BufR pointers back to the
  94.                            beginning of the actual allocated space */
  95.  
  96.    LONG     NodeCur;    /* This field indicates which 'node' of a
  97.                            freehand draw or airbrush is currently
  98.                            being painted.  Ranges from 0..(N-1). */
  99.    LONG     NodeMax;    /* This field indicates the total number
  100.                            of freehand draw or airbrush 'nodes' that are
  101.                            going to be painted.  This will be -1 for
  102.                            any realtime functions (eg. realtime
  103.                            airbrush) */
  104.  
  105.    struct Buffer        /* We define these as buffers so that */
  106.            *BPen,       /*  virtual memory may be applied to them */
  107.            *BBuf,
  108.            *BOut,
  109.            *BMask;
  110.  
  111.    LONG     reserved[6];
  112.  
  113. };
  114.  
  115. #define IDIF_StatusBar        0x01        /* set by ImageFX so that the
  116.                                              drawstyle will do Bar()
  117.                                              calls for each scanline it
  118.                                              processes */
  119. #define IDIF_Private          0x80        /* ImageFX private */
  120.  
  121. /*
  122.  * XDrawAttr:
  123.  *
  124.  * Structure returned by xdrawmode function XDM_Attr() and xdrawstyle
  125.  * function XDS_Attr().  Provides information about the mode or style
  126.  * to ImageFX.
  127.  *
  128.  */
  129. struct XDrawAttr
  130. {
  131.  
  132.    ULONG    Flags;                        /* see below */
  133.    BYTE     Priority;                     /* position in drawmode cycler,
  134.                                              127=first, -128=last */
  135.    BYTE     HorizOffs,                    /* additional pixels to allocate */
  136.             VertOffs;                     /* for the BufR,BufG,BufB buffers. */
  137.                                           /* This is used in, eg., the blur
  138.                                              xdrawmode so we can
  139.                                              blur outside of the region */
  140.    BYTE     Iterations;                   /* Number of times that the
  141.                                              drawmode or drawstyle must
  142.                                              be iterated to work properly.
  143.                                              0 == 1. */
  144.    ULONG    reserved[4];
  145.  
  146. };
  147.  
  148. /*
  149.  * Flag values for XDrawAttr:
  150.  */
  151.  
  152. #define XDMF_ColorOnly        0x0001      /* drawing mode only works on
  153.                                              color images */
  154. #define XDMF_GreyOnly         0x0002      /* drawing mode only works on
  155.                                              greyscale images */
  156. #define XDMF_AreOptions       0x0004      /* drawing mode requires an
  157.                                              "options" button somewhere
  158.                                              to adjust user-definable
  159.                                              parameters */
  160. #define XDMF_NoPen            0x0008      /* drawing pen color is not used
  161.                                              to affect pixels (eg. darken,
  162.                                              lighten, blur, etc.).  Pen#?
  163.                                              pointers are not allocated. */
  164. #define XDMF_NoBuf            0x0010      /* existing buffer is not
  165.                                              used to affect pixels (eg.
  166.                                              normal).  Buf#? pointers
  167.                                              are not allocated. */
  168. #define XDMF_Continuous       0x0020      /* (not used) */
  169. #define XDMF_MouseTrap        0x0040      /* drawing mode/style requires
  170.                                              notification of mousebutton
  171.                                              and mousemove events */
  172. #define XDMF_UndoSwap         0x0080      /* undo should be saved and
  173.                                              restored to the swap buffer */
  174. #define XDMF_UndoAlpha        0x0100      /* undo should be saved and
  175.                                              restored to the alpha channel */
  176. #define XDMF_RedrawTrap       0x0200      /* drawstyle wants to control
  177.                                              the screen redraw process */
  178. #define XDMF_UndoTrap         0x0400      /* drawstyle wants to control
  179.                                              the undo saving process */
  180. #define XDMF_NoRealTime       0x0800      /* this drawmode or drawstyle
  181.                                              cannot be used with any
  182.                                              realtime drawing tools */
  183. #define XDMF_Gradient         0x1000      /* this little kludge allows us
  184.                                              to continue to have a GRADIENT
  185.                                              drawmode - it only works on
  186.                                              brushes. */
  187. #define XDMF_ChangeMask       0x2000      /* set this if the mode or style
  188.                                              makes changes to the mask -
  189.                                              this tells IFX to re-init the
  190.                                              mask on every iteration */
  191. #define XDMF_ScanLine         0x4000      /* set this if the mode or style
  192.                                              can work a scanline at a time.
  193.                                              Generally convolve-type modes
  194.                                              cannot. */
  195.  
  196. #define SCAN_DRAWINFO_H
  197. #endif
  198.