Go to the documentation of this file.00001
00002 #ifndef vil_mit_file_format_h_
00003 #define vil_mit_file_format_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <vil/vil_file_format.h>
00024 #include <vil/vil_image_resource.h>
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class vil_mit_file_format : public vil_file_format
00038 {
00039 public:
00040 virtual char const* tag() const;
00041 virtual vil_image_resource_sptr make_input_image(vil_stream* vs);
00042 virtual vil_image_resource_sptr make_output_image(vil_stream* vs,
00043 unsigned int ni, unsigned int nj, unsigned int nplanes,
00044 vil_pixel_format format);
00045 };
00046
00047
00048 class vil_mit_image : public vil_image_resource
00049 {
00050 vil_stream* is_;
00051 unsigned int ni_;
00052 unsigned int nj_;
00053 unsigned int components_;
00054 unsigned int type_;
00055 enum vil_pixel_format format_;
00056
00057 bool read_header();
00058 bool write_header();
00059
00060 friend class vil_mit_file_format;
00061 public:
00062
00063 vil_mit_image(vil_stream* is);
00064 vil_mit_image(vil_stream* is,
00065 unsigned int ni, unsigned int nj, unsigned int nplanes,
00066 vil_pixel_format format);
00067 ~vil_mit_image();
00068
00069
00070 virtual unsigned int ni() const { return ni_; }
00071 virtual unsigned int nj() const { return nj_; }
00072 virtual unsigned int nplanes() const { return components_; }
00073
00074 unsigned int bytes_per_pixel() const { return vil_pixel_format_sizeof_components(format_); }
00075
00076 virtual enum vil_pixel_format pixel_format() const { return format_; }
00077
00078
00079 virtual vil_image_view_base_sptr get_copy_view(unsigned int x0, unsigned int ni, unsigned int y0, unsigned int nj) const;
00080
00081 virtual bool put_view(vil_image_view_base const& buf, unsigned int x0, unsigned int y0);
00082
00083 char const* file_format() const;
00084 bool get_property(char const *tag, void *prop = 0) const;
00085 };
00086
00087 #endif // vil_mit_file_format_h_