home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / System / Mesa-3.1 / src / AOS / palettes / paletteserror.c < prev    next >
C/C++ Source or Header  |  1999-06-30  |  795b  |  26 lines

  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. #define    ERROR11(e)    e < 0 ? -(e *  1) : (e *  1)
  5. #define    ERROR56(e)    e < 0 ? -(e *  5) : (e *  5)
  6. #define    ERROR66(e)    e < 0 ? -(e *  6) : (e *  6)
  7. #define    ERRORRY(e)    e < 0 ? -(e * 21) : (e * 21)
  8. #define    ERRORGY(e)    e < 0 ? -(e * 72) : (e * 72)
  9. #define    ERRORBY(e)    e < 0 ? -(e *  7) : (e *  7)
  10.  
  11. int main(int argc, char **argv) {
  12.   short int i;
  13.  
  14.   /* maxsum = 768, 1:1:1 */
  15.   for (i = -256; i < 256; i++)
  16.     printf("  {0x%04x,0x%04x,0x%04x},\n", ERROR11(i), ERROR11(i), ERROR11(i));
  17.  
  18.   /* maxsum = 4096, 5:6:5 */
  19.   for (i = -256; i < 256; i++)
  20.     printf("  {0x%04x,0x%04x,0x%04x},\n", ERROR56(i), ERROR66(i), ERROR56(i));
  21.  
  22.   /* maxsum = 25245, Y */
  23.   for (i = -256; i < 256; i++)
  24.     printf("  {0x%04x,0x%04x,0x%04x},\n", ERRORRY(i), ERRORGY(i), ERRORBY(i));
  25. };
  26.