home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / graphics / sprtools_1 / h / process < prev    next >
Text File  |  1999-01-10  |  3KB  |  78 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                          /* source image cropping */
  33. {
  34.         int             left;
  35.         int             top;
  36.         int             right;
  37.         int             bottom;
  38. } crop_str;
  39.  
  40. typedef struct                /* selects processing options       */
  41. {
  42.     spr_info_str    *in;        /* source sprite            */
  43.     spr_info_str    *out;        /* destination sprite            */
  44.     FILE        *outf;        /* handle of file for write line    */
  45.                     /* zero to make whole output sprite */
  46.  
  47.                                         /* pre-processing options           */
  48.     BOOL         nodither;    /* do not dither            */
  49.     BOOL         nointerp;    /* do not interpolate               */
  50.     BOOL         invert;    /* invert source                    */
  51.     BOOL         expand;    /* expand source            */
  52.         BOOL             gamma;         /* use gamma correction             */
  53.     BOOL         palette_opt;    /* optimise palette after preprocess*/
  54.         BOOL             filter;        /* filter image                     */
  55.         crop_str         crop;          /* cropping data                    */
  56.  
  57.     struct                /* preprocessing data               */
  58.         {
  59.         float     gamma;        /* gamma correction value           */
  60.         filter_str     filter;    /* filter data                      */
  61.     } data;
  62. } process_str;
  63.  
  64.  
  65. /**************************** Function prototypes ****************************/
  66.  
  67. uint intensity(uint);
  68. void excess_rgb(pix_str*);
  69. void invert(spr_info_str*);
  70. void expand(spr_info_str*);
  71. void gamma_cr(spr_info_str*, float);
  72. void table_lookup(spr_info_str*, uchar*);
  73. void process(process_str*);
  74. pix_str pix_sum(spr_info_str*, int, int, int, int);
  75. void err_diff(pix_str*, pix_str*, int);
  76.  
  77. #endif
  78.