home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / PVQUAN15.ZIP / QUANT.ZIP / HECKBERT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-03  |  1.8 KB  |  41 lines

  1. /************************************************************************
  2.  *                                                                      *
  3.  *                  Copyright (c) 1991, Frank van der Hulst             *
  4.  *                          All Rights Reserved                         *
  5.  *                                                                      *
  6.  * Authors:                                                             *
  7.  *                FvdH - Frank van der Hulst (Wellington, NZ)           *
  8.  *                                                                      *
  9.  * Versions:                                                            *
  10.  *      V1.1 910626 FvdH - QUANT released for DBW_RENDER                *
  11.  *      V1.2 911021 FvdH - QUANT released for PoV Ray                   *
  12.  *      V1.4 920303 FvdH - Ported to GNU                                *
  13.  *                                                                      *
  14.  ************************************************************************/
  15. /* heckbert.h -- definitions for heckbert.c, virt_mem.c */
  16.  
  17. struct BOX {
  18.     double            weightedvar,            /* weighted variance */
  19.                         mean[3];                    /* centroid */
  20.     unsigned long     weight,                    /* # of pixels in box */
  21.                         freq[3][MAXCOLORS];    /* Projected frequencies */
  22.     int                 low[3], high[3];        /* Box extent */
  23. };
  24. typedef struct BOX Box;
  25.  
  26. Box *get_box(int n);
  27. Box *get_box_tmp(int n);
  28. void free_box(int n);
  29. void open_box_file(int colors);
  30. void close_box_file(void);
  31.  
  32. #define IN_COLOURS (1 << INPUT_BITS)
  33. #define BYTE_COUNT ((long)IN_COLOURS * IN_COLOURS * IN_COLOURS)
  34.             /* (2^INPUT_BITS)^3    */
  35.  
  36. extern unsigned long HUGE_PTR Histogram;
  37. extern unsigned char HUGE_PTR RGBmap;
  38.  
  39. int colorquant(int colors, int bits, int fast, double Cfactor);
  40. void QuantHistogram(Box *box);
  41.