PNMFileTypeRegistry
-
class PNMFileTypeRegistry
This class maintains the set of all known
PNMFileTypes
in the universe.Inheritance diagram
-
PNMFileTypeRegistry(PNMFileTypeRegistry const&) = default
-
static PNMFileTypeRegistry *get_global_ptr(void)
Returns a pointer to the global
PNMFileTypeRegistry
object.
-
int get_num_types(void) const
Returns the total number of types registered.
-
PNMFileType *get_type(int n) const
Returns the nth type registered.
-
PNMFileType *get_type_by_handle(TypeHandle handle) const
Returns the
PNMFileType
instance stored in the registry for the givenTypeHandle
, e.g. as retrieved by a previous call toget_type()
on the type instance.
-
PNMFileType *get_type_from_extension(std::string const &filename) const
Tries to determine what the
PNMFileType
is likely to be for a particular image file based on its extension. Returns a suitablePNMFileType
pointer, or NULL if no type can be determined.
-
PNMFileType *get_type_from_magic_number(std::string const &magic_number) const
Tries to determine what the
PNMFileType
is likely to be for a particular image file based on its magic number, the first two bytes read from the file. Returns a suitablePNMFileType
pointer, or NULL if no type can be determined.
-
void write(std::ostream &out, int indent_level = 0) const
Writes a list of supported image file types to the indicated output stream, one per line.
-
PNMFileTypeRegistry(PNMFileTypeRegistry const&) = default