home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsf / gif2rpc / source / h / map16bpp < prev    next >
Encoding:
Text File  |  1995-10-07  |  1.6 KB  |  55 lines

  1. /* map16bpp.h
  2.  * AUTHOR:      Cy Booker, cy@cheepnis.demon.co.uk
  3.  * LICENSE:     FreeWare, Copyright (c) 1995 Cy Booker
  4.  * PURPOSE:     low level 16 bit colour routines
  5.  */
  6.  
  7. #ifndef map16bpp_h
  8. #define map16bpp_h
  9.  
  10.  
  11.  
  12. #include "OS:os.h"
  13.  
  14. #include "gif2rpc:process_gif.h"
  15.  
  16.  
  17.  
  18. /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  19.  *
  20.  * input: each intensity is nominally 16-bit value, but is first forced into range [0, 0xffff]
  21.  * returns: 16bpp colour number (%0bbb bbgg gggr rrrr)
  22.  * output: error in approximating colour, as a 16-bit scaled, ie (in_clipped - out*0xffff/0x1f)
  23.  *
  24.  * note that this will find the closest colour by examining the nine voxels around the
  25.  * (apparently) nearest one.  It then calculates the error (scaled euclidean distance) for
  26.  * each voxel, and returns the colour that minimises this distance measure
  27.  *
  28.  */
  29.  
  30. extern bits map_scaled_rgb_to_16bpp_colour_accurate(
  31.                 rgbtupleout     *out,
  32.                 int             red,
  33.                 int             grn,
  34.                 int             blu);
  35.  
  36.  
  37.  
  38. /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  39.  *
  40.  * input: each intensity is nominally 16-bit value, but is first forced into range [0, 0xffff]
  41.  * returns: 16bpp colour number (%0bbb bbgg gggr rrrr)
  42.  * output: error in approximating colour, as a 16-bit scaled, ie (in_clipped - out*0xffff/0x1f)
  43.  *
  44.  */
  45.  
  46. extern bits map_scaled_rgb_to_16bpp_colour_quick(
  47.                 rgbtupleout     *out,
  48.                 int             red,
  49.                 int             green,
  50.                 int             blue);
  51.  
  52.  
  53.  
  54. #endif /* map16bpp_h */
  55.