home *** CD-ROM | disk | FTP | other *** search
- /*
- * ImageFX Development Header File
- * Copyright © 1991-1995 Nova Design, Inc.
- * Written by Thomas Krehbiel
- *
- * Loader and Saver Definitions.
- *
- */
-
- #ifndef SCAN_LOADSAVE_H
-
-
- #ifndef EXEC_TYPES_H
- #include <exec/types.h>
- #endif
-
- #ifndef EXEC_NODES_H
- #include <exec/nodes.h>
- #endif
-
- #ifndef EXEC_LISTS_H
- #include <exec/lists.h>
- #endif
-
- /* why is this here? becuase render modules usually include loadsave.h */
- #ifndef SCAN_REND_H
- #include <scan/rend.h>
- #endif
-
-
- /*
- * LoadFormat:
- *
- * The Loader module function LM_Signatures() returns a pointer to an
- * array of LoadFormat structures, which define the signature bytes
- * that identify this file type. The list ends with a NULL Identifier
- * field. Each Loader can return more than one LoadFormat structure,
- * to support multiple variants of a particular file type.
- *
- * LoadFormat->Identifier are the signature bytes to match at the
- * beginning of the file. A "?" will match any value in the input
- * file (eg. "FORM????ILBM").
- *
- * LoadFormat->Length is the number of bytes to scan at the beginning
- * of the file. Use as few as possible.
- *
- * LoadFormat->Name is what is displayed to the user as the name of
- * the format.
- *
- */
-
- struct LoadFormat
- {
- char *Identifier; /* Variable-length identifier bytes */
- int Length; /* Length of identifier string */
- char *Name; /* Name of format (for user) */
- int ID; /* Loader-specific ID code */
- UWORD Flags; /* Various flags (see below) */
- };
-
- /* flags for LoadFormat->Flags: */
- #define LOA_NOFILE (0x0200) /* Tell ImageFX not to ask for filename
- when loading this format - this is
- used by the clipboard loader */
-
- #define LOA_MULTI (0x1000) /* This file format contains multiple
- images (eg. animation) - used to
- determine whether a file is an
- animation or not. */
-
- #define LOA_PREFS (0x2000) /* 2.0 - This file format has user-definable
- preferences settings. (UNUSED) */
-
- #define LOA_OLDNAME (0x4000) /* 2.0 - don't show this name in GUI lists,
- but still recognize it via. Arexx
- (UNUSED) */
-
-
- #ifdef SCANPRIVATE
-
- /*
- * LoadNode/LoadList:
- *
- * Used internally to store all loader module information.
- *
- */
- struct LoadNode
- {
- struct Node Node; /* Exec-standard node */
- struct LoadFormat Format; /* Format information */
- char Loader[128]; /* Loader to open and call */
- int Bytes; /* Length of node in bytes */
- char Name[60]; /* Name of the loader */
- char Text[1]; /* Text is allocated here */
- };
-
- struct LoadList
- {
- struct List List; /* List of loader nodes */
- int MaxLength; /* Bytes to read from file */
- struct List OldList; /* Old name loader nodes */
- };
-
- #endif
-
- /*
- * SaveFormat:
- *
- * The Saver module function SM_Signatures() returns a pointer to an array
- * of SaveFormat structures, which define the names and flags of the file
- * formats supported by the module. The list is terminated by a NULL
- * Name field. Each Saver can return more than one SaveFormat structure,
- * to support multiple variants of a particular file type.
- *
- */
- struct SaveFormat {
- char *Name;
- ULONG Flags;
- int ID;
- };
-
- /* flags for SaveFormat: */
- #define SAV_TRUE (0x0001) /* Can save 8- or 24-bit true color */
- #define SAV_MAPPED (0x0002) /* Can save a BitMap/ViewPort */
- #define SAV_PALETTE (0x0004) /* Can save a 24-bit palette */
- #define SAV_CMYK (0x0008) /* Can handle CMYK format images */
- #define SAV_NOREQ (0x0080) /* Don't ask to overwrite... we'll do it */
- #define SAV_NOMASK (0x0100) /* Format does not support a mask */
- #define SAV_NOFILE (0x0200) /* This format does not require a filename (eg. clipboard) */
- #define SAV_NOICON (0x0400) /* Do not save an icon with this file */
- #define SAV_NOPIC (0x0800) /* Format does not require a render picture */
- #define SAV_MULTI (0x1000) /* Format contains multiple images (ie. anim) */
- #define SAV_NONAIL (0x2000) /* 2.0 - don't save thumbnail file */
- #define SAV_OLDNAME (0x4000) /* 2.0 - don't show this name in GUI lists,
- but still recognize it via. Arexx (UNUSED) */
-
- #ifdef SCANPRIVATE
-
- /*
- * SaveNode:
- *
- * Used internally to keep track of saver modules.
- *
- */
- struct SaveNode
- {
- struct MinNode Node; /* Exec standard node */
- struct Node TrueNode; /* Node for True list */
- struct Node MappedNode; /* Node for Mapped list */
- struct Node PalNode; /* Node for Palette list */
- struct Node SepNode; /* Node for Color Separation list */
- struct SaveFormat Format; /* Save format name */
- char Saver[128]; /* Name of saver module */
- int Bytes; /* Length of node in bytes */
- char Text[1]; /* Text is allocated here */
- };
-
- #endif
-
- /*
- * Palatte:
- *
- * Information about a colormap palette. This structure is used by
- * the scan.library function NewGetPalette() to retreive information
- * about the current ImageFX palette. It is also used by the Loader
- * module function LM_LoadPalette(). It is also used in the MappedImage
- * structure, which is passed to the Saver module function SM_SaveMapped().
- *
- */
- struct Palette
- {
- short Depth; /* Bitplanes in palette */
- short Count; /* Count of palette entries, will
- usually be 2 ^ Depth */
- UBYTE *Table; /* Array of palette entries, arranged
- as 3 bytes each of Red, Green,
- Blue. (Length = 3 * Count) */
- /*
- * This information is generally only used by the NewGetPalette()
- * function to report information about ImageFX palettes:
- */
- short NumRanges; /* Number of color ranges in palette */
- short pad0;
- short *LowRange; /* Array of lower limit of ranges */
- short *HighRange; /* Array of upper limit of ranges */
- short *RangeLocked; /* Array of locked indicators */
- };
-
- /*
- * MappedImage:
- *
- * Information about a colormapped image. Passed to the Saver module
- * function SM_SaveMapped() to write colormapped (eg. rendered) images.
- *
- */
- struct MappedImage
- {
- short Width; /* True image pixel width */
- short Height; /* True image pixel height */
- struct BitMap *BitMap; /* Image bitmap, up to 8 bitplanes */
- struct ViewPort *ViewPort; /* (OBSOLETE) */
- UBYTE *Copper; /* (UNUSED) */
- struct Palette Palette; /* True image palette, see above */
- ULONG Modes; /* ViewModes - use instead of ViewPort */
- UWORD AspectX, /* X & Y pixel aspect ratio */
- AspectY; /* (used to fill in BMHD) */
- ULONG pad[7]; /* reserved */
- };
-
- #define SCAN_LOADSAVE_H
- #endif
-