00001 // This is oxl/oxp/JPEG_Decompressor.h 00002 #ifndef JPEG_Decompressor_h_ 00003 #define JPEG_Decompressor_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 // 00008 // .NAME JPEG_Decompressor - Simple interface to JPEG library 00009 // .LIBRARY oxp 00010 // .HEADER Oxford Package 00011 // .INCLUDE oxp/JPEG_Decompressor.h 00012 // .FILE JPEG_Decompressor.cxx 00013 // 00014 // .SECTION Description 00015 // JPEG_Decompressor is a simplified interface to the JPEG library. 00016 // Initialize using 00017 // JPEG_Decompressor jpeg_decompressor(some_ifstream); 00018 // and read rows using 00019 // char* row_ptr = (char*)jpeg_decompressor.GetNextScanLine(); 00020 // 00021 // If you need to read a sequence of concatenated JPEGS from a file, 00022 // you should keep the decompressor open, as it buffers its reads, 00023 // so the file pointer will not necessarily be pointing to the end 00024 // of the jpeg. 00025 // 00026 // .SECTION Author 00027 // Andrew W. Fitzgibbon, Oxford RRG, 30 Dec 98 00028 // 00029 //----------------------------------------------------------------------------- 00030 00031 #include <vcl_iosfwd.h> 00032 00033 struct JPEG_DecompressorPrivates; 00034 class JPEG_Decompressor 00035 { 00036 public: 00037 #if defined(VCL_SGI_CC) || defined(VCL_SUNPRO_CC) || (defined(VCL_GCC) && !defined(GNU_LIBSTDCXX_V3)) 00038 JPEG_Decompressor(vcl_ifstream& s); 00039 #endif 00040 JPEG_Decompressor(int fd); 00041 ~JPEG_Decompressor(); 00042 00043 int width(); 00044 int height(); 00045 int GetBitsPixel(); 00046 00047 void* GetNextScanLine(); 00048 00049 unsigned long GetFilePosition(); 00050 00051 void StartNextJPEG(); 00052 00053 private: 00054 JPEG_DecompressorPrivates* pd; 00055 void init(int fd); 00056 }; 00057 00058 #endif // JPEG_Decompressor_h_
1.5.1