40 virtual std::string get_name()
const=0;
42 virtual int get_num_extensions()
const;
43 virtual std::string get_extension(
int n)
const;
44 MAKE_SEQ(get_extensions, get_num_extensions, get_extension);
45 virtual std::string get_suggested_extension()
const;
47 MAKE_PROPERTY(name, get_name);
48 MAKE_SEQ_PROPERTY(extensions, get_num_extensions, get_extension);
49 MAKE_PROPERTY(suggested_extension, get_suggested_extension);
52 virtual bool has_magic_number()
const;
53 virtual bool matches_magic_number(
const std::string &magic_number)
const;
55 virtual PNMReader *make_reader(std::istream *file,
bool owns_file =
true,
56 const std::string &magic_number = std::string());
57 virtual PNMWriter *make_writer(std::ostream *file,
bool owns_file =
true);
60 static void init_pnm();
63 static bool _did_init_pnm;
68 static void register_with_read_factory();
78 static void init_type() {
79 TypedWritable::init_type();
81 TypedWritable::get_class_type());
84 return get_class_type();
86 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the base class of a family of classes that represent particular image file types that PNMImag...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...