home *** CD-ROM | disk | FTP | other *** search
- /*
- * ImageFX Development Header File
- * Copyright © 1991-1995 Nova Design, Inc.
- * Written by Thomas Krehbiel
- *
- * Image Buffers And Related Structures
- *
- */
-
- #ifndef SCAN_BUF_H
-
-
- #ifndef EXEC_TYPES_H
- #include <exec/types.h>
- #endif
-
- #ifndef EXEC_NODES_H
- #include <exec/nodes.h>
- #endif
-
- #ifndef SCAN_DRAW_H
- #include <scan/draw.h> /* for enum Region_Tag */
- #endif
-
- /*
- * RMask (2.0):
- *
- * Rendered Mask - a rendered representation of a Mask struct for
- * quickly stamping region masks onscreen.
- *
- */
- struct RMask
- {
-
- UWORD *Mask; /* 1-bitplane blit mask */
- ULONG Size; /* size of Mask in bytes */
- ULONG Row; /* bytes per row in Mask */
- UWORD X1, Y1; /* onscreen location */
- UWORD X2, Y2;
- UWORD ViewX, /* size of preview when rendered */
- ViewY;
- ULONG pad[7];
-
- };
-
- /*
- * Mask:
- *
- * Mask - Defines a 1-bitplane mask plane for regional processing.
- * Also used to define the bounds of a brush.
- *
- */
- struct Mask
- {
- short OffsetX; /* Offset into image */
- short OffsetY;
- short Width; /* Width of rectangle */
- short Height; /* Height of rectangle */
- long Size; /* Size of mask data in bytes */
- short BytesPerRow; /* Bytes per mask row */
- UBYTE *Mask; /* Pointer to mask data (can be CHIP mem) */
- enum Area_Tag Type; /* Type of mask (NOT USED) */
- UBYTE Flags; /* New flags for 2.0 */
- char pad;
- struct RMask *RMask; /* "Rendered mask" information */
- UBYTE *Mask8; /* 8-bit mask if MASKF_8BIT set */
- short reserved[2];
- };
-
- #define MASKF_8BIT 0x01 /* This is an 8-bit Mask instead of 1-bit */
-
- /*
- * NOTE: 8-Bit Masks are not implemented yet.
- */
-
-
- /*
- * Blend:
- *
- * Defines an 8-bit blend plane; generated by the feathering routines
- * in CreateBlend(). Do not allocate or free this structure yourself;
- * use CreateBlend() and DeleteBlend().
- *
- */
- struct Blend
- {
- short Width, Height; /* Dimensions in pixels */
- ULONG Size; /* Size of plane in bytes */
- UBYTE *Blend; /* Pointer to 8-bit blend data */
- ULONG Reserved[8]; /* Reserved for future expansion */
- };
-
- /*
- * Clip:
- *
- * Used internally by the preview functions for storing sections of the
- * preview screen when doing onscreen brush movement. This should be
- * considered a semi-private structure.
- *
- */
- struct Clip
- {
- short LeftEdge, /* Left Corner in screen pixels */
- TopEdge; /* Top Corner in screen pixels */
- short Width, /* Clip width in screen pixels */
- Height; /* Clip height in screen pixels */
- short OffsetX, /* Attributes of the view that */
- OffsetY; /* the clip came from for */
- short ViewX, /* comparison later */
- ViewY;
- struct BitMap BitMap_old; /* (OBSOLETE) */
- UBYTE *Stencil; /* Stencil plane */
- ULONG StencilSize; /* Size of the stencil plane */
- APTR PreviewPtr; /* Used only by the preview module */
- struct BitMap SwapBM_old; /* (OBSOLETE) */
- short SwapLE, SwapTE, /* Where swap came from. */
- SwapW, SwapH;
- struct BitMap *NewBM, *NewSwapBM;
- ULONG Reserved[6];
- };
-
- /*
- * Buffer:
- *
- * Defines an 8- or 24-bit image buffer. Used a LOT in ImageFX. This
- * structure is also used for brushes. You should ALWAYS use AllocBuffer()
- * and KillBuffer() to create and destroy this structure.
- *
- * Image data is organized as three separate, contiguous blocks of memory
- * for each of the Red, Green, and Blue channels.
- *
- */
- struct Buffer
- {
- struct Node Node; /* (OBSOLETE) */
-
- char Name[130]; /* Filename of this buffer */
- char Type[16]; /* Filetype for status display */
- char Locked; /* (OBSOLETE) */
- unsigned char Flags; /* Various flag bits (see below) */
- short Width, Height; /* PIXEL width and height (max=32Kx32K)*/
- char BitsPerPlane; /* Number of bits per pixel (ALWAYS 8) */
- char Depth; /* Number of planes (1=grey or 3=rgb) */
- short BytesPerRow; /* Number of bytes per row (usually = width) */
- long PlaneSize; /* Size of each plane, in bytes */
- UBYTE *Planes[4]; /* Pointers to the plane data */
-
- struct Mask *UnusedMask; /* Unused region mask (INTERNAL) */
- UBYTE **RowPtr[3]; /* 2.0: Row pointers for faster GetBufLine (INTERNAL) */
-
- UBYTE *Red, *Grn, *Blu; /* Temp line pointers (INTERNAL) */
- ULONG TempSize; /* Size of temp line buffers (INTERNAL) */
-
- /*
- * These are used for disk buffers, and should not be modified.
- */
- struct VM_Handle *DHandle; /* VMem handle */
- short LastGet; /* Row/column of last GetBufLine() */
- /* Unfortunately, this is not long aligned anymore */
-
- /*
- * For Brushes, this defines the area of the brush.
- * For Buffers, this defines the current region.
- */
- struct Mask *Mask; /* Region mask */
-
- /*
- * These are used for Brushes. Contains the rendered version
- * of the brush for display. Do not touch.
- */
- struct Clip *Clip; /* Fast display clip */
-
- /*
- * These are used for mapping the buffer onto the preview display.
- * They maintain the "viewport" of the buffer. Do not touch.
- */
- short OffsetX, /* Pan position */
- OffsetY;
- short ViewX, /* Virtual (zoomed) screen size */
- ViewY;
-
- /*
- * Some stuff for reading multiple lines from a buffer at
- * once into contiguous lines. Do not touch.
- */
- UBYTE *DLines[3]; /* Temp line pointers */
- UWORD DLineOffset; /* Start line */
- UWORD DLineCount; /* Number of temp lines allocated */
- ULONG DSize; /* Bytes in each allocated line */
-
- /*
- * See aspect discussion below.
- */
- short AspectX, /* (OBSOLETE) */
- AspectY; /* (OBSOLETE) */
-
- /*
- * The "handle" for a brush. The upper-left corner is found by
- * subtracting these numbers from the mouse position. Thus if
- * the handle is in the upper-left, HandleX = HandleY = 0.
- */
- short HandleX, /* X & Y handle for brushes. */
- HandleY;
-
- /*
- * Dots per inch in the horizontal and vertical directions. Used
- * for storing in a DPI chunk and for possible printing applications.
- * These can be converted to other system (eg. metric) fairly easily.
- */
- short DPIX,
- DPIY;
-
- /*
- * The pixel aspect ratio is different from the screen aspect
- * ratio! PIXEL aspect ratio defines how square the pixels are,
- * the SCREEN aspect ratio defines how square the screen is.
- * On a Macintosh, the pixel aspect is always 1:1 (so I'm told),
- * whereas on the Amiga the pixel aspect ratios change from
- * mode to mode (lores = 10:11, hires = 5:11, lores+lace = 20:11,
- * hires+lace = 10:11).
- */
- short PixAspectX, /* PIXEL aspect ratio for this */
- PixAspectY; /* image buffer. */
-
- /*
- * Scale tables used for displaying on the preview screen.
- * Each buffer has its own scaling table attached to it.
- * Do not touch.
- */
- short *Prev2BufX, /* Preview coords to Buffer coords */
- *Prev2BufY,
- *Buf2PrevX, /* Buffer coords to Preview coords */
- *Buf2PrevY,
- *TableX, /* Incremental offsets to convert */
- *TableY; /* from preview to buffer coords */
- long PrevSizeX, /* Size of preview->buffer tables */
- PrevSizeY,
- BufSizeX, /* Size of buffer->preview tables */
- BufSizeY;
-
- /*
- * Blend Alpha channel for use with brushes and feathering....
- */
- UBYTE *BlendPlane; /* 8-bit blend plane for feathering
- Always matches the size of the buffer */
- UBYTE FeatherAmt; /* Blend plane feather amount..
- used to keep from re-calculating
- the same feather amount twice. */
-
- UBYTE ExtFlags; /* More flags */
- UBYTE RegionGadget; /* Region gadget setting for this buffer
- (PRIVATE) */
- UBYTE pad2;
-
- /*
- * These are used by Loaders to store what kind of file the buffer
- * was before it was loaded. It stores an Amiga ViewModes.
- * These are not currently used for anything.
- */
- ULONG OriginalModes; /* ViewModes before turned into 24-bit */
- ULONG OriginalDepth; /* Depth of image before 24-bit */
-
- /*
- * ImageFX now uses the UserData fields internally (sorry).
- *
- * UserData1 is used to store MAGIC information if ExtFlags & XBUFF_EXTERNAL.
- * UserData2 is used in conjunction with undo buffers.
- *
- */
- ULONG PrivateData1, /* (DO NOT USE) */
- PrivateData2; /* (DO NOT USE) */
-
- char ANNO[96]; /* ANNO chunk - currently unused */
-
- short ViewLeft, /* Preview containing box */
- ViewTop,
- ViewWidth,
- ViewHeight;
-
- UWORD RowsPerPage; /* Scanlines per VMEM page */
- UWORD pad3;
-
- struct MinList *AirUndo; /* (private) */
- struct BufNode *MNode; /* (private) */
-
- char SaveFormat[32]; /* Name of save format to use when
- the user just selects SAVE. This
- must be set by the loader module
- when the buffer is created. If
- empty, then ILBM is assumed. */
- LONG SaveID; /* ID that is also passed to the
- saver module to identify the
- format of the file */
-
- LONG ZoomLevel; /* 2.0: Zoom level - positive is
- zoomed in, negative is zoomed
- out. (z >= 1 || z <= -2) */
-
- APTR UserData; /* User data, untouched by ImageFX */
-
- LONG Reserved[30]; /* Buffer struct is bigger in 2.0! */
- };
-
-
- /*
- * Flag bits:
- */
- #define BUFF_DISK 0x01 /* Buffer maintained on disk */
- #define BUFF_MOD 0x02 /* Buffer is modified (UNUSED) */
- #define BUFF_BRUSH 0x04 /* This buffer is a brush */
- #define BUFF_UNDO 0x08 /* This is an undo buffer */
- #define BUFF_COPY 0x10 /* Private! */
- #define BUFF_PEN 0x20 /* This brush is really a pen */
-
- #define BUFF_FORCEDISK 0x40 /* (internal use only) */
- #define BUFF_NOVMEM 0x80 /* Passed to AllocBuffer disallows virtual memory */
-
- /*
- * ExtFlag bits:
- */
- #define XBUFF_EXTERNAL 0x01 /* This buffer has been IMPORT'ed or is MAGIC */
- #define XBUFF_OUTSTANDING 0x02 /* Outstanding locked vmem page */
- #define XBUFF_THUMBNAIL 0x04 /* 2.0: Thumbnail buffer (private) */
- #define XBUFF_PRIVATE 0x80 /* DO NOT TOUCH! */
-
- /*
- * BufNode (2.0):
- *
- * Multiple buffers and brushes a maintained as a list of BufNode
- * structures. (For backwards compatibility reasons, we can't use
- * Buffer->Node.)
- *
- */
- struct BufNode
- {
- struct Node Node;
- struct Buffer *Buffer;
- };
-
-
- /*
- * SepInfo:
- *
- * Used internally by the color separation routines.
- *
- */
- struct SepInfo
- {
- LONG UCR,
- GCR,
- Magenta,
- Yellow;
- LONG Type;
- LONG Plane;
- LONG Depth;
- LONG CMAP;
- };
-
- /*
- * SepBuf:
- *
- * Used internally by the color separation routines.
- *
- */
- struct SepBuf
- {
- UBYTE *Planes[32];
- ULONG PlaneSize;
- UWORD Width, Height;
- UBYTE Depth;
- UBYTE Bits;
- UBYTE Plane;
- UBYTE Flags;
- UWORD MapSize;
- UBYTE *ColorMap[4];
- WORD AspectX, AspectY;
- WORD DPIX, DPIY;
- };
-
- /* Type of separation: */
- #define SEP_CMYK (0)
- #define SEP_CMY (1)
- #define SEP_RGB (2)
-
- /* Output colormap: */
- #define SEP_GREY (0)
- #define SEP_COLOR (1)
-
- /* Depth: */
- #define SEP_24BIT (0)
- #define SEP_12BIT (1)
-
- /* Flags: */
- #define SEP_QUIET (0x01) /* No edit window */
- #define SEP_1PLANE (0x02) /* Only output 1 plane */
- #define SEP_CHUNKY (0x04) /* Output chunky planes instead of bitplanes */
-
-
- #define SCAN_BUF_H
- #endif
-