home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilss / sprtools / h / process < prev    next >
Text File  |  1994-07-18  |  3KB  |  69 lines

  1. /************************************************************************
  2.  *                                                                      *
  3.  * process.h                                                            *
  4.  * =========                                                            *
  5.  *                                                                      *
  6.  * RISCOS sprite style bitmap processing library                        *
  7.  * Uses spr_info generic bitmap interface from sprite.c library         *
  8.  *                                                                      *
  9.  * Version 1.25 (03-May-1994)                                           *
  10.  *                                                                      *
  11.  * (C) 1993/1994 DEEJ Technology PLC                                    *
  12.  *                                                                      *
  13.  ************************************************************************/
  14.  
  15. #ifndef __process_h
  16. #define __process_h
  17.  
  18. #include "sprite.h"
  19. #include "colours.h"
  20.  
  21. /********************************* Structures ********************************/
  22.  
  23. typedef struct
  24. {
  25.     int        matrix[3][3];    /* 3 x 3 matrix of inensity mults  */
  26.     int        mul;        /* overall multiplier              */
  27.     int        div;        /* overall divisor                 */
  28.     int        add;        /* overall addition (-255 to 255)  */
  29.     int        diff;        /* difference filter   (0 to 255)  */
  30. } filter_str;
  31.  
  32. typedef struct                /* selects processing options       */
  33. {
  34.     spr_info_str    *in;        /* source sprite            */
  35.     spr_info_str    *out;        /* destination sprite            */
  36.     FILE        *outf;        /* handle of file for write line    */
  37.                     /* zero to make whole output sprite */
  38.  
  39.                                         /* pre-processing options           */
  40.     BOOL         nodither;    /* do not dither            */
  41.     BOOL         nointerp;    /* do not interpolate               */
  42.     BOOL         invert;    /* invert source                    */
  43.     BOOL         expand;    /* expand source            */
  44.         BOOL             gamma;         /* use gamma correction             */
  45.     BOOL         palette_opt;    /* optimise palette after preprocess*/
  46.         BOOL             filter;        /* filter image                     */
  47.  
  48.     struct                /* preprocessing data               */
  49.         {
  50.         float     gamma;        /* gamma correction value           */
  51.         filter_str     filter;    /* filter data                      */
  52.     } data;
  53. } process_str;
  54.  
  55.  
  56. /**************************** Function prototypes ****************************/
  57.  
  58. uint intensity(uint);
  59. void excess_rgb(pix_str*);
  60. void invert(spr_info_str*);
  61. void expand(spr_info_str*);
  62. void gamma_cr(spr_info_str*, float);
  63. void table_lookup(spr_info_str*, uchar*);
  64. void process(process_str*);
  65. pix_str pix_sum(spr_info_str*, int, int, int, int);
  66. void err_diff(pix_str*, pix_str*, int);
  67.  
  68. #endif
  69.