home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / User / h / compressjp < prev    next >
Encoding:
Text File  |  1995-07-24  |  3.6 KB  |  133 lines

  1. #ifndef compressjpeg_H
  2. #define compressjpeg_H
  3.  
  4. /* C header file for CompressJPEG
  5.  * written by DefMod (Jul 24 1995) on Mon Jul 24 11:29:26 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef os_H
  14. #include "os.h"
  15. #endif
  16.  
  17. #ifndef jpeg_H
  18. #include "jpeg.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  CompressJPEG_Start
  25. #define CompressJPEG_Start                      0x4A500
  26. #undef  XCompressJPEG_Start
  27. #define XCompressJPEG_Start                     0x6A500
  28. #undef  CompressJPEG_WriteLine
  29. #define CompressJPEG_WriteLine                  0x4A501
  30. #undef  XCompressJPEG_WriteLine
  31. #define XCompressJPEG_WriteLine                 0x6A501
  32. #undef  CompressJPEG_Finish
  33. #define CompressJPEG_Finish                     0x4A502
  34. #undef  XCompressJPEG_Finish
  35. #define XCompressJPEG_Finish                    0x6A502
  36.  
  37. /************************************
  38.  * Structure and union declarations *
  39.  ************************************/
  40. typedef struct compressjpeg_tag_                *compressjpeg_tag;
  41. typedef struct compressjpeg_parameters          compressjpeg_parameters;
  42.  
  43. /********************
  44.  * Type definitions *
  45.  ********************/
  46. struct compressjpeg_parameters
  47.    {  int width;
  48.       int height;
  49.       int quality;
  50.       int bytes_per_pixel;
  51.       int xdpi;
  52.       int ydpi;
  53.    };
  54.  
  55. /*************************
  56.  * Function declarations *
  57.  *************************/
  58.  
  59. #ifdef __cplusplus
  60.    extern "C" {
  61. #endif
  62.  
  63. /* ------------------------------------------------------------------------
  64.  * Function:      compressjpeg_start()
  65.  *
  66.  * Description:   Starts the JPEG compression process and sets up various
  67.  *                parameters
  68.  *
  69.  * Input:         image - value of R0 on entry
  70.  *                image_size - value of R1 on entry
  71.  *                parameters - value of R2 on entry
  72.  *                workspace - value of R3 on entry
  73.  *                workspace_size - value of R4 on entry
  74.  *
  75.  * Output:        tag - value of R0 on exit (X version only)
  76.  *
  77.  * Returns:       R0 (non-X version only)
  78.  *
  79.  * Other notes:   Calls SWI 0x4A500.
  80.  */
  81.  
  82. extern os_error *xcompressjpeg_start (jpeg_image const *image,
  83.       int image_size,
  84.       compressjpeg_parameters const *parameters,
  85.       void *workspace,
  86.       int workspace_size,
  87.       compressjpeg_tag *tag);
  88. extern compressjpeg_tag compressjpeg_start (jpeg_image const *image,
  89.       int image_size,
  90.       compressjpeg_parameters const *parameters,
  91.       void *workspace,
  92.       int workspace_size);
  93.  
  94. /* ------------------------------------------------------------------------
  95.  * Function:      compressjpeg_write_line()
  96.  *
  97.  * Description:   Compresses one row of source pixels into the JPEG buffer
  98.  *
  99.  * Input:         tag - value of R0 on entry
  100.  *                pixels - value of R1 on entry
  101.  *
  102.  * Other notes:   Calls SWI 0x4A501.
  103.  */
  104.  
  105. extern os_error *xcompressjpeg_write_line (compressjpeg_tag tag,
  106.       byte *pixels);
  107. __swi (0x4A501) void compressjpeg_write_line (compressjpeg_tag tag,
  108.       byte *pixels);
  109.  
  110. /* ------------------------------------------------------------------------
  111.  * Function:      compressjpeg_finish()
  112.  *
  113.  * Description:   Tidies up JPEG buffer
  114.  *
  115.  * Input:         tag - value of R0 on entry
  116.  *
  117.  * Output:        image_size - value of R0 on exit (X version only)
  118.  *
  119.  * Returns:       R0 (non-X version only)
  120.  *
  121.  * Other notes:   Calls SWI 0x4A502.
  122.  */
  123.  
  124. extern os_error *xcompressjpeg_finish (compressjpeg_tag tag,
  125.       int *image_size);
  126. __swi (0x4A502) int compressjpeg_finish (compressjpeg_tag tag);
  127.  
  128. #ifdef __cplusplus
  129.    }
  130. #endif
  131.  
  132. #endif
  133.