home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / toollib_2 / Examples / GFXView / Builds / h / jpeg_pic < prev    next >
Encoding:
Text File  |  1996-01-30  |  1.4 KB  |  54 lines

  1. /*** jpeg_pic.h ***/
  2. /* Routines for loading and displaying a jpeg
  3.  * (c) Paul Field 1995
  4.  * v1.00 - 9/10/95
  5.  * v1.01 - 24/11/95 - added 'clip' parameter to jpeg_pic_draw()
  6.  */
  7.  
  8. #ifndef os_H
  9. #include "os.h"
  10. #endif
  11.  
  12.  
  13. /* Opaque type */
  14. typedef struct jpeg_pic_str jpeg_pic;
  15.  
  16.  
  17.  
  18. bool jpeg_pic_supported(void);
  19.  /* Returns TRUE if JPEG pictures are supported.
  20.   * JPEG support is not available on all platforms
  21.   */
  22.  
  23.  
  24. jpeg_pic *jpeg_pic_create(const char *file_name);
  25.  /* Pre: file_name is a jpeg file
  26.   * Exceptions: exception_NO_MEMORY, os (file errors)
  27.   * Creates a jpeg_pic from the file 'file_name' and returns it
  28.   */
  29.  
  30. void jpeg_pic_destroy(jpeg_pic *pic);
  31.  /* Frees the memory associated with 'pic'
  32.   */
  33.  
  34. void jpeg_pic_draw(const jpeg_pic *pic, int origin_x, int origin_y, unsigned scale_percent, const os_box *clip);
  35.  /* Pre: pic != NULL
  36.   *      We're drawing in the current Wimp mode
  37.   * Draws the jpeg_pic with it's bottom left corner at (origin_x, origin_y)
  38.   * scaled by 'scale_percent'%
  39.   * 'clip' should be the current graphics window
  40.   */
  41.  
  42. void jpeg_pic_size(const jpeg_pic *pic, unsigned *width, unsigned *height);
  43.  /* Pre: pic != NULL
  44.   *      width != NULL
  45.   *      height != NULL
  46.   * Returns the width and height of the jpeg_pic in OS units
  47.   */
  48.  
  49. unsigned jpeg_pic_suggested_scale(const jpeg_pic *pic);
  50.  /* Pre: pic != NULL
  51.   * Returns the scale (as a percentage) at which the picture will be displayed
  52.   * at 1 dot per pixel (in square pixel modes)
  53.   */
  54.