00001
00002 #ifndef vil_jpeg_file_format_h_
00003 #define vil_jpeg_file_format_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <vil/vil_file_format.h>
00021 #include <vil/vil_image_resource.h>
00022
00023
00024 bool vil_jpeg_file_probe(vil_stream *vs);
00025
00026
00027 class vil_jpeg_file_format : public vil_file_format
00028 {
00029 public:
00030 virtual char const *tag() const;
00031 virtual vil_image_resource_sptr make_input_image(vil_stream *vs);
00032 virtual vil_image_resource_sptr make_output_image(vil_stream* vs,
00033 unsigned nx,
00034 unsigned ny,
00035 unsigned nplanes,
00036 enum vil_pixel_format);
00037 };
00038
00039
00040 class vil_jpeg_compressor;
00041 class vil_jpeg_decompressor;
00042
00043
00044 class vil_jpeg_image : public vil_image_resource
00045 {
00046 vil_jpeg_image(vil_stream *is);
00047 vil_jpeg_image (vil_stream* is, unsigned ni,
00048 unsigned nj, unsigned nplanes, vil_pixel_format format);
00049 ~vil_jpeg_image();
00050
00051
00052 virtual unsigned nplanes() const;
00053 virtual unsigned ni() const;
00054 virtual unsigned nj() const;
00055
00056 virtual enum vil_pixel_format pixel_format() const;
00057
00058
00059 char const *file_format() const;
00060
00061
00062
00063 virtual vil_image_view_base_sptr get_copy_view(unsigned i0, unsigned ni,
00064 unsigned j0, unsigned nj) const;
00065
00066
00067 virtual bool put_view(const vil_image_view_base& im, unsigned i0, unsigned j0);
00068
00069 bool get_property(char const *tag, void *prop = 0) const;
00070
00071 private:
00072 vil_jpeg_compressor *jc;
00073 vil_jpeg_decompressor *jd;
00074 vil_stream *stream;
00075 friend class vil_jpeg_file_format;
00076 };
00077
00078 #endif // vil_jpeg_file_format_h_