home *** CD-ROM | disk | FTP | other *** search
- /*
- * ImageFX Development Header File
- * Copyright © 1991-1995 Nova Design, Inc.
- * Written by Thomas Krehbiel
- *
- * XDrawModes and XDrawStyles (2.0)
- *
- */
-
- #ifndef SCAN_DRAWINFO_H
-
-
- /*
- * IDrawInfo:
- *
- * This structure is used throughout the new drawing mode functions
- * to pass information back and forth.
- *
- */
-
- struct IDrawInfo
- {
-
- UBYTE Tool; /* Current drawing tool */
- UBYTE Flags; /* Flags - see below */
- UBYTE DIteration; /* Drawmode iteration count (0 .. N-1) */
- UBYTE SIteration; /* Drawstyle iteration count (0 .. N-1) */
- /* Drawmodes and drawstyles may be called
- multiple times for each spot that is
- drawn - these Iteration fields indicate
- the current iteration of the mode or
- style. */
-
- UBYTE R, G, B, /* Current drawing color */
- pad1;
-
- short X, Y, Z; /* Current X, Y, and Pressure values,
- relative to upper-left corner of the image.
- X & Y represent the CENTER of the pen. */
-
- short LE, TE; /* Current LeftEdge, TopEdge of the block of
- pixels. Represents the upper left corner
- of the pen. */
-
- short Width, /* Size of the region to affect, in pixels */
- Height,
- Bytes; /* Bytes per row of image data in Red,Green,Blue
- below */
-
- short PenHX, /* Pen "handle", offset from plotting point to */
- PenHY; /* upper left corner of the pen */
-
- UBYTE *PenR, /* Information that will be written to the image */
- *PenG, /* READ ONLY */
- *PenB;
-
- UBYTE *BufR, /* What's at the current location already */
- *BufG, /* READ ONLY! */
- *BufB;
-
- UBYTE *OutR, /* Results of the drawing mode are stored here */
- *OutG, /* ImageFX will then stuff this information back */
- *OutB; /* into the buffer with blending/transparency/etc */
-
- UBYTE *Mask; /* Mask of pixels to affect (if non-NULL).
- This can be used to limit the pixels
- that the drawing mode affects so as
- to speed up the operation (for time consuming
- drawing modes). Optionally, you can ignore
- this but only the pixels inside the mask
- will be stuffed into the buffer. Each
- byte represents a pixel, if non-zero, the
- pixel is to be affected. */
-
- APTR DPrivate, /* Internal use only! Do not touch! */
- SPrivate;
-
- APTR UserData1, /* For the drawmode/style. Untouched by IFX. */
- UserData2,
- UserData3,
- UserData4;
-
- ULONG DAttr, /* Drawing mode attributes */
- SAttr; /* Drawing style attributes */
-
- ULONG BufXO, /* Offset from the actual edge of the BufR */
- BufYO; /* buffers to the BufR pointers. That is,
- the size of the borders around the BufR
- buffers. Used for convolve-type drawmodes */
- WORD BufW, /* Actual size of the BufR,BufG,BufB buffer */
- BufH;
-
- ULONG BufOffs; /* Offset from BufR pointers back to the
- beginning of the actual allocated space */
-
- LONG NodeCur; /* This field indicates which 'node' of a
- freehand draw or airbrush is currently
- being painted. Ranges from 0..(N-1). */
- LONG NodeMax; /* This field indicates the total number
- of freehand draw or airbrush 'nodes' that are
- going to be painted. This will be -1 for
- any realtime functions (eg. realtime
- airbrush) */
-
- struct Buffer /* We define these as buffers so that */
- *BPen, /* virtual memory may be applied to them */
- *BBuf,
- *BOut,
- *BMask;
-
- LONG reserved[6];
-
- };
-
- #define IDIF_StatusBar 0x01 /* set by ImageFX so that the
- drawstyle will do Bar()
- calls for each scanline it
- processes */
- #define IDIF_Private 0x80 /* ImageFX private */
-
- /*
- * XDrawAttr:
- *
- * Structure returned by xdrawmode function XDM_Attr() and xdrawstyle
- * function XDS_Attr(). Provides information about the mode or style
- * to ImageFX.
- *
- */
- struct XDrawAttr
- {
-
- ULONG Flags; /* see below */
- BYTE Priority; /* position in drawmode cycler,
- 127=first, -128=last */
- BYTE HorizOffs, /* additional pixels to allocate */
- VertOffs; /* for the BufR,BufG,BufB buffers. */
- /* This is used in, eg., the blur
- xdrawmode so we can
- blur outside of the region */
- BYTE Iterations; /* Number of times that the
- drawmode or drawstyle must
- be iterated to work properly.
- 0 == 1. */
- ULONG reserved[4];
-
- };
-
- /*
- * Flag values for XDrawAttr:
- */
-
- #define XDMF_ColorOnly 0x0001 /* drawing mode only works on
- color images */
- #define XDMF_GreyOnly 0x0002 /* drawing mode only works on
- greyscale images */
- #define XDMF_AreOptions 0x0004 /* drawing mode requires an
- "options" button somewhere
- to adjust user-definable
- parameters */
- #define XDMF_NoPen 0x0008 /* drawing pen color is not used
- to affect pixels (eg. darken,
- lighten, blur, etc.). Pen#?
- pointers are not allocated. */
- #define XDMF_NoBuf 0x0010 /* existing buffer is not
- used to affect pixels (eg.
- normal). Buf#? pointers
- are not allocated. */
- #define XDMF_Continuous 0x0020 /* (not used) */
- #define XDMF_MouseTrap 0x0040 /* drawing mode/style requires
- notification of mousebutton
- and mousemove events */
- #define XDMF_UndoSwap 0x0080 /* undo should be saved and
- restored to the swap buffer */
- #define XDMF_UndoAlpha 0x0100 /* undo should be saved and
- restored to the alpha channel */
- #define XDMF_RedrawTrap 0x0200 /* drawstyle wants to control
- the screen redraw process */
- #define XDMF_UndoTrap 0x0400 /* drawstyle wants to control
- the undo saving process */
- #define XDMF_NoRealTime 0x0800 /* this drawmode or drawstyle
- cannot be used with any
- realtime drawing tools */
- #define XDMF_Gradient 0x1000 /* this little kludge allows us
- to continue to have a GRADIENT
- drawmode - it only works on
- brushes. */
- #define XDMF_ChangeMask 0x2000 /* set this if the mode or style
- makes changes to the mask -
- this tells IFX to re-init the
- mask on every iteration */
- #define XDMF_ScanLine 0x4000 /* set this if the mode or style
- can work a scanline at a time.
- Generally convolve-type modes
- cannot. */
-
- #define SCAN_DRAWINFO_H
- #endif
-