Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.9 KiB

  1. /* jpegapi.h -- header file for JPEG image compression interface.
  2. * Written by Ajai Sehgal
  3. * (c) Copyright Microsoft Corporation
  4. *
  5. * 08-27-1997 (kurtgeis) Removed dependency on Gromit/Fletcher funky data
  6. * types and includes.
  7. */
  8. #include "jinclude.h"
  9. #include "jpeglib.h"
  10. #include "jerror.h" /* get library error codes too */
  11. #ifndef __JPEGAPI_H__
  12. #define __JPEGAPI_H__
  13. // kurtgeis: Moved out of Fletcher code base. Pushed exception handling down
  14. // into the library, so that the actual calls could return HRESULTs.
  15. // Class to wrap a thrown HRESULT
  16. class THROWN
  17. {
  18. public:
  19. // Default constructor
  20. THROWN()
  21. {
  22. m_hr = S_OK;
  23. }
  24. // THROWN( HRESULT)
  25. //
  26. // Purpose:
  27. // Construct a throw object for an hresult.
  28. //
  29. THROWN( HRESULT hr )
  30. {
  31. m_hr = hr;
  32. }
  33. HRESULT Hr() { return m_hr; } // The HRESULT thrown
  34. private:
  35. HRESULT m_hr; // Associated HResult;
  36. };
  37. // Destroy the JPEG handle
  38. HRESULT DestroyJPEGCompressHeader(HANDLE hJpegC);
  39. HRESULT DestroyJPEGDecompressHeader(HANDLE hJpegD);
  40. // Takes the parameters for a tile write and creates a JPEG table for it
  41. HRESULT JPEGCompressHeader(BYTE *prgbJPEGBuf, UINT tuQuality, ULONG *pcbOut, HANDLE *phJpegC, J_COLOR_SPACE ColorSpace );
  42. HRESULT JPEGDecompressHeader(BYTE *prgbJPEGBuf, HANDLE *phJpegD, ULONG ulBufferSize );
  43. // Takes a raw RGBA image buffer and spits back a JPEG data stream.
  44. HRESULT JPEGFromRGBA(BYTE *prgbImage, BYTE *prgbJPEGBuf,UINT tuQuality, ULONG *pcbOut, HANDLE hJpegC,J_COLOR_SPACE ColorSpace, UINT nWidth, UINT nHeight );
  45. // Takes a JPEG data stream and spits back a raw RGBA image buffer.
  46. // iraklis's comment: the second argument is the RGBA buffer to be
  47. // loaded with the decompressed tile; we are
  48. // asserting that it is of the right size (i.e. sizeof (TIL))
  49. HRESULT RGBAFromJPEG(BYTE *prgbJPEG, BYTE *prgbImage, HANDLE hJpegD, ULONG ulBufferSize, BYTE bJPEGConversions, ULONG *pulReturnedNumChannels, UINT nWidth, UINT nHeight );
  50. #endif // __JPEGAPI_H__