home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Libraries / JPEG Library / JPEGUtilities.h < prev   
Encoding:
Text File  |  1994-07-12  |  4.0 KB  |  94 lines  |  [TEXT/MPCC]

  1. //=====================================================================================
  2. // JPEGUtilities.h -- written by Aaron Giles
  3. // Last update: 7/7/94
  4. //=====================================================================================
  5. // A source code library for performing very simple operations (drawing, embedding into
  6. // PICTs, and extracting from PICTs) on JPEG-compressed images using QuickTime.
  7. //=====================================================================================
  8. // This code has been successfully compiled under Metrowerks C/C++ 1.0a4, under
  9. // THINK C 7.0, and under MPW C 3.3.
  10. //=====================================================================================
  11. // If you find any bugs in this source code, please email me and I will attempt to fix
  12. // them.  If you have any additions/modifications that you think would be generally
  13. // useful, email those to me as well, and I will consider incorporating them into the
  14. // next release.  My email address is giles@med.cornell.edu.
  15. //=====================================================================================
  16. // This source code is copyright © 1994, Aaron Giles.  Permission to use this code in
  17. // your product is freely granted, provided that you credit me appropriately in your
  18. // application's About box/credits *and* documentation.  If you ship an application
  19. // which uses this code, I would also like to request that you provide me with one
  20. // complimentary copy of the application.
  21. //=====================================================================================
  22.  
  23. #ifndef __JPEGUTILITIES__
  24. #define __JPEGUTILITIES__
  25.  
  26. //=====================================================================================
  27. // Generic includes for Macintosh headers
  28. //=====================================================================================
  29.  
  30. #include <ImageCompression.h>
  31. #include <Memory.h>
  32. #include <QuickDraw.h>
  33. #include <Types.h>
  34.  
  35. //=====================================================================================
  36. // Public interface function prototypes
  37. //=====================================================================================
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. // GetJPEGBounds -- returns the bounding rectangle for the JPEG image in theHandle
  44. extern OSErr GetJPEGBounds(Handle theHandle, Rect *theBounds);
  45.  
  46. // DrawJPEG -- draws all or part of the JPEG image in theHandle to the current port
  47. extern OSErr DrawJPEG(Handle theHandle, Rect *srcRect, Rect *dstRect, short tMode); 
  48.  
  49. // UnwrapJPEG -- returns a handle to the first JPEG image from the PICT in srcHandle
  50. extern Handle UnwrapJPEG(PicHandle srcHandle);
  51.  
  52. // WrapJPEG -- creates a JPEG-compressed PICT from the JPEG in srcHandle
  53. extern PicHandle WrapJPEG(Handle srcHandle);
  54.  
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58.  
  59. //=====================================================================================
  60. // Kludges to make this code work for non-Universal Header types.  Note that we rely
  61. // on USESROUTINEDESCRIPTORS being defined always when using the Universal Headers.
  62. // This seems to be a good assumption -- until Apple changes things again. :-)
  63. //=====================================================================================
  64.  
  65. #ifndef USESROUTINEDESCRIPTORS
  66. typedef Ptr UniversalProcPtr;
  67. typedef Ptr StdPixUPP;
  68. typedef Ptr QDBitsUPP;
  69. typedef Ptr QDTextUPP;
  70. typedef Ptr QDLineUPP;
  71. typedef Ptr QDRectUPP;
  72. typedef Ptr QDRRectUPP;
  73. typedef Ptr QDOvalUPP;
  74. typedef Ptr QDArcUPP;
  75. typedef Ptr QDPolyUPP;
  76. typedef Ptr QDRgnUPP;
  77. #define NewStdPixProc(proc) ((Ptr)proc)
  78. #define NewQDBitsProc(proc) ((Ptr)proc)
  79. #define NewQDTextProc(proc) ((Ptr)proc)
  80. #define NewQDLineProc(proc) ((Ptr)proc)
  81. #define NewQDRectProc(proc) ((Ptr)proc)
  82. #define NewQDRRectProc(proc) ((Ptr)proc)
  83. #define NewQDOvalProc(proc) ((Ptr)proc)
  84. #define NewQDArcProc(proc) ((Ptr)proc)
  85. #define NewQDPolyProc(proc) ((Ptr)proc)
  86. #define NewQDRgnProc(proc) ((Ptr)proc)
  87. typedef ProgressProcRecord ICMProgressProcRecord;
  88. typedef ProgressProcRecordPtr ICMProgressProcRecordPtr;
  89. typedef DataProcRecord ICMDataProcRecord;
  90. typedef DataProcRecordPtr ICMDataProcRecordPtr;
  91. #endif
  92.  
  93. #endif
  94.