00001 // This is mul/vil3d/vil3d_file_format.h 00002 #ifndef vil3d_file_format_h_ 00003 #define vil3d_file_format_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Manager for 3d image file loaders 00010 // \author Tim Cootes - Manchester 00011 00012 #include <vil3d/vil3d_image_view_base.h> 00013 #include <vil3d/vil3d_image_resource.h> 00014 00015 class vil3d_file_format 00016 { 00017 public: 00018 virtual ~vil3d_file_format() {} 00019 00020 //: Add a format reader to current list of those available 00021 // This function will take ownership of the passed object, and will 00022 // delete it when the program dies. 00023 static void add_format(vil3d_file_format* new_format); 00024 00025 //: Number of formats available (number added by add_format() 00026 static unsigned n_formats(); 00027 00028 //: Access to available format readers supplied by add_format 00029 static const vil3d_file_format& format(unsigned i); 00030 00031 //: Create an image_resource from an existing file. 00032 virtual vil3d_image_resource_sptr make_input_image(const char *filename)const =0; 00033 00034 //: Make a "generic_image" on which put_section may be applied. 00035 // The file may be opened immediately for writing so that a header can be written. 00036 virtual vil3d_image_resource_sptr make_output_image(const char* filename, 00037 unsigned ni, 00038 unsigned nj, 00039 unsigned nk, 00040 unsigned nplanes, 00041 enum vil_pixel_format) const =0; 00042 00043 //: default filename tag for this image. 00044 virtual const char *tag()const =0; 00045 }; 00046 00047 #endif