00001
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
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <vil1/vil1_file_format.h>
00021 #include <vil1/vil1_image_impl.h>
00022
00023
00024 bool vil1_jpeg_file_probe(vil1_stream *vs);
00025
00026
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
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
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;
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_