00001 // This is core/vil1/vil1_file_format.h 00002 #ifndef vil1_file_format_h_ 00003 #define vil1_file_format_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Base class for image formats 00010 // \author awf 00011 00012 #include <vil1/vil1_fwd.h> 00013 #include <vil1/vil1_image_impl.h> 00014 00015 //: Base class for image formats. 00016 // There is one derived class for each handled file format in the 00017 // directory file_formats. E.g. vil1/file_formats/vil1_pnm.h etc 00018 class vil1_file_format 00019 { 00020 public: 00021 virtual ~vil1_file_format(); 00022 00023 //: Return a character string which uniquely identifies this format. 00024 //E.g. "pnm", "jpeg", etc. 00025 virtual char const* tag() const = 0; 00026 00027 //: Attempt to make a generic_image which will read from vil1_stream vs. 00028 // Reads enough of vs to determine if it's this format, and if not, returns 0. 00029 // If it is, returns a subclass of vil1_image_impl on which get_section may 00030 // be applied. 00031 virtual vil1_image_impl* make_input_image(vil1_stream* vs) = 0; 00032 00033 //: Make a "generic_image" on which put_section may be applied. 00034 // The stream vs is assumed to be open for writing, as an image header may be 00035 // written to it immediately. 00036 // The width/height etc are explicitly specified, so that file_format implementors 00037 // know what they need to do... 00038 virtual vil1_image_impl* make_output_image(vil1_stream* vs, 00039 int planes, 00040 int width, 00041 int height, 00042 int components, 00043 int bits_per_component, 00044 enum vil1_component_format) = 0; 00045 00046 public: 00047 static vil1_file_format** all(); 00048 }; 00049 00050 #endif // vil1_file_format_h_
1.5.1