15 #ifndef PNMFILETYPEPFM_H
16 #define PNMFILETYPEPFM_H
18 #include "pandabase.h"
20 #include "pnmFileType.h"
22 #include "pnmReader.h"
23 #include "pnmWriter.h"
34 virtual string get_name()
const;
44 const string &magic_number =
string());
52 virtual bool is_floating_point();
53 virtual bool read_pfm(
PfmFile &pfm);
63 virtual bool supports_floating_point();
64 virtual bool supports_integer();
65 virtual bool write_pfm(
const PfmFile &pfm);
71 static void register_with_read_factory();
80 static void init_type() {
81 PNMFileType::init_type();
82 register_type(_type_handle,
"PNMFileTypePfm",
83 PNMFileType::get_class_type());
86 return get_class_type();
88 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 int get_num_extensions() const
Returns the number of different possible filename extensions associated with this particular file typ...
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...
virtual string get_suggested_extension() const
Returns a suitable filename extension (without a leading dot) to suggest for files of this type...
Defines a pfm file, a 2-d table of floating-point numbers, either 3-component or 1-component, or with a special extension, 2- or 4-component.
virtual bool has_magic_number() const
Returns true if this particular file type uses a magic number to identify it, false otherwise...
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...
For reading and writing PFM files using the basic PNMImage interface, as if they were basic RGB files...
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool matches_magic_number(const string &magic_number) const
Returns true if the indicated "magic number" byte stream (the initial few bytes read from the file) m...