home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / User / h / jpeg < prev    next >
Encoding:
Text File  |  1995-08-21  |  9.0 KB  |  295 lines

  1. #ifndef jpeg_H
  2. #define jpeg_H
  3.  
  4. /* C header file for JPEG
  5.  * written by DefMod (Jul 24 1995) on Mon Aug 21 16:13:40 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. /**********************************
  18.  * SWI names and SWI reason codes *
  19.  **********************************/
  20. #undef  JPEG_Info
  21. #define JPEG_Info                               0x49980
  22. #undef  XJPEG_Info
  23. #define XJPEG_Info                              0x69980
  24. #undef  JPEGInfo_Dimensions
  25. #define JPEGInfo_Dimensions                     0x1
  26. #undef  JPEG_FileInfo
  27. #define JPEG_FileInfo                           0x49981
  28. #undef  XJPEG_FileInfo
  29. #define XJPEG_FileInfo                          0x69981
  30. #undef  JPEGFileInfo_Dimensions
  31. #define JPEGFileInfo_Dimensions                 0x1
  32. #undef  JPEG_PlotScaled
  33. #define JPEG_PlotScaled                         0x49982
  34. #undef  XJPEG_PlotScaled
  35. #define XJPEG_PlotScaled                        0x69982
  36. #undef  JPEG_PlotFileScaled
  37. #define JPEG_PlotFileScaled                     0x49983
  38. #undef  XJPEG_PlotFileScaled
  39. #define XJPEG_PlotFileScaled                    0x69983
  40. #undef  JPEG_PlotTransformed
  41. #define JPEG_PlotTransformed                    0x49984
  42. #undef  XJPEG_PlotTransformed
  43. #define XJPEG_PlotTransformed                   0x69984
  44. #undef  JPEG_PlotFileTransformed
  45. #define JPEG_PlotFileTransformed                0x49985
  46. #undef  XJPEG_PlotFileTransformed
  47. #define XJPEG_PlotFileTransformed               0x69985
  48. #undef  JPEG_PDriverIntercept
  49. #define JPEG_PDriverIntercept                   0x49986
  50. #undef  XJPEG_PDriverIntercept
  51. #define XJPEG_PDriverIntercept                  0x69986
  52.  
  53. /************************************
  54.  * Structure and union declarations *
  55.  ************************************/
  56. typedef struct jpeg_image                       jpeg_image;
  57.  
  58. /********************
  59.  * Type definitions *
  60.  ********************/
  61. typedef bits jpeg_info_flags;
  62.  
  63. typedef bits jpeg_scale_flags;
  64.  
  65. typedef bits jpeg_transform_flags;
  66.  
  67. struct jpeg_image
  68.    {  byte i [UNKNOWN];
  69.    };
  70.  
  71. #define jpeg_IMAGE(N) \
  72.    struct \
  73.       {  byte i [N]; \
  74.       }
  75.  
  76. #define jpeg_SIZEOF_IMAGE(N) \
  77.    ((N)*sizeof ((jpeg_image *) NULL)->i)
  78.  
  79. typedef bits jpeg_print_flags;
  80.  
  81. /************************
  82.  * Constant definitions *
  83.  ************************/
  84. #define jpeg_INFO_MONOCHROME                    ((jpeg_info_flags) 0x1u)
  85. #define jpeg_INFO_NO_TRFM                       ((jpeg_info_flags) 0x2u)
  86. #define jpeg_INFO_DPI_UNKNOWN                   ((jpeg_info_flags) 0x4u)
  87. #define jpeg_SCALE_DITHERED                     ((jpeg_scale_flags) 0x1u)
  88. #define jpeg_SCALE_ERROR_DIFFUSED               ((jpeg_scale_flags) 0x2u)
  89. #define jpeg_DESTINATION_COORDS                 ((jpeg_transform_flags) 0x1u)
  90. #define jpeg_TRANSFORM_DITHERED                 ((jpeg_transform_flags) 0x2u)
  91. #define jpeg_TRANSFORM_ERROR_DIFFUSED           ((jpeg_transform_flags) 0x4u)
  92. #define jpeg_FILE_TYPE                          0xC85u
  93. #define jpeg_PRINT_PLOTTING                     ((jpeg_print_flags) 0x1u)
  94. #define jpeg_PRINT_USING_TRANS_TAB              ((jpeg_print_flags) 0x2u)
  95.  
  96. /*************************
  97.  * Function declarations *
  98.  *************************/
  99.  
  100. #ifdef __cplusplus
  101.    extern "C" {
  102. #endif
  103.  
  104. /* ------------------------------------------------------------------------
  105.  * Function:      jpeginfo_dimensions()
  106.  *
  107.  * Description:   Returns the dimensions of a JPEG image in memory - RISC O
  108.  *                S 3.6+
  109.  *
  110.  * Input:         image - value of R1 on entry
  111.  *                size - value of R2 on entry
  112.  *
  113.  * Output:        info_flags - value of R0 on exit (X version only)
  114.  *                width - value of R2 on exit
  115.  *                height - value of R3 on exit
  116.  *                xdpi - value of R4 on exit
  117.  *                ydpi - value of R5 on exit
  118.  *                workspace_size - value of R6 on exit
  119.  *
  120.  * Returns:       R0 (non-X version only)
  121.  *
  122.  * Other notes:   Calls SWI 0x49980 with R0 = 0x1.
  123.  */
  124.  
  125. extern os_error *xjpeginfo_dimensions (jpeg_image const *image,
  126.       int size,
  127.       jpeg_info_flags *info_flags,
  128.       int *width,
  129.       int *height,
  130.       int *xdpi,
  131.       int *ydpi,
  132.       int *workspace_size);
  133. extern jpeg_info_flags jpeginfo_dimensions (jpeg_image const *image,
  134.       int size,
  135.       int *width,
  136.       int *height,
  137.       int *xdpi,
  138.       int *ydpi,
  139.       int *workspace_size);
  140.  
  141. /* ------------------------------------------------------------------------
  142.  * Function:      jpegfileinfo_dimensions()
  143.  *
  144.  * Description:   Returns the dimensions of a JPEG image in a file - RISC O
  145.  *                S 3.6+
  146.  *
  147.  * Input:         file_name - value of R1 on entry
  148.  *
  149.  * Output:        info_flags - value of R0 on exit (X version only)
  150.  *                width - value of R2 on exit
  151.  *                height - value of R3 on exit
  152.  *                xdpi - value of R4 on exit
  153.  *                ydpi - value of R5 on exit
  154.  *                workspace_size - value of R6 on exit
  155.  *
  156.  * Returns:       R0 (non-X version only)
  157.  *
  158.  * Other notes:   Calls SWI 0x49981 with R0 = 0x1.
  159.  */
  160.  
  161. extern os_error *xjpegfileinfo_dimensions (char const *file_name,
  162.       jpeg_info_flags *info_flags,
  163.       int *width,
  164.       int *height,
  165.       int *xdpi,
  166.       int *ydpi,
  167.       int *workspace_size);
  168. extern jpeg_info_flags jpegfileinfo_dimensions (char const *file_name,
  169.       int *width,
  170.       int *height,
  171.       int *xdpi,
  172.       int *ydpi,
  173.       int *workspace_size);
  174.  
  175. /* ------------------------------------------------------------------------
  176.  * Function:      jpeg_plot_scaled()
  177.  *
  178.  * Description:   Plots a JPEG image from memory - RISC O S 3.6+
  179.  *
  180.  * Input:         image - value of R0 on entry
  181.  *                x - value of R1 on entry
  182.  *                y - value of R2 on entry
  183.  *                factors - value of R3 on entry
  184.  *                size - value of R4 on entry
  185.  *                flags - value of R5 on entry
  186.  *
  187.  * Other notes:   Calls SWI 0x49982.
  188.  */
  189.  
  190. extern os_error *xjpeg_plot_scaled (jpeg_image const *image,
  191.       int x,
  192.       int y,
  193.       os_factors const *factors,
  194.       int size,
  195.       jpeg_scale_flags flags);
  196. extern void jpeg_plot_scaled (jpeg_image const *image,
  197.       int x,
  198.       int y,
  199.       os_factors const *factors,
  200.       int size,
  201.       jpeg_scale_flags flags);
  202.  
  203. /* ------------------------------------------------------------------------
  204.  * Function:      jpeg_plot_file_scaled()
  205.  *
  206.  * Description:   Plots a JPEG image from a file - RISC O S 3.6+
  207.  *
  208.  * Input:         file_name - value of R0 on entry
  209.  *                x - value of R1 on entry
  210.  *                y - value of R2 on entry
  211.  *                factors - value of R3 on entry
  212.  *                flags - value of R4 on entry
  213.  *
  214.  * Other notes:   Calls SWI 0x49983.
  215.  */
  216.  
  217. extern os_error *xjpeg_plot_file_scaled (char const *file_name,
  218.       int x,
  219.       int y,
  220.       os_factors const *factors,
  221.       jpeg_scale_flags flags);
  222. extern void jpeg_plot_file_scaled (char const *file_name,
  223.       int x,
  224.       int y,
  225.       os_factors const *factors,
  226.       jpeg_scale_flags flags);
  227.  
  228. /* ------------------------------------------------------------------------
  229.  * Function:      jpeg_plot_transformed()
  230.  *
  231.  * Description:   Plots a JPEG image from memory using a transformation
  232.  *                matrix - RISC O S 3.6+
  233.  *
  234.  * Input:         image - value of R0 on entry
  235.  *                flags - value of R1 on entry
  236.  *                trfm_or_rect - value of R2 on entry
  237.  *                size - value of R3 on entry
  238.  *
  239.  * Other notes:   Calls SWI 0x49984.
  240.  */
  241.  
  242. extern os_error *xjpeg_plot_transformed (jpeg_image const *image,
  243.       jpeg_transform_flags flags,
  244.       os_trfm const *trfm_or_rect,
  245.       int size);
  246. __swi (0x49984) void jpeg_plot_transformed (jpeg_image const *image,
  247.       jpeg_transform_flags flags,
  248.       os_trfm const *trfm_or_rect,
  249.       int size);
  250.  
  251. /* ------------------------------------------------------------------------
  252.  * Function:      jpeg_plot_file_transformed()
  253.  *
  254.  * Description:   Plots a JPEG image from a file using a transformation
  255.  *                matrix - RISC O S 3.6+
  256.  *
  257.  * Input:         file_name - value of R0 on entry
  258.  *                flags - value of R1 on entry
  259.  *                trfm_or_rect - value of R2 on entry
  260.  *
  261.  * Other notes:   Calls SWI 0x49985.
  262.  */
  263.  
  264. extern os_error *xjpeg_plot_file_transformed (char const *file_name,
  265.       jpeg_transform_flags flags,
  266.       os_trfm const *trfm_or_rect);
  267. __swi (0x49985) void jpeg_plot_file_transformed (char const *file_name,
  268.       jpeg_transform_flags flags,
  269.       os_trfm const *trfm_or_rect);
  270.  
  271. /* ------------------------------------------------------------------------
  272.  * Function:      jpeg_pdriver_intercept()
  273.  *
  274.  * Description:   Requests that JPEG calls are passed to the printer
  275.  *                drivers - for internal use only
  276.  *
  277.  * Input:         flags - value of R0 on entry
  278.  *
  279.  * Output:        flags_out - value of R0 on exit (X version only)
  280.  *
  281.  * Returns:       R0 (non-X version only)
  282.  *
  283.  * Other notes:   Calls SWI 0x49986.
  284.  */
  285.  
  286. extern os_error *xjpeg_pdriver_intercept (jpeg_print_flags flags,
  287.       jpeg_print_flags *flags_out);
  288. __swi (0x49986) jpeg_print_flags jpeg_pdriver_intercept (jpeg_print_flags flags);
  289.  
  290. #ifdef __cplusplus
  291.    }
  292. #endif
  293.  
  294. #endif
  295.