Go to the documentation of this file.00001
00002 #ifndef vil_iris_file_format_h_
00003 #define vil_iris_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
00021
00022 #include <vil/vil_file_format.h>
00023 #include <vil/vil_image_resource.h>
00024 #include <vil/vil_stream.h>
00025
00026
00027 class vil_iris_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 int ni, unsigned int nj, unsigned int planes,
00034 vil_pixel_format format);
00035 };
00036
00037
00038 class vil_iris_generic_image : public vil_image_resource
00039 {
00040 unsigned long *starttab_;
00041 unsigned long *lengthtab_;
00042
00043 bool read_header();
00044 bool write_header();
00045
00046 friend class vil_iris_file_format;
00047 public:
00048
00049 vil_iris_generic_image(vil_stream* is, char const* imagename = "");
00050 vil_iris_generic_image(vil_stream* is,
00051 unsigned int ni, unsigned int nj, unsigned int planes,
00052 vil_pixel_format format);
00053 ~vil_iris_generic_image();
00054
00055
00056 virtual unsigned int ni() const { return ni_; }
00057 virtual unsigned int nj() const { return nj_; }
00058 virtual unsigned int nplanes() const { return nplanes_; }
00059
00060 virtual enum vil_pixel_format pixel_format() const { return format_; }
00061
00062 virtual vil_image_view_base_sptr get_copy_view( unsigned int x0, unsigned int ni, unsigned int y0, unsigned int nj) const;
00063 virtual bool put_view( vil_image_view_base const& buf, unsigned int x0, unsigned int y0);
00064
00065 char const* file_format() const;
00066 bool get_property(char const *tag, void *prop = 0) const;
00067
00068 protected:
00069 vil_stream* is_;
00070
00071 int magic_;
00072
00073 unsigned int ni_;
00074 unsigned int nj_;
00075 unsigned int nplanes_;
00076 enum vil_pixel_format format_;
00077
00078 int pixmin_;
00079 int pixmax_;
00080 int storage_;
00081 int dimension_;
00082 int colormap_;
00083 char imagename_[81];
00084 vil_streampos start_of_data_;
00085
00086 bool read_offset_tables();
00087
00088
00089 vil_image_view_base_sptr get_section_rle( unsigned int x0, unsigned int ni, unsigned int y0, unsigned int nj) const;
00090
00091
00092 vil_image_view_base_sptr get_section_verbatim( unsigned int x0, unsigned int ni, unsigned int y0, unsigned int nj) const;
00093 };
00094
00095 #endif // vil_iris_file_format_h_