core/vil1/file_formats/vil1_jpeg.h

Go to the documentation of this file.
00001 // This is core/vil1/file_formats/vil1_jpeg.h
00002 #ifndef vil1_jpeg_file_format_h_
00003 #define vil1_jpeg_file_format_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Contains classes vil1_jpeg_file_format and vil1_jpeg_generic_image
00010 // \author    fsm
00011 // \date 17 Feb 2000
00012 //
00013 // Adapted from geoff's code in ImageClasses/JPEGImage.*
00014 //
00015 // \verbatim
00016 //  Modifications
00017 //   3 October 2001 Peter Vanroose - Implemented get_property("top_row_first")
00018 //\endverbatim
00019 
00020 #include <vil1/vil1_file_format.h>
00021 #include <vil1/vil1_image_impl.h>
00022 
00023 // seeks to 0, then checks for magic number. returns true if found.
00024 bool vil1_jpeg_file_probe(vil1_stream *vs);
00025 
00026 //: Loader for JPEG files
00027 class vil1_jpeg_file_format : public vil1_file_format
00028 {
00029  public:
00030   virtual char const *tag() const;
00031   virtual vil1_image_impl *make_input_image(vil1_stream *vs);
00032   virtual vil1_image_impl *make_output_image(vil1_stream *vs,
00033                                              int planes,
00034                                              int width,
00035                                              int height,
00036                                              int components,
00037                                              int bits_per_component,
00038                                              vil1_component_format format);
00039 };
00040 
00041 //
00042 class vil1_jpeg_compressor;
00043 class vil1_jpeg_decompressor;
00044 
00045 //: generic_image implementation for JPEG files
00046 class vil1_jpeg_generic_image : public vil1_image_impl
00047 {
00048   vil1_jpeg_generic_image(vil1_stream *is);
00049   vil1_jpeg_generic_image(vil1_stream *is,
00050                           int planes,
00051                           int width,
00052                           int height,
00053                           int components,
00054                           int bits_per_component,
00055                           vil1_component_format format);
00056   ~vil1_jpeg_generic_image();
00057 
00058   //: implementation of virtual interface.
00059   int planes() const;
00060   int width() const;
00061   int height() const;
00062   int components() const;
00063   int bits_per_component() const;
00064   vil1_component_format component_format() const;
00065   char const *file_format() const; // returns "jpeg"
00066   bool get_property(char const *tag, void *prop = 0) const;
00067   vil1_image get_plane(unsigned int p) const;
00068   bool get_section(void       *buf, int x0, int y0, int w, int h) const;
00069   bool put_section(void const *buf, int x0, int y0, int w, int h);
00070 
00071  private:
00072   vil1_jpeg_compressor   *jc;
00073   vil1_jpeg_decompressor *jd;
00074   vil1_stream *stream;
00075   friend class vil1_jpeg_file_format;
00076 };
00077 
00078 #endif // vil1_jpeg_file_format_h_

Generated on Sat Nov 22 05:08:28 2008 for core/vil1 by  doxygen 1.5.1