15 #ifndef PNMFILETYPEIMG_H 16 #define PNMFILETYPEIMG_H 18 #include "pandabase.h" 22 #include "pnmFileType.h" 23 #include "pnmReader.h" 24 #include "pnmWriter.h" 30 class EXPCL_PANDA_PNMIMAGETYPES PNMFileTypeIMG :
public PNMFileType {
34 virtual string get_name()
const;
41 const string &magic_number =
string());
47 Reader(
PNMFileType *type, istream *file,
bool owns_file,
string magic_number);
49 virtual bool supports_read_row()
const;
50 virtual bool read_row(
xel *array, xelval *alpha,
int x_size,
int y_size);
55 Writer(
PNMFileType *type, ostream *file,
bool owns_file);
57 virtual bool supports_write_row()
const;
58 virtual bool write_header();
59 virtual bool write_row(
xel *array, xelval *alpha);
65 static void register_with_read_factory();
74 static void init_type() {
75 PNMFileType::init_type();
76 register_type(_type_handle,
"PNMFileTypeIMG",
77 PNMFileType::get_class_type());
80 return get_class_type();
82 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
virtual string get_extension(int n) const
Returns the nth possible filename extension associated with this particular file type, without a leading dot.
virtual PNMWriter * make_writer(ostream *file, bool owns_file=true)
Allocates and returns a new PNMWriter suitable for reading from this file type, if possible...
Base class for objects that can be written to and read from Bam files.
This is the base class of a family of classes that represent particular image file types that PNMImag...
virtual PNMReader * make_reader(istream *file, bool owns_file=true, const string &magic_number=string())
Allocates and returns a new PNMReader suitable for reading from this file type, if possible...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is an abstract base class that defines the interface for reading image files of various types...
This is an abstract base class that defines the interface for writing image files of various types...
TypeHandle is the identifier used to differentiate C++ class types.
virtual int get_num_extensions() const
Returns the number of different possible filename extensions associated with this particular file typ...
virtual string get_suggested_extension() const
Returns a suitable filename extension (without a leading dot) to suggest for files of this type...