home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / grafik / sega / pvquant / quant / heckbert.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-22  |  1.7 KB  |  39 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.  *                                                                      *
  13.  ************************************************************************/
  14. /* heckbert.h -- definitions for heckbert.c, virt_mem.c */
  15.  
  16. typedef struct {
  17.     double            weightedvar,            /* weighted variance */
  18.                         mean[3];                    /* centroid */
  19.     unsigned long     weight,                    /* # of pixels in box */
  20.                         freq[3][MAXCOLORS];    /* Projected frequencies */
  21.     int                 low[3], high[3];        /* Box extent */
  22. } Box;
  23.  
  24. Box *get_box(int n);
  25. Box *get_box_tmp(int n);
  26. void free_box(int n);
  27. void open_box_file(int colors);
  28. void close_box_file(void);
  29.  
  30. #define IN_COLOURS (1 << INPUT_BITS)
  31. #define BYTE_COUNT ((long)IN_COLOURS * IN_COLOURS * IN_COLOURS)
  32.             /* (2^INPUT_BITS)^3    */
  33.  
  34. extern unsigned long HUGE_PTR Histogram;
  35. extern unsigned char HUGE_PTR RGBmap;
  36.  
  37. int colorquant(int colors, int bits, int fast, double Cfactor);
  38. void QuantHistogram(Box *box);
  39.