Go to the documentation of this file.00001
00002 #ifndef vil_ras_file_format_h_
00003 #define vil_ras_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 #include <vil/vil_image_resource.h>
00019 #include <vil/vil_file_format.h>
00020 #include <vil/vil_stream.h>
00021
00022 #include <vxl_config.h>
00023
00024 class vil_image_view_base;
00025
00026
00027
00028 class vil_ras_file_format : public vil_file_format
00029 {
00030 public:
00031 virtual char const* tag() const;
00032 virtual vil_image_resource_sptr make_input_image( vil_stream* vs );
00033 virtual vil_image_resource_sptr make_output_image(vil_stream* vs,
00034 unsigned ni,
00035 unsigned nj,
00036 unsigned nplanes,
00037 vil_pixel_format format);
00038 };
00039
00040
00041 class vil_ras_image : public vil_image_resource
00042 {
00043 vil_stream* vs_;
00044 vxl_uint_32 width_;
00045 vxl_uint_32 height_;
00046 unsigned components_;
00047 unsigned bits_per_component_;
00048
00049 vil_streampos start_of_data_;
00050
00051 vxl_uint_32 depth_;
00052 vxl_uint_32 length_;
00053 vxl_uint_32 type_;
00054 vxl_uint_32 map_type_;
00055 vxl_uint_32 map_length_;
00056 vxl_uint_8* col_map_;
00057
00058 vil_pixel_format format_;
00059
00060 bool read_header();
00061 bool write_header();
00062
00063 friend class vil_ras_file_format;
00064 public:
00065
00066 vil_ras_image(vil_stream* is);
00067 vil_ras_image(vil_stream* is,
00068 unsigned ni,
00069 unsigned nj,
00070 unsigned nplanes,
00071 vil_pixel_format format );
00072 virtual ~vil_ras_image();
00073
00074
00075
00076 virtual unsigned nplanes() const;
00077 virtual unsigned ni() const;
00078 virtual unsigned nj() const;
00079
00080 virtual vil_pixel_format pixel_format() const;
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 virtual vil_image_view_base_sptr get_copy_view(unsigned i0, unsigned ni,
00092 unsigned j0, unsigned nj) const;
00093
00094 virtual bool put_view(const vil_image_view_base& im, unsigned i0, unsigned j0);
00095
00096 char const* file_format() const;
00097 bool get_property(char const *tag, void *prop = 0) const;
00098 };
00099
00100 #endif // vil_ras_file_format_h_