Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vil_jpeg_decompressor.h

Go to the documentation of this file.
00001 // This is core/vil/file_formats/vil_jpeg_decompressor.h
00002 #ifndef vil_jpeg_decompressor_h_
00003 #define vil_jpeg_decompressor_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author fsm
00010 // \verbatim
00011 //  Modifications
00012 //     11 Oct 2002 Ian Scott - converted to vil
00013 //\endverbatim
00014 
00015 #include <vil/file_formats/vil_jpeglib.h>
00016 class vil_stream;
00017 
00018 class vil_jpeg_decompressor
00019 {
00020  public:
00021   struct jpeg_error_mgr         jerr;
00022   struct jpeg_decompress_struct jobj;
00023   vil_stream *stream;
00024 
00025   vil_jpeg_decompressor(vil_stream *s);
00026 
00027   // NB. does not delete the stream.
00028   ~vil_jpeg_decompressor();
00029 
00030   // Do *not* delete the return value. Leave it alone.
00031   // The return value is zero on failure.
00032   // It should cost nothing to read the same scanline twice in succession.
00033   JSAMPLE const *read_scanline(unsigned line);
00034 
00035  private:
00036   bool ready; // true if decompression has started but not finished.
00037   bool valid; // true if last scanline read was successful.
00038 
00039   // It's not worth the effort using JPEG to allocate the buffer using the
00040   // jobj.mem->alloc_sarray method, because it would have to be reallocated
00041   // after each call to jpeg_finish_decompress(). The symptom of not doing
00042   // so is a nasty heap corruption which only shows up later in unrelated
00043   // code.
00044   JSAMPLE *biffer;   // pointer to scanline buffer.
00045 };
00046 
00047 #endif // vil_jpeg_decompressor_h_

Generated on Thu Jan 10 14:39:59 2008 for core/vil by  doxygen 1.4.4