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

  1. /*
  2.  * ImageFX Development Header File
  3.  * Copyright © 1991-1995 Nova Design, Inc.
  4.  * Written by Thomas Krehbiel
  5.  *
  6.  * Dither Module Defintions
  7.  *
  8.  */
  9.  
  10. /*
  11.  * DitherArgs:
  12.  *
  13.  * Passed back and forth among the dithering functions.
  14.  *
  15.  */
  16. struct DitherArgs
  17. {
  18.    short          X1, Y1;                    /* Starting corner */
  19.    short          Width, Height;             /* Area to work on */
  20.    short         (*CB_NewLine)               /* Called to start each line */
  21.                   (short wid,
  22.                    short row);
  23.    short         (*CB_Quantize)              /* Find closest palette entry */
  24.                   (short r, short g, short b,
  25.                    short *qr, short *qg, short *qb);
  26.    void          (*CB_PutLine)               /* Output a line of RGB data */
  27.                   (UWORD *outline,
  28.                    short xoffs,
  29.                    short wid,
  30.                    short row);
  31.    LONG           Type;                      /* Type of dither (index) */
  32.    LONG           Direction;                 /* Direction of dither (index) */
  33.    LONG           Limit;                     /* Error limit (index) */
  34.    short          Bits;                      /* Output color depth */
  35. };
  36.  
  37. /* void    CB_NewLine (short width, short row) */
  38. /* color = CB_Quantize (short r, g, b, short &qr, &qg, &qb) */
  39. /* void    CB_PutLine (UWORD *outline, short xoffs, short wid, short row) */
  40.  
  41. #define DF_FWD             (0x0000)
  42. #define DF_BACK            (0x8000)
  43. #define DF_ZIGZAG          (0x4000)
  44.  
  45.  
  46. #ifndef NO_DITHER_DEFINES
  47. #define DM_NewDither       DoDither
  48. #define DM_InitDither      InitDither
  49. #define DM_FreeDither      FreeDither
  50. #endif
  51.