vil_jpeg_decompressor.h
Go to the documentation of this file.
1 // This is core/vil/file_formats/vil_jpeg_decompressor.h
2 #ifndef vil_jpeg_decompressor_h_
3 #define vil_jpeg_decompressor_h_
4 //:
5 // \file
6 // \author fsm
7 // \verbatim
8 // Modifications
9 // 11 Oct 2002 Ian Scott - converted to vil
10 //\endverbatim
11 
13 class vil_stream;
14 
16 {
17  public:
18  struct jpeg_error_mgr jerr;
19  struct jpeg_decompress_struct jobj;
21 
23 
24  //:
25  // NB. does not delete the stream.
27 
28  //:
29  // Do \e not delete the return value. Leave it alone.
30  // The return value is zero on failure.
31  // It should cost nothing to read the same scanline twice in succession.
32  JSAMPLE const *read_scanline(unsigned line);
33 
34  private:
35  bool ready; // true if decompression has started but not finished.
36  bool valid; // true if last scanline read was successful.
37 
38  // It's not worth the effort using JPEG to allocate the buffer using the
39  // jobj.mem->alloc_sarray method, because it would have to be reallocated
40  // after each call to jpeg_finish_decompress(). The symptom of not doing
41  // so is a nasty heap corruption which only shows up later in unrelated
42  // code.
43  JSAMPLE *biffer; // pointer to scanline buffer.
44 };
45 
46 #endif // vil_jpeg_decompressor_h_
vil_jpeg_decompressor(vil_stream *s)
using jpeg decompressor objects :.
JSAMPLE const * read_scanline(unsigned line)
Do not delete the return value.
Stream interface for VIL image loaders.
Definition: vil_stream.h:21
struct jpeg_decompress_struct jobj
struct jpeg_error_mgr jerr
Stuff for jpeg I/O.