Index

D-Type External Format Plugin Structures

At present, D-Type External Format Plugin defines and utilizes the following structure types:

DT_AUX_INFO

This structure type provides additional initialization information to D-Type External Format Plugin and holds additional initialization information used by D-Type External Format Plugin. The structure is defined as follows:

/* Initialization information */ 
typedef struct
{
    DT_SLONG InitKey;    /* Initialization key (0=demo) */ 
    DT_SWORD InitFlag;   /* Initialization flag (0=demo) */ 
    DT_SWORD Reserved1;  /* Must be set to 0 */ 
    DT_SWORD Reserved2;  /* Must be set to 0 */ 
    DT_UWORD FileFormat; /* File format value (DV_AUX_FILEFORMAT_...) */ 
    void* Internal;      /* Internal use - must be set to DV_NULL */ 

} DT_AUX_INFO;

Presently FileFormat can be one of the following:

DT_AUX_GRAPHICS_ATTRIBS

This structure type holds attributes for raster graphics and is utilized by D-Type External Format Plugin's image input/output and animation functions. The structure is defined as follows:

/* Attributes for raster graphics - (e.g. color gradient for grayscale images, compression quality, transparency treatment etc.) */ 
typedef struct
{
    DT_UBYTE R1, G1, B1;       /* RGB color of the background */ 
    DT_UBYTE R2, G2, B2;       /* RGB color of the foreground */ 
    DT_UBYTE PaletteFlag;      /* Set to 0 for RGB, 1 for palette (PNG 8-bpp mode only) */ 
    DT_UBYTE TransparencyFlag; /* 0=no transparent background, 1=basic transparency, 2=reserved, 3=alpha transparency */ 
    DT_UBYTE AlphaFlag;        /* Set to 1 to respect AlphaValue, otherwise set to 0 */ 
    DT_UBYTE AlphaValue;       /* Supplies alpha or gray value when AlphaFlag is nonzero */ 
    DT_SLONG AnimDelay;        /* Animation delay in 1/100 seconds */ 
    DT_SLONG AnimLoops;        /* Number of animation loops (0=play indefinitely) */ 
    DT_SWORD Quality;          /* Graphics quality (0-100 for JPEG; for GIF quality over 75 activates dithering) */ 

} DT_AUX_GRAPHICS_ATTRIBS;

DT_AUX_USER_STREAM

This structure type defines a generic user stream type for reading and writing data. The structure is defined as follows:

/* User defined stream */ 
typedef struct
{
    void* UserStruct;    /* User supplied data (will be passed to UserFuncR and UserFuncW) */ 
    DT_SLONG (*UserFuncR)(void* user_struct, DT_UBYTE* buffer, DT_SLONG length);       /* user function to read data from stream */ 
    DT_SLONG (*UserFuncW)(void* user_struct, const DT_UBYTE* buffer, DT_SLONG length); /* user function to write data to stream */ 
    DT_FILE_PTR FilePtr; /* For use with standard file-pointer streams */ 

} DT_AUX_USER_STREAM;

If FilePtr is DV_NULL, then D-Type External Format Plugin will use a custom stream which you must implement yourself. In this case UserFuncR must be a valid pointer to your own function that reads data from your stream (and copies it to a supplied buffer), while UserFuncW must be a valid pointer to your own function that writes data to your stream (from a supplied buffer). The UserStruct member is a void pointer to your own data type. This pointer is passed back to your functions during the callback to help you track the state of execution or provide other information useful to your application. This pointer is not accessed or modified by D-Type External Format Plugin in any way; it is simply sent back to your functions as supplied. You can set this parameter to DV_NULL if you have no need for it.

If FilePtr is not DV_NULL, then D-Type External Format Plugin will use a standard C/C++ file-pointer stream. In this case FilePtr must be a valid pointer to a standard C/C++ file stream.

 

Index